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