%define tarname cython # Force python3 build - required by new hplip # % {?build_python3}%{?!build_python3:%bcond_without python3} %bcond_without python3 Summary: Language for writing C extensions to Python Name: python-cython License: Apache License Group: Development/Python Url: http://www.cython.org Version: 0.29.14 Release: 2 Source0: https://github.com/cython/cython/archive/%{version}%{?rctag:%{rctag}}/%{tarname}-%{version}%{?rctag:%{rctag}}.tar.gz Source100: %{name}.rpmlintrc BuildRequires: python-devel BuildRequires: dos2unix BuildRequires: python-distribute %if %{with python3} BuildRequires: python3-distribute %endif %description Cython is a language that facilitates the writing of C extensions for the Python language. It is based on Pyrex, but provides more cutting edge functionality and optimizations. %if %{with python3} %package -n python3-cython Summary: Language for writing C extensions to Python Group: Development/Python BuildRequires: python3-devel %description -n python3-cython Cython is a language that facilitates the writing of C extensions for the Python language. It is based on Pyrex, but provides more cutting edge functionality and optimizations. %endif %prep %setup -q -c mv %{tarname}-%{version} python2 %if %{with python3} cp -r python2 python3 %endif %build pushd python2 python setup.py build popd %if %{with python3} pushd python3 python3 setup.py build popd %endif %install pushd python2 find -name .*DS_Store* | xargs rm -rf PYTHONDONTWRITEBYTECODE= python setup.py install --root %{buildroot} mv %{buildroot}/usr/bin/cython %{buildroot}/usr/bin/cython2 mv %{buildroot}/usr/bin/cygdb %{buildroot}/usr/bin/cygdb2 mv %{buildroot}/usr/bin/cythonize %{buildroot}/usr/bin/cythonize2 pushd Tools dos2unix cython-mode.el install -m 755 -d %{buildroot}%{_sysconfdir}/emacs/site-start.d install -m 644 *.el* %{buildroot}%{_sysconfdir}/emacs/site-start.d popd popd %if %{with python3} pushd python3 PYTHONDONTWRITEBYTECODE= python3 setup.py install --root %{buildroot} popd %endif #%%check #PYTHONPATH=`pwd`/../build/lib make test clean %files %{_sysconfdir}/emacs/site-start.d/*.el* %{_bindir}/cython2 %{_bindir}/cygdb2 %{_bindir}/cythonize2 %{py_platsitedir}/Cython* %{py_platsitedir}/cython* %{py_platsitedir}/pyximport* %if %{with python3} %files -n python3-cython %{_bindir}/cython %{_bindir}/cygdb %{_bindir}/cythonize %{py3_platsitedir}/__pycache__/* %{py3_platsitedir}/Cython* %{py3_platsitedir}/cython* %{py3_platsitedir}/pyximport* %endif