]> git.pld-linux.org Git - packages/python-Cython.git/blobdiff - python-Cython.spec
- updated to 0.23.4
[packages/python-Cython.git] / python-Cython.spec
index 0f0f333349f3e5ba496830e759331c34e1f36ea2..0b51636a30113d6476f580456628d43ceb47112e 100644 (file)
@@ -1,21 +1,34 @@
+#
+# Conditional build:
+%bcond_without python2         # CPython 2.x module
+%bcond_without python3         # CPython 3.x module
 
 %define                module  Cython
 
-Summary:       Language for writing Python Extension Modules
-Summary(pl.UTF-8):     Język służący do pisania modułów rozszerzających Pythona
+Summary:       Language for writing Python Extension Modules (Python 2.x version)
+Summary(pl.UTF-8):     Język służący do pisania modułów rozszerzających Pythona (wersja dla Pythona 2.x)
 Name:          python-%{module}
-Version:       0.16
+Version:       0.23.4
 Release:       1
 License:       Apache v2.0
 Group:         Libraries/Python
-Source0:       http://www.cython.org/release/%{module}-%{version}.tar.gz
-# Source0-md5: 7934186ada3552110aba92062fa88b1c
-URL:           http://www.cython.org/
-BuildRequires: python >= 1:2.5
-BuildRequires: python-devel
+Source0:       http://cython.org/release/%{module}-%{version}.tar.gz
+# Source0-md5: 157df1f69bcec6b56fd97e0f2e057f6e
+URL:           http://cython.org/
+%if %{with python2}
+BuildRequires: python >= 1:2.6
+BuildRequires: python-devel >= 1:2.6
+BuildRequires: python-setuptools
+%endif
+%if %{with python3}
+BuildRequires: python3 >= 1:3.2
+BuildRequires: python3-2to3 >= 1:3.2
+BuildRequires: python3-devel >= 1:3.2
+BuildRequires: python3-modules >= 1:3.2
+BuildRequires: python3-setuptools
+%endif
 BuildRequires: rpm-pythonprov
-%pyrequires_eq python-libs
-%pyrequires_eq python-devel
+Requires:      python-devel >= 1:2.6
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                _noautocompressdoc      *.c
@@ -25,16 +38,40 @@ Cython lets you write code that mixes Python and C data types any way
 you want, and compiles it into a C extension for Python. Cython is
 based on Pyrex.
 
+This package contains Cython module for Python 2.x.
+
 %description -l pl.UTF-8
 Cython pozwala pisać kod zawierający dane Pythona i języka C połączone
 w jakikolwiek sposób i kompiluje to jako rozszerzenie C dla Pythona.
 Cython jest oparty na Pyreksie.
 
+Ten pakiet zawiera moduł Cython dla Pythona 2.x.
+
+%package -n python3-Cython
+Summary:       Language for writing Python Extension Modules (Python 3.x version)
+Summary(pl.UTF-8):     Język służący do pisania modułów rozszerzających Pythona (wersja dla Pythona 3.x)
+Group:         Libraries/Python
+Requires:      python3-devel >= 1:3.2
+
+%description -n python3-Cython
+Cython lets you write code that mixes Python and C data types any way
+you want, and compiles it into a C extension for Python. Cython is
+based on Pyrex.
+
+This package contains Cython module for Python 3.x.
+
+%description -n python3-Cython -l pl.UTF-8
+Pyrex pozwala pisać kod zawierający dane Pythona i języka C połączone
+w jakikolwiek sposób i kompiluje to jako rozszerzenie C dla Pythona.
+Cython jest oparty na Pyreksie.
+
+Ten pakiet zawiera moduł Cython dla Pythona 3.x.
+
 %package examples
 Summary:       Examples for Cython language
 Summary(pl.UTF-8):     Przykłady programów w języku Cython
 Group:         Libraries/Python
-Requires:      %{name} = %{version}-%{release}
+Obsoletes:     python3-Cython-examples
 
 %description examples
 This package contains example programs for Cython language.
@@ -45,31 +82,82 @@ Pakiet zawierający przykładowe programy napisane w języku Cython.
 %prep
 %setup -q -n %{module}-%{version}
 
+%build
+%if %{with python2}
+CC="%{__cc}" \
+CFLAGS="%{rpmcflags}" \
+%{__python} setup.py build \
+       --build-base build-2
+%endif
+
+%if %{with python3}
+CC="%{__cc}" \
+CFLAGS="%{rpmcflags}" \
+%{__python3} setup.py build \
+       --build-base build-3
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
-%{__python} setup.py install \
-       --root=$RPM_BUILD_ROOT \
-       --install-purelib=%{py_sitescriptdir} \
-       -O2
+%if %{with python3}
+%{__python3} setup.py \
+       build \
+               --build-base build-3 \
+       install \
+               --optimize=2 \
+               --skip-build \
+               --root=$RPM_BUILD_ROOT
+
+%{__mv} $RPM_BUILD_ROOT%{_bindir}/cython{,3}
+%{__mv} $RPM_BUILD_ROOT%{_bindir}/cythonize{,3}
+%{__mv} $RPM_BUILD_ROOT%{_bindir}/cygdb{,3}
+%endif
+
+%if %{with python2}
+%{__python} setup.py \
+       build \
+               --build-base build-2 \
+       install \
+               --optimize=2 \
+               --skip-build \
+               --root=$RPM_BUILD_ROOT
 
 find $RPM_BUILD_ROOT%{py_sitedir} -name "*.py" -a ! -name 'Lexicon.py' -exec rm -f {} \;
+%endif
 
 cp -a Demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %doc COPYING.txt README.txt ToDo.txt USAGE.txt Doc/*.html Doc/*.c
 %attr(755,root,root) %{_bindir}/cython
+%attr(755,root,root) %{_bindir}/cythonize
 %attr(755,root,root) %{_bindir}/cygdb
 %{py_sitedir}/cython.py[co]
 %{py_sitedir}/Cython
 %{py_sitedir}/pyximport
-%{py_sitedir}/Cython-*.egg-info
+%{py_sitedir}/Cython-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-Cython
+%defattr(644,root,root,755)
+%doc COPYING.txt README.txt ToDo.txt USAGE.txt Doc/*.html Doc/*.c
+%attr(755,root,root) %{_bindir}/cython3
+%attr(755,root,root) %{_bindir}/cythonize3
+%attr(755,root,root) %{_bindir}/cygdb3
+%{py3_sitedir}/cython.py
+%{py3_sitedir}/__pycache__/cython.*
+%{py3_sitedir}/Cython
+%{py3_sitedir}/pyximport
+%{py3_sitedir}/Cython-%{version}-py*.egg-info
+%endif
 
 %files examples
 %defattr(644,root,root,755)
This page took 0.090437 seconds and 4 git commands to generate.