]> git.pld-linux.org Git - packages/python-Cython.git/blob - python-Cython.spec
ad6b8c42f0700fc43d06884468b50a479d65e89f
[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
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.23.4
12 Release:        2
13 License:        Apache v2.0
14 Group:          Libraries/Python
15 Source0:        http://cython.org/release/%{module}-%{version}.tar.gz
16 # Source0-md5:  157df1f69bcec6b56fd97e0f2e057f6e
17 URL:            http://cython.org/
18 BuildRequires:  rpmbuild(macros) >= 1.710
19 %if %{with python2}
20 BuildRequires:  python >= 1:2.6
21 BuildRequires:  python-devel >= 1:2.6
22 BuildRequires:  python-setuptools
23 %endif
24 %if %{with python3}
25 BuildRequires:  python3 >= 1:3.2
26 BuildRequires:  python3-2to3 >= 1:3.2
27 BuildRequires:  python3-devel >= 1:3.2
28 BuildRequires:  python3-modules >= 1:3.2
29 BuildRequires:  python3-setuptools
30 %endif
31 BuildRequires:  rpm-pythonprov
32 Requires:       python-devel >= 1:2.6
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
39 you want, and compiles it into a C extension for Python. Cython is
40 based on Pyrex.
41
42 This package contains Cython module for Python 2.x.
43
44 %description -l pl.UTF-8
45 Cython pozwala pisać kod zawierający dane Pythona i języka C połączone
46 w jakikolwiek sposób i kompiluje to jako rozszerzenie C dla Pythona.
47 Cython jest oparty na Pyreksie.
48
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
55 Requires:       python3-devel >= 1:3.2
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
71 %package examples
72 Summary:        Examples for Cython language
73 Summary(pl.UTF-8):      Przykłady programów w języku Cython
74 Group:          Libraries/Python
75 Obsoletes:      python3-Cython-examples
76
77 %description examples
78 This package contains example programs for Cython language.
79
80 %description examples -l pl.UTF-8
81 Pakiet zawierający przykładowe programy napisane w języku Cython.
82
83 %prep
84 %setup -q -n %{module}-%{version}
85
86 %build
87 %if %{with python2}
88 %py_build \
89         --build-base build-2
90 %endif
91
92 %if %{with python3}
93 %py3_build \
94         --build-base build-3
95 %endif
96
97 %install
98 rm -rf $RPM_BUILD_ROOT
99 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
100
101 %if %{with python3}
102 %{__python3} setup.py \
103         build \
104                 --build-base build-3 \
105         install \
106                 --optimize=2 \
107                 --skip-build \
108                 --root=$RPM_BUILD_ROOT
109
110 %{__mv} $RPM_BUILD_ROOT%{_bindir}/cython{,3}
111 %{__mv} $RPM_BUILD_ROOT%{_bindir}/cythonize{,3}
112 %{__mv} $RPM_BUILD_ROOT%{_bindir}/cygdb{,3}
113 %endif
114
115 %if %{with python2}
116 %{__python} setup.py \
117         build \
118                 --build-base build-2 \
119         install \
120                 --optimize=2 \
121                 --skip-build \
122                 --root=$RPM_BUILD_ROOT
123
124 find $RPM_BUILD_ROOT%{py_sitedir} -name "*.py" -a ! -name 'Lexicon.py' -exec rm -f {} \;
125 %endif
126
127 cp -a Demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
128
129 %clean
130 rm -rf $RPM_BUILD_ROOT
131
132 %if %{with python2}
133 %files
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}/cython
137 %attr(755,root,root) %{_bindir}/cythonize
138 %attr(755,root,root) %{_bindir}/cygdb
139 %{py_sitedir}/cython.py[co]
140 %{py_sitedir}/Cython
141 %{py_sitedir}/pyximport
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}/cythonize3
151 %attr(755,root,root) %{_bindir}/cygdb3
152 %{py3_sitedir}/cython.py
153 %{py3_sitedir}/__pycache__/cython.*
154 %{py3_sitedir}/Cython
155 %{py3_sitedir}/pyximport
156 %{py3_sitedir}/Cython-%{version}-py*.egg-info
157 %endif
158
159 %files examples
160 %defattr(644,root,root,755)
161 %{_examplesdir}/%{name}-%{version}
This page took 0.030177 seconds and 2 git commands to generate.