]> git.pld-linux.org Git - packages/python-Cython.git/blob - python-Cython.spec
rebuild with separate debuginfo build-ids
[packages/python-Cython.git] / python-Cython.spec
1 #
2 # Conditional build:
3 %bcond_without  python2         # CPython 2.x module
4 %bcond_without  python3         # CPython 3.x module
5 %bcond_without  apidocs         # Sphinx documentation
6 %bcond_with     tests           # test suite (SLOOOOW)
7
8 %define         module  Cython
9
10 Summary:        Language for writing Python Extension Modules (Python 2.x version)
11 Summary(pl.UTF-8):      Język służący do pisania modułów rozszerzających Pythona (wersja dla Pythona 2.x)
12 Name:           python-%{module}
13 Version:        0.29.21
14 Release:        3
15 License:        Apache v2.0
16 Group:          Libraries/Python
17 #Source0Download: https://pypi.org/simple/cython/
18 Source0:        https://files.pythonhosted.org/packages/source/c/cython/%{module}-%{version}.tar.gz
19 # Source0-md5:  12c5e45af71dcc6dff28cdcbcbef6f39
20 Patch0:         %{name}-sphinx.patch
21 URL:            http://cython.org/
22 BuildRequires:  rpmbuild(macros) >= 1.714
23 %if %{with python2}
24 BuildRequires:  python >= 1:2.6
25 BuildRequires:  python-devel >= 1:2.6
26 BuildRequires:  python-setuptools
27 %endif
28 %if %{with python3}
29 BuildRequires:  python3 >= 1:3.3
30 BuildRequires:  python3-devel >= 1:3.3
31 BuildRequires:  python3-setuptools
32 %endif
33 BuildRequires:  rpm-pythonprov
34 %{?with_apidocs:BuildRequires:  sphinx-pdg-3 >= 1.8}
35 Requires:       python-devel >= 1:2.6
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
42 you want, and compiles it into a C extension for Python. Cython is
43 based on Pyrex.
44
45 This package contains Cython module for Python 2.x.
46
47 %description -l pl.UTF-8
48 Cython pozwala pisać kod zawierający dane Pythona i języka C połączone
49 w jakikolwiek sposób i kompiluje to jako rozszerzenie C dla Pythona.
50 Cython jest oparty na Pyreksie.
51
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
58 Requires:       python3-devel >= 1:3.3
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
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
85 %package examples
86 Summary:        Examples for Cython language
87 Summary(pl.UTF-8):      Przykłady programów w języku Cython
88 Group:          Libraries/Python
89 Obsoletes:      python3-Cython-examples
90
91 %description examples
92 This package contains example programs for Cython language.
93
94 %description examples -l pl.UTF-8
95 Pakiet zawierający przykładowe programy napisane w języku Cython.
96
97 %prep
98 %setup -q -n %{module}-%{version}
99 %patch0 -p1
100
101 %build
102 %if %{with python2}
103 %py_build
104
105 %if %{with tests}
106 %{__python} runtests.py
107 %endif
108 %endif
109
110 %if %{with python3}
111 %py3_build
112
113 %if %{with tests}
114 %{__python3} runtests.py \
115         SPHINXBUILD=sphinx-build-3
116 %endif
117 %endif
118
119 %if %{with apidocs}
120 %{__make} -C docs html
121 %endif
122
123 %install
124 rm -rf $RPM_BUILD_ROOT
125 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
126
127 %if %{with python3}
128 %py3_install
129
130 %{__mv} $RPM_BUILD_ROOT%{_bindir}/cython{,3}
131 %{__mv} $RPM_BUILD_ROOT%{_bindir}/cythonize{,3}
132 %{__mv} $RPM_BUILD_ROOT%{_bindir}/cygdb{,3}
133 %endif
134
135 %if %{with python2}
136 %py_install
137
138 find $RPM_BUILD_ROOT%{py_sitedir} -name "*.py" -a ! -name 'Lexicon.py' -exec rm -f {} \;
139 %endif
140
141 cp -a Demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
142
143 %clean
144 rm -rf $RPM_BUILD_ROOT
145
146 %if %{with python2}
147 %files
148 %defattr(644,root,root,755)
149 %doc CHANGES.rst COPYING.txt README.rst ToDo.txt USAGE.txt
150 %attr(755,root,root) %{_bindir}/cython
151 %attr(755,root,root) %{_bindir}/cythonize
152 %attr(755,root,root) %{_bindir}/cygdb
153 %{py_sitedir}/cython.py[co]
154 %{py_sitedir}/Cython
155 %{py_sitedir}/pyximport
156 %{py_sitedir}/Cython-%{version}-py*.egg-info
157 %endif
158
159 %if %{with python3}
160 %files -n python3-Cython
161 %defattr(644,root,root,755)
162 %doc CHANGES.rst COPYING.txt README.rst ToDo.txt USAGE.txt
163 %attr(755,root,root) %{_bindir}/cython3
164 %attr(755,root,root) %{_bindir}/cythonize3
165 %attr(755,root,root) %{_bindir}/cygdb3
166 %{py3_sitedir}/cython.py
167 %{py3_sitedir}/__pycache__/cython.*
168 %{py3_sitedir}/Cython
169 %{py3_sitedir}/pyximport
170 %{py3_sitedir}/Cython-%{version}-py*.egg-info
171 %endif
172
173 %if %{with apidocs}
174 %files apidocs
175 %defattr(644,root,root,755)
176 %doc docs/build/html/{_images,_static,src,*.html,*.js}
177 %endif
178
179 %files examples
180 %defattr(644,root,root,755)
181 %{_examplesdir}/%{name}-%{version}
This page took 0.036062 seconds and 3 git commands to generate.