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