rebuild with separate debuginfo build-ids
[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
4f6233b4 5%bcond_without apidocs # Sphinx documentation
e813260b 6%bcond_with tests # test suite (SLOOOOW)
c851376d 7
8%define module Cython
9
50da0181
JB
10Summary: Language for writing Python Extension Modules (Python 2.x version)
11Summary(pl.UTF-8): Język służący do pisania modułów rozszerzających Pythona (wersja dla Pythona 2.x)
c851376d 12Name: python-%{module}
1ff52ece 13Version: 0.29.21
eb4c983c 14Release: 3
e752d74b 15License: Apache v2.0
c851376d 16Group: Libraries/Python
e813260b 17#Source0Download: https://pypi.org/simple/cython/
4f6233b4 18Source0: https://files.pythonhosted.org/packages/source/c/cython/%{module}-%{version}.tar.gz
1ff52ece
JB
19# Source0-md5: 12c5e45af71dcc6dff28cdcbcbef6f39
20Patch0: %{name}-sphinx.patch
4194a06e 21URL: http://cython.org/
d38c0db1 22BuildRequires: rpmbuild(macros) >= 1.714
50da0181 23%if %{with python2}
28c9083d
JB
24BuildRequires: python >= 1:2.6
25BuildRequires: python-devel >= 1:2.6
e44bbaad 26BuildRequires: python-setuptools
50da0181
JB
27%endif
28%if %{with python3}
e813260b
JB
29BuildRequires: python3 >= 1:3.3
30BuildRequires: python3-devel >= 1:3.3
e44bbaad 31BuildRequires: python3-setuptools
50da0181 32%endif
c851376d 33BuildRequires: rpm-pythonprov
1ff52ece 34%{?with_apidocs:BuildRequires: sphinx-pdg-3 >= 1.8}
28c9083d 35Requires: python-devel >= 1:2.6
c851376d 36BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38%define _noautocompressdoc *.c
39
40%description
41Cython lets you write code that mixes Python and C data types any way
6f08c5d3 42you want, and compiles it into a C extension for Python. Cython is
43based on Pyrex.
c851376d 44
50da0181
JB
45This package contains Cython module for Python 2.x.
46
c851376d 47%description -l pl.UTF-8
e752d74b 48Cython pozwala pisać kod zawierający dane Pythona i języka C połączone
c851376d 49w jakikolwiek sposób i kompiluje to jako rozszerzenie C dla Pythona.
6f08c5d3 50Cython jest oparty na Pyreksie.
c851376d 51
50da0181
JB
52Ten pakiet zawiera moduł Cython dla Pythona 2.x.
53
54%package -n python3-Cython
55Summary: Language for writing Python Extension Modules (Python 3.x version)
56Summary(pl.UTF-8): Język służący do pisania modułów rozszerzających Pythona (wersja dla Pythona 3.x)
57Group: Libraries/Python
e813260b 58Requires: python3-devel >= 1:3.3
50da0181
JB
59
60%description -n python3-Cython
61Cython lets you write code that mixes Python and C data types any way
62you want, and compiles it into a C extension for Python. Cython is
63based on Pyrex.
64
65This package contains Cython module for Python 3.x.
66
67%description -n python3-Cython -l pl.UTF-8
68Pyrex pozwala pisać kod zawierający dane Pythona i języka C połączone
69w jakikolwiek sposób i kompiluje to jako rozszerzenie C dla Pythona.
70Cython jest oparty na Pyreksie.
71
72Ten pakiet zawiera moduł Cython dla Pythona 3.x.
73
4f6233b4
JB
74%package apidocs
75Summary: API documentation for Cython module
76Summary(pl.UTF-8): Dokumentacja API modułu Cython
77Group: Documentation
78
79%description apidocs
80API documentation for Cython module.
81
82%description apidocs -l pl.UTF-8
83Dokumentacja API modułu Cython.
84
c851376d 85%package examples
e752d74b
JB
86Summary: Examples for Cython language
87Summary(pl.UTF-8): Przykłady programów w języku Cython
c851376d 88Group: Libraries/Python
50da0181 89Obsoletes: python3-Cython-examples
c851376d 90
91%description examples
e752d74b 92This package contains example programs for Cython language.
c851376d 93
94%description examples -l pl.UTF-8
e752d74b 95Pakiet zawierający przykładowe programy napisane w języku Cython.
c851376d 96
97%prep
98%setup -q -n %{module}-%{version}
1ff52ece 99%patch0 -p1
c851376d 100
7f7a7361 101%build
50da0181 102%if %{with python2}
ed9929e1 103%py_build
e813260b
JB
104
105%if %{with tests}
106%{__python} runtests.py
107%endif
50da0181
JB
108%endif
109
110%if %{with python3}
ed9929e1 111%py3_build
e813260b
JB
112
113%if %{with tests}
1ff52ece
JB
114%{__python3} runtests.py \
115 SPHINXBUILD=sphinx-build-3
e813260b 116%endif
50da0181 117%endif
7f7a7361 118
4f6233b4
JB
119%if %{with apidocs}
120%{__make} -C docs html
121%endif
122
c851376d 123%install
124rm -rf $RPM_BUILD_ROOT
125install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
126
50da0181 127%if %{with python3}
ed9929e1 128%py3_install
50da0181
JB
129
130%{__mv} $RPM_BUILD_ROOT%{_bindir}/cython{,3}
28c9083d 131%{__mv} $RPM_BUILD_ROOT%{_bindir}/cythonize{,3}
50da0181
JB
132%{__mv} $RPM_BUILD_ROOT%{_bindir}/cygdb{,3}
133%endif
134
135%if %{with python2}
ed9929e1 136%py_install
c851376d 137
f7af39b5 138find $RPM_BUILD_ROOT%{py_sitedir} -name "*.py" -a ! -name 'Lexicon.py' -exec rm -f {} \;
50da0181 139%endif
c851376d 140
141cp -a Demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
142
143%clean
144rm -rf $RPM_BUILD_ROOT
145
50da0181 146%if %{with python2}
c851376d 147%files
148%defattr(644,root,root,755)
e813260b 149%doc CHANGES.rst COPYING.txt README.rst ToDo.txt USAGE.txt
f7af39b5 150%attr(755,root,root) %{_bindir}/cython
28c9083d 151%attr(755,root,root) %{_bindir}/cythonize
52da8e1d 152%attr(755,root,root) %{_bindir}/cygdb
81b5c351 153%{py_sitedir}/cython.py[co]
f7af39b5 154%{py_sitedir}/Cython
155%{py_sitedir}/pyximport
50da0181
JB
156%{py_sitedir}/Cython-%{version}-py*.egg-info
157%endif
158
159%if %{with python3}
160%files -n python3-Cython
161%defattr(644,root,root,755)
e813260b 162%doc CHANGES.rst COPYING.txt README.rst ToDo.txt USAGE.txt
50da0181 163%attr(755,root,root) %{_bindir}/cython3
28c9083d 164%attr(755,root,root) %{_bindir}/cythonize3
50da0181
JB
165%attr(755,root,root) %{_bindir}/cygdb3
166%{py3_sitedir}/cython.py
167%{py3_sitedir}/__pycache__/cython.*
168%{py3_sitedir}/Cython
169%{py3_sitedir}/pyximport
170%{py3_sitedir}/Cython-%{version}-py*.egg-info
171%endif
c851376d 172
4f6233b4
JB
173%if %{with apidocs}
174%files apidocs
175%defattr(644,root,root,755)
176%doc docs/build/html/{_images,_static,src,*.html,*.js}
177%endif
178
c851376d 179%files examples
180%defattr(644,root,root,755)
181%{_examplesdir}/%{name}-%{version}
This page took 0.14409 seconds and 4 git commands to generate.