%{!?__python2: %global __python2 %{__python}} %global with_python3 1 Name: python-espeak Version: 0.5 Release: 6%{?dist} Summary: Python 2 bindings for espeak Group: Development/Libraries License: GPLv3+ URL: https://launchpad.net/python-espeak Source0: http://launchpad.net/%{name}/trunk/%{version}/+download/%{name}-%{version}.tar.gz BuildRequires: espeak-devel BuildRequires: python2-devel %if 0%{?with_python3} BuildRequires: espeak-devel BuildRequires: python3-devel %endif # if with_python3 Requires: espeak %description Simple to use yet complete Python 2 bindings for the eSpeak speech synthesizer. %if 0%{?with_python3} %package -n python3-espeak Summary: Python 3 bindings for espeak Group: Development/Libraries Requires: espeak %description -n python3-espeak Simple to use yet complete Python 3 bindings for the eSpeak speech synthesizer. %endif # with_python3 %prep %setup -q -n %{name}-%{version} rm -rf python-espeak.egg-info %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' %endif # with_python3 find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' %build %{__python2} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif # with_python3 %install %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --prefix=%{_prefix} --root=%{buildroot} popd chmod 0755 %{buildroot}%{python3_sitearch}/espeak/core.cpython-33m.so %endif # with_python3 %{__python2} setup.py install -O1 --skip-build --prefix=%{_prefix} --root=%{buildroot} chmod 0755 %{buildroot}%{python2_sitearch}/espeak/core.so %files %doc COPYING NEWS %{python2_sitearch}/espeak/ %{python2_sitearch}/python_espeak-%{version}-py%{python2_version}.egg-info %if 0%{?with_python3} %files -n python3-espeak %doc COPYING NEWS %{python3_sitearch}/espeak/ %{python3_sitearch}/python_espeak-%{version}-py%{python3_version}.egg-info %endif # with_python3 %changelog * Tue Feb 18 2014 Eduardo Mayorga Téllez - 0.5-6 - Adding missing Requires in Python 3 package * Tue Feb 18 2014 Eduardo Mayorga Téllez - 0.5-5 - Logic improved * Tue Feb 11 2014 Eduardo Mayorga Téllez - 0.5-4 - Added espeak Require in Python 3 package - Fixed buildroot paths * Sat Feb 08 2014 Eduardo Mayorga Téllez - 0.5-3 - Creating %%{py3dir} in prep - Adding versioned %%{python3_version} macro in %%files for Python 3 package * Sat Jan 18 2014 Eduardo Mayorga Téllez - 0.5-2 - Adding subpackage for Python 3 - Adding espeak as Requires - Fixing files permisions - Removing bundle egg in %%prep section * Tue Jan 14 2014 Eduardo Mayorga Téllez - 0.5-1 - Use versioned %%{_python2} macro - Fixed Licence tag to GPLv3+ - Fixed URL tag * Sat Jul 20 2013 Eduardo Mayorga Téllez - 0.4-5 - Use %%{name} macro in Source * Sat Jul 20 2013 Eduardo Mayorga Téllez - 0.4-4 - Remove BuildRoot tag * Thu Jul 18 2013 Eduardo Mayorga Téllez - 0.4-3 - Remove gcc-c++ for BuildRequires - Remove unneeded %%defattr * Thu Jun 27 2013 Eduardo Mayorga Téllez - 0.4-2 - Use %%{__python} macro in %%build section - Remove for python-setuptools BuildRequires * Mon Jun 24 2013 Eduardo Mayorga Téllez - 0.4-1 - Initial packaging