From f3d81e82b730d166b3e1f88134dbb5829747b0c4 Mon Sep 17 00:00:00 2001 From: Vitaly Kuznetsov Date: Thu, 9 Feb 2012 13:07:05 +0000 Subject: [PATCH] 0.15.1-alt2 - Build with Python3 --- python-module-Cython.spec | 68 +++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 63 insertions(+), 5 deletions(-) diff --git a/python-module-Cython.spec b/python-module-Cython.spec index e7cb9b4..ebc814b 100644 --- a/python-module-Cython.spec +++ b/python-module-Cython.spec @@ -1,8 +1,10 @@ %define _name Cython +%def_with python3 + Name: python-module-%_name Version: 0.15.1 -Release: alt1 +Release: alt2 Summary: C-extensions for Python Group: Development/Python @@ -30,16 +32,53 @@ This makes Cython the ideal language for wrapping for external C libraries, and for fast C modules that speed up the execution of Python code. +%if_with python3 +%package -n python3-module-%_name +Summary: C-extensions for Python3 +Group: Development/Python3 +BuildRequires(pre): rpm-build-python3 +BuildRequires: python3-devel python3-module-distribute + +%description -n python3-module-%_name +Cython is a language that makes writing C extensions for the Python3 +language as easy as Python3 itself. Cython is based on the well-known +Pyrex, but supports more cutting edge functionality and optimizations. + +The Cython language is very close to the Python3 language, but Cython +additionally supports calling C functions and declaring C types on +variables and class attributes. This allows the compiler to generate +very efficient C code from Cython code. + +This makes Cython the ideal language for wrapping for external C +libraries, and for fast C modules that speed up the execution of Python3 +code. +%endif + %prep %setup -q -n %_name-%version +%if_with python3 +rm -rf ../python3 +cp -a . ../python3 +%endif %build -%__python setup.py build +%python_build +%if_with python3 +pushd ../python3 +%python3_build +popd +%endif %install -CFLAGS="%optflags" %__python setup.py \ -install --optimize=2 \ ---root=%buildroot +%if_with python3 +pushd ../python3 +%python3_install +popd +mv %buildroot/%_bindir/cython %buildroot/%_bindir/cython3 +mv %buildroot/%_bindir/cygdb %buildroot/%_bindir/cygdb3 +%endif + +%python_install %files %_bindir/cython @@ -55,7 +94,26 @@ install --optimize=2 \ %exclude %python_sitelibdir/%_name/Debugger %exclude %_bindir/cygdb +%if_with python3 +%files -n python3-module-%_name +%_bindir/cython3 +%python3_sitelibdir/%_name/ +%python3_sitelibdir/pyximport/ +%python3_sitelibdir/cython.py +%python3_sitelibdir/__pycache__/cython.* +%python3_sitelibdir/*egg-info + +# don't package tests files and debugger +%exclude %python3_sitelibdir/%_name/Tests +%exclude %python3_sitelibdir/%_name/*/Tests +%exclude %python3_sitelibdir/%_name/Debugger +%exclude %_bindir/cygdb3 +%endif + %changelog +* Thu Feb 09 2012 Vitaly Kuznetsov 0.15.1-alt2 +- Build with Python3 + * Mon Dec 12 2011 Yuri N. Sedunov 0.15.1-alt1 - 0.15.1 -- 1.7.7.4