]>
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} |
61ccb09f AM |
11 | Version: 0.25.2 |
12 | Release: 1 | |
e752d74b | 13 | License: Apache v2.0 |
c851376d | 14 | Group: Libraries/Python |
da43f606 | 15 | #Source0Download: https://pypi.python.org/simple/cython/ |
61ccb09f AM |
16 | Source0: https://pypi.python.org/packages/b7/67/7e2a817f9e9c773ee3995c1e15204f5d01c8da71882016cac10342ef031b/%{module}-%{version}.tar.gz |
17 | # Source0-md5: 642c81285e1bb833b14ab3f439964086 | |
4194a06e | 18 | URL: http://cython.org/ |
aff1366a | 19 | BuildRequires: rpmbuild(macros) >= 1.710 |
50da0181 | 20 | %if %{with python2} |
28c9083d JB |
21 | BuildRequires: python >= 1:2.6 |
22 | BuildRequires: python-devel >= 1:2.6 | |
e44bbaad | 23 | BuildRequires: python-setuptools |
50da0181 JB |
24 | %endif |
25 | %if %{with python3} | |
28c9083d JB |
26 | BuildRequires: python3 >= 1:3.2 |
27 | BuildRequires: python3-2to3 >= 1:3.2 | |
28 | BuildRequires: python3-devel >= 1:3.2 | |
28c9083d | 29 | BuildRequires: python3-modules >= 1:3.2 |
e44bbaad | 30 | BuildRequires: python3-setuptools |
50da0181 | 31 | %endif |
c851376d | 32 | BuildRequires: rpm-pythonprov |
28c9083d | 33 | Requires: python-devel >= 1:2.6 |
c851376d | 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 | |
6f08c5d3 | 40 | you want, and compiles it into a C extension for Python. Cython is |
41 | based on Pyrex. | |
c851376d | 42 | |
50da0181 JB |
43 | This package contains Cython module for Python 2.x. |
44 | ||
c851376d | 45 | %description -l pl.UTF-8 |
e752d74b | 46 | Cython pozwala pisać kod zawierający dane Pythona i języka C połączone |
c851376d | 47 | w jakikolwiek sposób i kompiluje to jako rozszerzenie C dla Pythona. |
6f08c5d3 | 48 | Cython jest oparty na Pyreksie. |
c851376d | 49 | |
50da0181 JB |
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 | |
28c9083d | 56 | Requires: python3-devel >= 1:3.2 |
50da0181 JB |
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 | ||
c851376d | 72 | %package examples |
e752d74b JB |
73 | Summary: Examples for Cython language |
74 | Summary(pl.UTF-8): Przykłady programów w języku Cython | |
c851376d | 75 | Group: Libraries/Python |
50da0181 | 76 | Obsoletes: python3-Cython-examples |
c851376d | 77 | |
78 | %description examples | |
e752d74b | 79 | This package contains example programs for Cython language. |
c851376d | 80 | |
81 | %description examples -l pl.UTF-8 | |
e752d74b | 82 | Pakiet zawierający przykładowe programy napisane w języku Cython. |
c851376d | 83 | |
84 | %prep | |
85 | %setup -q -n %{module}-%{version} | |
86 | ||
7f7a7361 | 87 | %build |
50da0181 | 88 | %if %{with python2} |
ed9929e1 | 89 | %py_build |
50da0181 JB |
90 | %endif |
91 | ||
92 | %if %{with python3} | |
ed9929e1 | 93 | %py3_build |
50da0181 | 94 | %endif |
7f7a7361 | 95 | |
c851376d | 96 | %install |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
99 | ||
50da0181 | 100 | %if %{with python3} |
ed9929e1 | 101 | %py3_install |
50da0181 JB |
102 | |
103 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/cython{,3} | |
28c9083d | 104 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/cythonize{,3} |
50da0181 JB |
105 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/cygdb{,3} |
106 | %endif | |
107 | ||
108 | %if %{with python2} | |
ed9929e1 | 109 | %py_install |
c851376d | 110 | |
f7af39b5 | 111 | find $RPM_BUILD_ROOT%{py_sitedir} -name "*.py" -a ! -name 'Lexicon.py' -exec rm -f {} \; |
50da0181 | 112 | %endif |
c851376d | 113 | |
114 | cp -a Demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
115 | ||
116 | %clean | |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | ||
50da0181 | 119 | %if %{with python2} |
c851376d | 120 | %files |
121 | %defattr(644,root,root,755) | |
e752d74b | 122 | %doc COPYING.txt README.txt ToDo.txt USAGE.txt Doc/*.html Doc/*.c |
f7af39b5 | 123 | %attr(755,root,root) %{_bindir}/cython |
28c9083d | 124 | %attr(755,root,root) %{_bindir}/cythonize |
52da8e1d | 125 | %attr(755,root,root) %{_bindir}/cygdb |
81b5c351 | 126 | %{py_sitedir}/cython.py[co] |
f7af39b5 | 127 | %{py_sitedir}/Cython |
128 | %{py_sitedir}/pyximport | |
50da0181 JB |
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 | |
28c9083d | 137 | %attr(755,root,root) %{_bindir}/cythonize3 |
50da0181 JB |
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 | |
c851376d | 145 | |
146 | %files examples | |
147 | %defattr(644,root,root,755) | |
148 | %{_examplesdir}/%{name}-%{version} |