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