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