From 00e3ce91bf3d66c56ffce5fa9688652fd394e53a Mon Sep 17 00:00:00 2001 From: Denis Silakov Date: Fri, 12 Dec 2014 13:40:11 +0400 Subject: [PATCH] Split python3 module to a separate package --- python-cython.spec | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/python-cython.spec b/python-cython.spec index b4751fe..73ec0b9 100644 --- a/python-cython.spec +++ b/python-cython.spec @@ -1,4 +1,5 @@ %define tarname Cython +%bcond_without python3 Summary: Language for writing C extensions to Python Name: python-cython @@ -12,14 +13,16 @@ Url: http://www.cython.org 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 @@ -30,29 +33,35 @@ BuildRequires: python3-devel 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 - +%if %{with python3} pushd python3 PYTHONDONTWRITEBYTECODE= %__python3 setup.py install --root %{buildroot} mv %{buildroot}/usr/bin/cython %{buildroot}/usr/bin/cython3 mv %{buildroot}/usr/bin/cygdb %{buildroot}/usr/bin/cygdb3 mv %{buildroot}/usr/bin/cythonize %{buildroot}/usr/bin/cythonize3 popd +%endif pushd python2 find -name .*DS_Store* | xargs rm -rf @@ -77,6 +86,7 @@ popd %{py_platsitedir}/cython* %{py_platsitedir}/pyximport* +%if %{with python3} %files -n python3-cython %{_bindir}/cython3 %{_bindir}/cygdb3 @@ -85,3 +95,4 @@ popd %{py3_platsitedir}/Cython* %{py3_platsitedir}/cython* %{py3_platsitedir}/pyximport* +%endif