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