]> git.pld-linux.org Git - packages/python-Cython.git/blob - python-Cython.spec
- build both python2/python3 modules from single spec
[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.20.1
12 Release:        1
13 License:        Apache v2.0
14 Group:          Libraries/Python
15 Source0:        http://www.cython.org/release/%{module}-%{version}.tar.gz
16 # Source0-md5:  52431696c64e618036537c4d9aa79d99
17 URL:            http://www.cython.org/
18 %if %{with python2}
19 BuildRequires:  python >= 1:2.5
20 BuildRequires:  python-devel
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
29 BuildRequires:  rpm-pythonprov
30 Requires:       python-devel
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
37 you want, and compiles it into a C extension for Python. Cython is
38 based on Pyrex.
39
40 This package contains Cython module for Python 2.x.
41
42 %description -l pl.UTF-8
43 Cython pozwala pisać kod zawierający dane Pythona i języka C połączone
44 w jakikolwiek sposób i kompiluje to jako rozszerzenie C dla Pythona.
45 Cython jest oparty na Pyreksie.
46
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
69 %package examples
70 Summary:        Examples for Cython language
71 Summary(pl.UTF-8):      Przykłady programów w języku Cython
72 Group:          Libraries/Python
73 Obsoletes:      python3-Cython-examples
74
75 %description examples
76 This package contains example programs for Cython language.
77
78 %description examples -l pl.UTF-8
79 Pakiet zawierający przykładowe programy napisane w języku Cython.
80
81 %prep
82 %setup -q -n %{module}-%{version}
83
84 %build
85 %if %{with python2}
86 CC="%{__cc}" \
87 CFLAGS="%{rpmcflags}" \
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
98
99 %install
100 rm -rf $RPM_BUILD_ROOT
101 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
102
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
124
125 find $RPM_BUILD_ROOT%{py_sitedir} -name "*.py" -a ! -name 'Lexicon.py' -exec rm -f {} \;
126 %endif
127
128 cp -a Demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
129
130 %clean
131 rm -rf $RPM_BUILD_ROOT
132
133 %if %{with python2}
134 %files
135 %defattr(644,root,root,755)
136 %doc COPYING.txt README.txt ToDo.txt USAGE.txt Doc/*.html Doc/*.c
137 %attr(755,root,root) %{_bindir}/cython
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}/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
157
158 %files examples
159 %defattr(644,root,root,755)
160 %{_examplesdir}/%{name}-%{version}
This page took 0.246437 seconds and 4 git commands to generate.