3 %bcond_without python2 # CPython 2.x modules
4 %bcond_without python3 # CPython 3.x modules
5 %bcond_without pyqt4 # PyQt4.sip module
6 %bcond_without pyqt5 # PyQt5.sip module
8 Summary: Python bindings generator for C++ class libraries
9 Summary(pl.UTF-8): Generator powiązań Pythona z bibliotekami klas C++
14 License: SIP (redistributable, see LICENSE) or GPL v2 or GPL v3
15 Group: Development/Languages/Python
16 Source0: https://www.riverbankcomputing.com/static/Downloads/sip/%{version}/%{name}-%{version}.tar.gz
17 # Source0-md5: 595e9ad6bb0a4b3a6ea92c163a05d19c
18 URL: http://www.riverbankcomputing.com/software/sip/
19 BuildRequires: libstdc++-devel
20 BuildRequires: python-devel >= 1:2.3
21 BuildRequires: python3-devel >= 1:3.2
22 BuildRequires: rpm-pythonprov
23 BuildRequires: rpmbuild(macros) >= 1.167
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 %define _sipfilesdir %{_datadir}/sip
29 SIP generates Python bindings for C++ class libraries from a set of
30 class specification files. It supports Python v2 and v3.
32 %description -l pl.UTF-8
33 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
34 plików ze specyfikacjami klas. Obsługiwany jest Python 2 i 3.
36 %package -n python-sip
37 Summary: Python 2 module needed by SIP generated bindings
38 Summary(pl.UTF-8): Moduł Pythona 2 wymagany przez wiązania wygenerowane przez SIP
39 Group: Libraries/Python
42 %description -n python-sip
43 SIP generates Python bindings for C++ class libraries from a set of
44 class specification files. This package includes Python 2 runtime
45 library needed by all generated bindings.
47 %description -n python-sip -l pl.UTF-8
48 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
49 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 2
50 potrzebną do uruchomienia wszystkich wygenerowanych powiązań.
52 %package -n python-sip-devel
53 Summary: Python 2 development files needed to build bindings using SIP
54 Summary(pl.UTF-8): Pliki programistyczne Pythona 2 potrzebne do budowania wiązań przy użyciu SIP-a
55 Group: Development/Libraries
56 Requires: %{name} = %{epoch}:%{version}-%{release}
57 Requires: python-devel >= 1:2.3
59 %description -n python-sip-devel
60 Python 2 development files needed to build bindings for C++ classes
63 %description -n python-sip-devel -l pl.UTF-8
64 Pliki programistyczne Pythona 2 potrzebne do budowania wiązań dla klas
65 C++ przy użyciu SIP-a.
67 %package -n python-PyQt4-sip
68 Summary: Python 2 module needed by SIP generated bindings for PyQt4
69 Summary(pl.UTF-8): Moduł Pythona 2 wymagany przez wiązania wygenerowane przez SIP dla PyQt4
70 Group: Libraries/Python
73 %description -n python-PyQt4-sip
74 SIP generates Python bindings for C++ class libraries from a set of
75 class specification files. This package includes Python 2 runtime
76 library needed by all generated bindings for PyQt4.
78 %description -n python-PyQt4-sip -l pl.UTF-8
79 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
80 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 2
81 potrzebną do uruchomienia wszystkich wygenerowanych wiązań dla PyQt4.
83 %package -n python-PyQt4-sip-devel
84 Summary: Python 2 development files needed to build bindings for PyQt4 using SIP
85 Summary(pl.UTF-8): Pliki programistyczne Pythona 2 potrzebne do budowania wiązań dla PyQt4 przy użyciu SIP-a
86 Group: Development/Libraries
87 Requires: python-PyQt4-sip = %{epoch}:%{version}-%{release}
88 Requires: python-sip-devel = %{epoch}:%{version}-%{release}
90 %description -n python-PyQt4-sip-devel
91 Python 2 development files needed to build bindings for C++ classes
94 %description -n python-PyQt4-sip-devel -l pl.UTF-8
95 Pliki programistyczne Pythona 2 potrzebne do budowania wiązań dla klas
96 C++ dla PyQt4 przy użyciu SIP-a.
98 %package -n python-PyQt5-sip
99 Summary: Python 2 module needed by SIP generated bindings for PyQt5
100 Summary(pl.UTF-8): Moduł Pythona 2 wymagany przez wiązania wygenerowane przez SIP dla PyQt5
101 Group: Libraries/Python
102 Requires: python-libs
104 %description -n python-PyQt5-sip
105 SIP generates Python bindings for C++ class libraries from a set of
106 class specification files. This package includes Python 2 runtime
107 library needed by all generated bindings for PyQt5.
109 %description -n python-PyQt5-sip -l pl.UTF-8
110 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
111 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 2
112 potrzebną do uruchomienia wszystkich wygenerowanych wiązań dla PyQt5.
114 %package -n python-PyQt5-sip-devel
115 Summary: Python 2 development files needed to build bindings for PyQt5 using SIP
116 Summary(pl.UTF-8): Pliki programistyczne Pythona 2 potrzebne do budowania wiązań dla PyQt5 przy użyciu SIP-a
117 Group: Development/Libraries
118 Requires: python-PyQt5-sip = %{epoch}:%{version}-%{release}
119 Requires: python-sip-devel = %{epoch}:%{version}-%{release}
121 %description -n python-PyQt5-sip-devel
122 Python 2 development files needed to build bindings for C++ classes
125 %description -n python-PyQt5-sip-devel -l pl.UTF-8
126 Pliki programistyczne Pythona 2 potrzebne do budowania wiązań dla klas
127 C++ dla PyQt5 przy użyciu SIP-a.
129 %package -n python3-sip
130 Summary: Python 3 module needed by SIP generated bindings
131 Summary(pl.UTF-8): Moduł Pythona 3 wymagany przez wiązania wygenerowane przez SIP
132 Group: Libraries/Python
133 Requires: python3-libs
135 %description -n python3-sip
136 SIP generates Python bindings for C++ class libraries from a set of
137 class specification files. This package includes Python 3 runtime
138 library needed by all generated bindings.
140 %description -n python3-sip -l pl.UTF-8
141 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
142 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 3
143 potrzebną do uruchomienia wszystkich wygenerowanych powiązań.
145 %package -n python3-sip-devel
146 Summary: Python 3 development files needed to build bindings using SIP
147 Summary(pl.UTF-8): Pliki programistyczne Pythona 3 potrzebne do budowania wiązań przy użyciu SIP-a
148 Group: Development/Libraries
149 Requires: %{name} = %{epoch}:%{version}-%{release}
150 Requires: python3-sip = %{epoch}:%{version}-%{release}
151 Requires: python3-devel >= 1:3.2
153 %description -n python3-sip-devel
154 Python 3 development files needed to build bindings for C++ classes
157 %description -n python3-sip-devel -l pl.UTF-8
158 Pliki programistyczne Pythona 3 potrzebne do budowania wiązań dla klas
159 C++ przy użyciu SIP-a.
161 %package -n python3-PyQt4-sip
162 Summary: Python 3 module needed by SIP generated bindings for PyQt4
163 Summary(pl.UTF-8): Moduł Pythona 3 wymagany przez wiązania wygenerowane przez SIP dla PyQt4
164 Group: Libraries/Python
165 Requires: python3-libs
167 %description -n python3-PyQt4-sip
168 SIP generates Python bindings for C++ class libraries from a set of
169 class specification files. This package includes Python 2 runtime
170 library needed by all generated bindings for PyQt4.
172 %description -n python3-PyQt4-sip -l pl.UTF-8
173 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
174 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 2
175 potrzebną do uruchomienia wszystkich wygenerowanych wiązań dla PyQt4.
177 %package -n python3-PyQt4-sip-devel
178 Summary: Python 3 development files needed to build bindings for PyQt4 using SIP
179 Summary(pl.UTF-8): Pliki programistyczne Pythona 3 potrzebne do budowania wiązań dla PyQt4 przy użyciu SIP-a
180 Group: Development/Libraries
181 Requires: python3-PyQt4-sip = %{epoch}:%{version}-%{release}
182 Requires: python3-sip-devel = %{epoch}:%{version}-%{release}
184 %description -n python3-PyQt4-sip-devel
185 Python 3 development files needed to build bindings for C++ classes
188 %description -n python3-PyQt4-sip-devel -l pl.UTF-8
189 Pliki programistyczne Pythona 3 potrzebne do budowania wiązań dla klas
190 C++ dla PyQt4 przy użyciu SIP-a.
192 %package -n python3-PyQt5-sip
193 Summary: Python 3 module needed by SIP generated bindings for PyQt5
194 Summary(pl.UTF-8): Moduł Pythona 3 wymagany przez wiązania wygenerowane przez SIP dla PyQt5
195 Group: Libraries/Python
196 Requires: python3-libs
198 %description -n python3-PyQt5-sip
199 SIP generates Python bindings for C++ class libraries from a set of
200 class specification files. This package includes Python 2 runtime
201 library needed by all generated bindings for PyQt5.
203 %description -n python3-PyQt5-sip -l pl.UTF-8
204 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
205 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 2
206 potrzebną do uruchomienia wszystkich wygenerowanych wiązań dla PyQt5.
208 %package -n python3-PyQt5-sip-devel
209 Summary: Python 3 development files needed to build bindings for PyQt5 using SIP
210 Summary(pl.UTF-8): Pliki programistyczne Pythona 3 potrzebne do budowania wiązań dla PyQt5 przy użyciu SIP-a
211 Group: Development/Libraries
212 Requires: python3-PyQt5-sip = %{epoch}:%{version}-%{release}
213 Requires: python3-sip-devel = %{epoch}:%{version}-%{release}
215 %description -n python3-PyQt5-sip-devel
216 Python 3 development files needed to build bindings for C++ classes
219 %description -n python3-PyQt5-sip-devel -l pl.UTF-8
220 Pliki programistyczne Pythona 3 potrzebne do budowania wiązań dla klas
221 C++ dla PyQt5 przy użyciu SIP-a.
227 # configure.py notes:
228 # - macros overrides must be last
229 # - cannot pass CXXFLAGS+="%{rpmcflags}" or so - builtin -O2 overrides rpmcflags
234 %{__python} ../configure.py \
241 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
242 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
244 LINK_SHLIB="%{__cxx}"
249 %if %{with pyqt4} || %{with pyqt5}
250 for mod in %{?with_pyqt4:PyQt4} %{?with_pyqt5:PyQt5} ; do
251 install -d build-py2-${mod}
253 %{__python} ../configure.py \
254 --sip-module=${mod}.sip \
262 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
263 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
265 LINK_SHLIB="%{__cxx}"
276 %{__python3} ../configure.py \
283 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
284 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
286 LINK_SHLIB="%{__cxx}"
291 %if %{with pyqt4} || %{with pyqt5}
292 for mod in %{?with_pyqt4:PyQt4} %{?with_pyqt5:PyQt5} ; do
293 install -d build-py3-${mod}
295 %{__python3} ../configure.py \
296 --sip-module=${mod}.sip \
304 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
305 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
307 LINK_SHLIB="%{__cxx}"
316 rm -rf $RPM_BUILD_ROOT
317 install -d $RPM_BUILD_ROOT%{_sipfilesdir}
320 %{__make} -C build-py2 install \
321 DESTDIR=$RPM_BUILD_ROOT
323 %if %{with pyqt4} || %{with pyqt5}
324 for mod in %{?with_pyqt4:PyQt4} %{?with_pyqt5:PyQt5} ; do
325 %{__make} -C build-py2-${mod} install \
326 DESTDIR=$RPM_BUILD_ROOT
328 # ensure content is the same and hardlink
329 cmp $RPM_BUILD_ROOT%{py_sitedir}/sip.pyi $RPM_BUILD_ROOT%{py_sitedir}/${mod}/sip.pyi
330 ln -f $RPM_BUILD_ROOT%{py_sitedir}/sip.pyi $RPM_BUILD_ROOT%{py_sitedir}/${mod}/sip.pyi
334 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
335 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
336 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/sip-%{version}.dist-info
340 %{__make} -C build-py3 install \
341 DESTDIR=$RPM_BUILD_ROOT
343 %if %{with pyqt4} || %{with pyqt5}
344 for mod in %{?with_pyqt4:PyQt4} %{?with_pyqt5:PyQt5} ; do
345 %{__make} -C build-py3-${mod} install \
346 DESTDIR=$RPM_BUILD_ROOT
348 # ensure content is the same and hardlink
349 cmp $RPM_BUILD_ROOT%{py3_sitedir}/sip.pyi $RPM_BUILD_ROOT%{py3_sitedir}/${mod}/sip.pyi
350 ln -f $RPM_BUILD_ROOT%{py3_sitedir}/sip.pyi $RPM_BUILD_ROOT%{py3_sitedir}/${mod}/sip.pyi
354 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
355 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
356 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/sip-%{version}.dist-info
360 rm -rf $RPM_BUILD_ROOT
363 %defattr(644,root,root,755)
364 %doc LICENSE NEWS README doc/html
365 %attr(755,root,root) %{_bindir}/sip
370 %defattr(644,root,root,755)
371 %attr(755,root,root) %{py_sitedir}/sip.so
373 %files -n python-sip-devel
374 %defattr(644,root,root,755)
375 %{py_sitedir}/sipconfig.py
376 %{py_sitedir}/sipconfig.py[co]
377 %{py_sitedir}/sipdistutils.py
378 %{py_sitedir}/sipdistutils.py[co]
379 %{py_sitedir}/sip.pyi
383 %files -n python-PyQt4-sip
384 %defattr(644,root,root,755)
385 %dir %{py_sitedir}/PyQt4
386 %attr(755,root,root) %{py_sitedir}/PyQt4/sip.so
388 %files -n python-PyQt4-sip-devel
389 %defattr(644,root,root,755)
390 %{py_sitedir}/PyQt4/sip.pyi
394 %files -n python-PyQt5-sip
395 %defattr(644,root,root,755)
396 %dir %{py_sitedir}/PyQt5
397 %attr(755,root,root) %{py_sitedir}/PyQt5/sip.so
399 %files -n python-PyQt5-sip-devel
400 %defattr(644,root,root,755)
401 %{py_sitedir}/PyQt5/sip.pyi
406 %files -n python3-sip
407 %defattr(644,root,root,755)
408 %attr(755,root,root) %{py3_sitedir}/sip.so
410 %files -n python3-sip-devel
411 %defattr(644,root,root,755)
412 %{py3_sitedir}/sipconfig.py
413 %{py3_sitedir}/sipdistutils.py
414 %{py3_sitedir}/__pycache__/sipconfig.cpython-*.py[co]
415 %{py3_sitedir}/__pycache__/sipdistutils.cpython-*.py[co]
416 %{py3_sitedir}/sip.pyi
420 %files -n python3-PyQt4-sip
421 %defattr(644,root,root,755)
422 %dir %{py3_sitedir}/PyQt4
423 %attr(755,root,root) %{py3_sitedir}/PyQt4/sip.so
425 %files -n python3-PyQt4-sip-devel
426 %defattr(644,root,root,755)
427 %{py3_sitedir}/PyQt4/sip.pyi
431 %files -n python3-PyQt5-sip
432 %defattr(644,root,root,755)
433 %dir %{py3_sitedir}/PyQt5
434 %attr(755,root,root) %{py3_sitedir}/PyQt5/sip.so
436 %files -n python3-PyQt5-sip-devel
437 %defattr(644,root,root,755)
438 %{py3_sitedir}/PyQt5/sip.pyi