- updated to 0.23.4
[packages/python-Cython.git] / python-Cython.spec
CommitLineData
50da0181
JB
1#
2# Conditional build:
3%bcond_without python2 # CPython 2.x module
4%bcond_without python3 # CPython 3.x module
c851376d 5
6%define module Cython
7
50da0181
JB
8Summary: Language for writing Python Extension Modules (Python 2.x version)
9Summary(pl.UTF-8): Język służący do pisania modułów rozszerzających Pythona (wersja dla Pythona 2.x)
c851376d 10Name: python-%{module}
760790ed
JB
11Version: 0.23.4
12Release: 1
e752d74b 13License: Apache v2.0
c851376d 14Group: Libraries/Python
4194a06e 15Source0: http://cython.org/release/%{module}-%{version}.tar.gz
760790ed 16# Source0-md5: 157df1f69bcec6b56fd97e0f2e057f6e
4194a06e 17URL: http://cython.org/
50da0181 18%if %{with python2}
28c9083d
JB
19BuildRequires: python >= 1:2.6
20BuildRequires: python-devel >= 1:2.6
e44bbaad 21BuildRequires: python-setuptools
50da0181
JB
22%endif
23%if %{with python3}
28c9083d
JB
24BuildRequires: python3 >= 1:3.2
25BuildRequires: python3-2to3 >= 1:3.2
26BuildRequires: python3-devel >= 1:3.2
28c9083d 27BuildRequires: python3-modules >= 1:3.2
e44bbaad 28BuildRequires: python3-setuptools
50da0181 29%endif
c851376d 30BuildRequires: rpm-pythonprov
28c9083d 31Requires: python-devel >= 1:2.6
c851376d 32BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34%define _noautocompressdoc *.c
35
36%description
37Cython lets you write code that mixes Python and C data types any way
6f08c5d3 38you want, and compiles it into a C extension for Python. Cython is
39based on Pyrex.
c851376d 40
50da0181
JB
41This package contains Cython module for Python 2.x.
42
c851376d 43%description -l pl.UTF-8
e752d74b 44Cython pozwala pisać kod zawierający dane Pythona i języka C połączone
c851376d 45w jakikolwiek sposób i kompiluje to jako rozszerzenie C dla Pythona.
6f08c5d3 46Cython jest oparty na Pyreksie.
c851376d 47
50da0181
JB
48Ten pakiet zawiera moduł Cython dla Pythona 2.x.
49
50%package -n python3-Cython
51Summary: Language for writing Python Extension Modules (Python 3.x version)
52Summary(pl.UTF-8): Język służący do pisania modułów rozszerzających Pythona (wersja dla Pythona 3.x)
53Group: Libraries/Python
28c9083d 54Requires: python3-devel >= 1:3.2
50da0181
JB
55
56%description -n python3-Cython
57Cython lets you write code that mixes Python and C data types any way
58you want, and compiles it into a C extension for Python. Cython is
59based on Pyrex.
60
61This package contains Cython module for Python 3.x.
62
63%description -n python3-Cython -l pl.UTF-8
64Pyrex pozwala pisać kod zawierający dane Pythona i języka C połączone
65w jakikolwiek sposób i kompiluje to jako rozszerzenie C dla Pythona.
66Cython jest oparty na Pyreksie.
67
68Ten pakiet zawiera moduł Cython dla Pythona 3.x.
69
c851376d 70%package examples
e752d74b
JB
71Summary: Examples for Cython language
72Summary(pl.UTF-8): Przykłady programów w języku Cython
c851376d 73Group: Libraries/Python
50da0181 74Obsoletes: python3-Cython-examples
c851376d 75
76%description examples
e752d74b 77This package contains example programs for Cython language.
c851376d 78
79%description examples -l pl.UTF-8
e752d74b 80Pakiet zawierający przykładowe programy napisane w języku Cython.
c851376d 81
82%prep
83%setup -q -n %{module}-%{version}
84
7f7a7361 85%build
50da0181 86%if %{with python2}
7f7a7361
JB
87CC="%{__cc}" \
88CFLAGS="%{rpmcflags}" \
50da0181
JB
89%{__python} setup.py build \
90 --build-base build-2
91%endif
92
93%if %{with python3}
94CC="%{__cc}" \
95CFLAGS="%{rpmcflags}" \
96%{__python3} setup.py build \
97 --build-base build-3
98%endif
7f7a7361 99
c851376d 100%install
101rm -rf $RPM_BUILD_ROOT
102install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
103
50da0181
JB
104%if %{with python3}
105%{__python3} setup.py \
106 build \
107 --build-base build-3 \
108 install \
109 --optimize=2 \
110 --skip-build \
111 --root=$RPM_BUILD_ROOT
112
113%{__mv} $RPM_BUILD_ROOT%{_bindir}/cython{,3}
28c9083d 114%{__mv} $RPM_BUILD_ROOT%{_bindir}/cythonize{,3}
50da0181
JB
115%{__mv} $RPM_BUILD_ROOT%{_bindir}/cygdb{,3}
116%endif
117
118%if %{with python2}
119%{__python} setup.py \
120 build \
121 --build-base build-2 \
122 install \
123 --optimize=2 \
124 --skip-build \
125 --root=$RPM_BUILD_ROOT
c851376d 126
f7af39b5 127find $RPM_BUILD_ROOT%{py_sitedir} -name "*.py" -a ! -name 'Lexicon.py' -exec rm -f {} \;
50da0181 128%endif
c851376d 129
130cp -a Demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
131
132%clean
133rm -rf $RPM_BUILD_ROOT
134
50da0181 135%if %{with python2}
c851376d 136%files
137%defattr(644,root,root,755)
e752d74b 138%doc COPYING.txt README.txt ToDo.txt USAGE.txt Doc/*.html Doc/*.c
f7af39b5 139%attr(755,root,root) %{_bindir}/cython
28c9083d 140%attr(755,root,root) %{_bindir}/cythonize
52da8e1d 141%attr(755,root,root) %{_bindir}/cygdb
81b5c351 142%{py_sitedir}/cython.py[co]
f7af39b5 143%{py_sitedir}/Cython
144%{py_sitedir}/pyximport
50da0181
JB
145%{py_sitedir}/Cython-%{version}-py*.egg-info
146%endif
147
148%if %{with python3}
149%files -n python3-Cython
150%defattr(644,root,root,755)
151%doc COPYING.txt README.txt ToDo.txt USAGE.txt Doc/*.html Doc/*.c
152%attr(755,root,root) %{_bindir}/cython3
28c9083d 153%attr(755,root,root) %{_bindir}/cythonize3
50da0181
JB
154%attr(755,root,root) %{_bindir}/cygdb3
155%{py3_sitedir}/cython.py
156%{py3_sitedir}/__pycache__/cython.*
157%{py3_sitedir}/Cython
158%{py3_sitedir}/pyximport
159%{py3_sitedir}/Cython-%{version}-py*.egg-info
160%endif
c851376d 161
162%files examples
163%defattr(644,root,root,755)
164%{_examplesdir}/%{name}-%{version}
This page took 0.075185 seconds and 4 git commands to generate.