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