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