]> git.pld-linux.org Git - packages/sip.git/blob - sip.spec
- build non-QT namespaced python modules
[packages/sip.git] / sip.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x modules
4 %bcond_without  python3 # CPython 3.x modules
5
6 Summary:        Python bindings generator for C++ class libraries
7 Summary(pl.UTF-8):      Generator powiązań Pythona z bibliotekami klas C++
8 Name:           sip
9 Version:        4.19.12
10 Release:        5
11 Epoch:          2
12 License:        SIP (redistributable, see LICENSE) or GPL v2 or GPL v3
13 Group:          Development/Languages/Python
14 Source0:        http://downloads.sourceforge.net/pyqt/sip-%{version}.tar.gz
15 # Source0-md5:  e28b0790dfe4962ce6bbd7c4772f40c9
16 URL:            http://www.riverbankcomputing.com/software/sip/
17 BuildRequires:  libstdc++-devel
18 BuildRequires:  python-devel >= 1:2.3
19 BuildRequires:  python3-devel >= 1:3.2
20 BuildRequires:  rpm-pythonprov
21 BuildRequires:  rpmbuild(macros) >= 1.167
22 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24 %define         _sipfilesdir    %{_datadir}/sip
25
26 %description
27 SIP generates Python bindings for C++ class libraries from a set of
28 class specification files. It supports Python v2 and v3.
29
30 %description -l pl.UTF-8
31 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
32 plików ze specyfikacjami klas. Obsługiwany jest Python 2 i 3.
33
34 %package -n python-sip
35 Summary:        Python 2 module needed by SIP generated bindings
36 Summary(pl.UTF-8):      Moduł Pythona 2 wymagany przez wiązania wygenerowane przez SIP
37 Group:          Libraries/Python
38 Requires:       python-libs
39
40 %description -n python-sip
41 SIP generates Python bindings for C++ class libraries from a set of
42 class specification files. This package includes Python 2 runtime
43 library needed by all generated bindings.
44
45 %description -n python-sip -l pl.UTF-8
46 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
47 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 2
48 potrzebną do uruchomienia wszystkich wygenerowanych powiązań.
49
50 %package -n python-PyQt5-sip
51 Summary:        Python 2 module needed by SIP generated bindings
52 Summary(pl.UTF-8):      Moduł Pythona 2 wymagany przez wiązania wygenerowane przez SIP
53 Group:          Libraries/Python
54 Requires:       python-libs
55
56 %description -n python-PyQt5-sip
57 SIP generates Python bindings for C++ class libraries from a set of
58 class specification files. This package includes Python 2 runtime
59 library needed by all generated bindings.
60
61 PyQt5 private copy.
62
63 %description -n python-PyQt5-sip -l pl.UTF-8
64 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
65 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 2
66 potrzebną do uruchomienia wszystkich wygenerowanych powiązań.
67
68 Prywatna kopia PyQt5.
69
70 %package -n python-sip-devel
71 Summary:        Python 2 development files needed to build bindings using SIP
72 Summary(pl.UTF-8):      Pliki programistyczne Pythona 2 potrzebne do budowania wiązań przy użyciu SIP-a
73 Group:          Development/Libraries
74 Requires:       %{name} = %{epoch}:%{version}-%{release}
75 Requires:       python-sip = %{epoch}:%{version}-%{release}
76 Requires:       python-devel >= 1:2.3
77
78 %description -n python-sip-devel
79 Python 2 development files needed to build bindings for C++ classes
80 using SIP.
81
82 %description -n python-sip-devel -l pl.UTF-8
83 Pliki programistyczne Pythona 2 potrzebne do budowania wiązań dla klas
84 C++ przy użyciu SIP-a.
85
86 %package -n python3-sip
87 Summary:        Python 3 module needed by SIP generated bindings
88 Summary(pl.UTF-8):      Moduł Pythona 3 wymagany przez wiązania wygenerowane przez SIP
89 Group:          Libraries/Python
90 Requires:       python3-libs
91
92 %description -n python3-sip
93 SIP generates Python bindings for C++ class libraries from a set of
94 class specification files. This package includes Python 3 runtime
95 library needed by all generated bindings.
96
97 %description -n python3-sip -l pl.UTF-8
98 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
99 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 3
100 potrzebną do uruchomienia wszystkich wygenerowanych powiązań.
101
102 %package -n python3-PyQt5-sip
103 Summary:        Python 3 module needed by SIP generated bindings
104 Summary(pl.UTF-8):      Moduł Pythona 3 wymagany przez wiązania wygenerowane przez SIP
105 Group:          Libraries/Python
106 Requires:       python3-libs
107
108 %description -n python3-PyQt5-sip
109 SIP generates Python bindings for C++ class libraries from a set of
110 class specification files. This package includes Python 3 runtime
111 library needed by all generated bindings.
112
113 PyQt5 private copy.
114
115 %description -n python3-PyQt5-sip -l pl.UTF-8
116 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
117 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 3
118 potrzebną do uruchomienia wszystkich wygenerowanych powiązań.
119
120 Prywatna kopia PyQt5.
121
122 %package -n python3-sip-devel
123 Summary:        Python 3 development files needed to build bindings using SIP
124 Summary(pl.UTF-8):      Pliki programistyczne Pythona 3 potrzebne do budowania wiązań przy użyciu SIP-a
125 Group:          Development/Libraries
126 Requires:       %{name} = %{epoch}:%{version}-%{release}
127 Requires:       python3-sip = %{epoch}:%{version}-%{release}
128 Requires:       python3-devel >= 1:3.2
129
130 %description -n python3-sip-devel
131 Python 3 development files needed to build bindings for C++ classes
132 using SIP.
133
134 %description -n python3-sip-devel -l pl.UTF-8
135 Pliki programistyczne Pythona 3 potrzebne do budowania wiązań dla klas
136 C++ przy użyciu SIP-a.
137
138 %prep
139 %setup -q
140
141 %build
142 # configure.py notes:
143 # - macros overrides must be last
144 # - cannot pass CXXFLAGS+="%{rpmcflags}" or so - builtin -O2 overrides rpmcflags
145
146 %if %{with python2}
147 install -d build-py2
148 cd build-py2
149 %{__python} ../configure.py \
150         -b %{_bindir} \
151         -e %{py_incdir} \
152         -v %{_sipfilesdir} \
153         -d %{py_sitedir} \
154         CC="%{__cc}" \
155         CXX="%{__cxx}" \
156         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
157         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
158         LINK="%{__cxx}" \
159         LINK_SHLIB="%{__cxx}"
160
161 %{__make}
162 cd ..
163
164 install -d build-py2-PyQt5
165 cd build-py2-PyQt5
166 %{__python} ../configure.py \
167         --sip-module=PyQt5.sip \
168         -b %{_bindir} \
169         -e %{py_incdir} \
170         -v %{_sipfilesdir} \
171         -d %{py_sitedir} \
172         CC="%{__cc}" \
173         CXX="%{__cxx}" \
174         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
175         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
176         LINK="%{__cxx}" \
177         LINK_SHLIB="%{__cxx}"
178
179 %{__make}
180 cd ..
181 %endif
182
183 %if %{with python3}
184 install -d build-py3
185 cd build-py3
186 %{__python3} ../configure.py \
187         -b %{_bindir} \
188         -e %{py3_incdir} \
189         -v %{_sipfilesdir} \
190         -d %{py3_sitedir} \
191         CC="%{__cc}" \
192         CXX="%{__cxx}" \
193         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
194         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
195         LINK="%{__cxx}" \
196         LINK_SHLIB="%{__cxx}"
197
198 %{__make}
199 cd ..
200
201 install -d build-py3-PyQt5
202 cd build-py3-PyQt5
203 %{__python3} ../configure.py \
204         --sip-module=PyQt5.sip \
205         -b %{_bindir} \
206         -e %{py3_incdir} \
207         -v %{_sipfilesdir} \
208         -d %{py3_sitedir} \
209         CC="%{__cc}" \
210         CXX="%{__cxx}" \
211         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
212         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
213         LINK="%{__cxx}" \
214         LINK_SHLIB="%{__cxx}"
215
216 %{__make}
217 cd ..
218 %endif
219
220 %install
221 rm -rf $RPM_BUILD_ROOT
222 install -d $RPM_BUILD_ROOT%{_sipfilesdir}
223
224 %if %{with python2}
225 %{__make} -C build-py2 install \
226         DESTDIR=$RPM_BUILD_ROOT
227
228 %{__make} -C build-py2-PyQt5 install \
229         DESTDIR=$RPM_BUILD_ROOT
230
231 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
232 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
233 %endif
234
235 %if %{with python3}
236 %{__make} -C build-py3 install \
237         DESTDIR=$RPM_BUILD_ROOT
238
239 %{__make} -C build-py3-PyQt5 install \
240         DESTDIR=$RPM_BUILD_ROOT
241
242 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
243 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
244 %endif
245
246 %clean
247 rm -rf $RPM_BUILD_ROOT
248
249 %files
250 %defattr(644,root,root,755)
251 %doc LICENSE NEWS README doc/html
252 %attr(755,root,root) %{_bindir}/sip
253 %dir %{_sipfilesdir}
254
255 %if %{with python2}
256 %files -n python-sip
257 %defattr(644,root,root,755)
258 %attr(755,root,root) %{py_sitedir}/sip.so
259
260 %files -n python-PyQt5-sip
261 %defattr(644,root,root,755)
262 %dir %{py_sitedir}/PyQt5
263 %attr(755,root,root) %{py_sitedir}/PyQt5/sip.so
264
265 %files -n python-sip-devel
266 %defattr(644,root,root,755)
267 %{py_sitedir}/sipconfig.py
268 %{py_sitedir}/sipconfig.py[co]
269 %{py_sitedir}/sipdistutils.py
270 %{py_sitedir}/sipdistutils.py[co]
271 %{py_sitedir}/PyQt5/sip.pyi
272 %{py_incdir}/sip.h
273 %endif
274
275 %if %{with python3}
276 %files -n python3-sip
277 %defattr(644,root,root,755)
278 %attr(755,root,root) %{py3_sitedir}/sip.so
279
280 %files -n python3-PyQt5-sip
281 %defattr(644,root,root,755)
282 %dir %{py3_sitedir}/PyQt5
283 %attr(755,root,root) %{py3_sitedir}/PyQt5/sip.so
284
285 %files -n python3-sip-devel
286 %defattr(644,root,root,755)
287 %{py3_sitedir}/sipconfig.py
288 %{py3_sitedir}/sipdistutils.py
289 %{py3_sitedir}/__pycache__/sipconfig.cpython-*.py[co]
290 %{py3_sitedir}/__pycache__/sipdistutils.cpython-*.py[co]
291 %{py3_sitedir}/PyQt5/sip.pyi
292 %{py3_incdir}/sip.h
293 %endif
This page took 0.156649 seconds and 4 git commands to generate.