]> git.pld-linux.org Git - packages/sip.git/blob - sip.spec
e3c3d31f47893f66b419495cff0e08194551f386
[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.21
10 Release:        1
11 Epoch:          2
12 License:        SIP (redistributable, see LICENSE) or GPL v2 or GPL v3
13 Group:          Development/Languages/Python
14 Source0:        https://www.riverbankcomputing.com/static/Downloads/sip/%{version}/%{name}-%{version}.tar.gz
15 # Source0-md5:  dad2afc3d8dfc0d681f3cb87eb2e55aa
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-sip-devel
51 Summary:        Python 2 development files needed to build bindings using SIP
52 Summary(pl.UTF-8):      Pliki programistyczne Pythona 2 potrzebne do budowania wiązań przy użyciu SIP-a
53 Group:          Development/Libraries
54 Requires:       %{name} = %{epoch}:%{version}-%{release}
55 Requires:       python-devel >= 1:2.3
56
57 %description -n python-sip-devel
58 Python 2 development files needed to build bindings for C++ classes
59 using SIP.
60
61 %description -n python-sip-devel -l pl.UTF-8
62 Pliki programistyczne Pythona 2 potrzebne do budowania wiązań dla klas
63 C++ przy użyciu SIP-a.
64
65 %package -n python-PyQt5-sip
66 Summary:        Python 2 module needed by SIP generated bindings for PyQt5
67 Summary(pl.UTF-8):      Moduł Pythona 2 wymagany przez wiązania wygenerowane przez SIP dla PyQt5
68 Group:          Libraries/Python
69 Requires:       python-libs
70
71 %description -n python-PyQt5-sip
72 SIP generates Python bindings for C++ class libraries from a set of
73 class specification files. This package includes Python 2 runtime
74 library needed by all generated bindings for PyQt5.
75
76 %description -n python-PyQt5-sip -l pl.UTF-8
77 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
78 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 2
79 potrzebną do uruchomienia wszystkich wygenerowanych wiązań dla PyQt5.
80
81 %package -n python-PyQt5-sip-devel
82 Summary:        Python 2 development files needed to build bindings for PyQt5 using SIP
83 Summary(pl.UTF-8):      Pliki programistyczne Pythona 2 potrzebne do budowania wiązań dla PyQt5 przy użyciu SIP-a
84 Group:          Development/Libraries
85 Requires:       python-PyQt5-sip = %{epoch}:%{version}-%{release}
86 Requires:       python-sip-devel = %{epoch}:%{version}-%{release}
87
88 %description -n python-PyQt5-sip-devel
89 Python 2 development files needed to build bindings for C++ classes
90 for PyQt5 using SIP.
91
92 %description -n python-PyQt5-sip-devel -l pl.UTF-8
93 Pliki programistyczne Pythona 2 potrzebne do budowania wiązań dla klas
94 C++ dla PyQt5 przy użyciu SIP-a.
95
96 %package -n python3-sip
97 Summary:        Python 3 module needed by SIP generated bindings
98 Summary(pl.UTF-8):      Moduł Pythona 3 wymagany przez wiązania wygenerowane przez SIP
99 Group:          Libraries/Python
100 Requires:       python3-libs
101
102 %description -n python3-sip
103 SIP generates Python bindings for C++ class libraries from a set of
104 class specification files. This package includes Python 3 runtime
105 library needed by all generated bindings.
106
107 %description -n python3-sip -l pl.UTF-8
108 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
109 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 3
110 potrzebną do uruchomienia wszystkich wygenerowanych powiązań.
111
112 %package -n python3-sip-devel
113 Summary:        Python 3 development files needed to build bindings using SIP
114 Summary(pl.UTF-8):      Pliki programistyczne Pythona 3 potrzebne do budowania wiązań przy użyciu SIP-a
115 Group:          Development/Libraries
116 Requires:       %{name} = %{epoch}:%{version}-%{release}
117 Requires:       python3-sip = %{epoch}:%{version}-%{release}
118 Requires:       python3-devel >= 1:3.2
119
120 %description -n python3-sip-devel
121 Python 3 development files needed to build bindings for C++ classes
122 using SIP.
123
124 %description -n python3-sip-devel -l pl.UTF-8
125 Pliki programistyczne Pythona 3 potrzebne do budowania wiązań dla klas
126 C++ przy użyciu SIP-a.
127
128 %package -n python3-PyQt5-sip
129 Summary:        Python 3 module needed by SIP generated bindings for PyQt5
130 Summary(pl.UTF-8):      Moduł Pythona 3 wymagany przez wiązania wygenerowane przez SIP dla PyQt5
131 Group:          Libraries/Python
132 Requires:       python3-libs
133
134 %description -n python3-PyQt5-sip
135 SIP generates Python bindings for C++ class libraries from a set of
136 class specification files. This package includes Python 2 runtime
137 library needed by all generated bindings for PyQt5.
138
139 %description -n python3-PyQt5-sip -l pl.UTF-8
140 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
141 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 2
142 potrzebną do uruchomienia wszystkich wygenerowanych wiązań dla PyQt5.
143
144 %package -n python3-PyQt5-sip-devel
145 Summary:        Python 3 development files needed to build bindings for PyQt5 using SIP
146 Summary(pl.UTF-8):      Pliki programistyczne Pythona 3 potrzebne do budowania wiązań dla PyQt5 przy użyciu SIP-a
147 Group:          Development/Libraries
148 Requires:       python3-PyQt5-sip = %{epoch}:%{version}-%{release}
149 Requires:       python3-sip-devel = %{epoch}:%{version}-%{release}
150
151 %description -n python3-PyQt5-sip-devel
152 Python 3 development files needed to build bindings for C++ classes
153 for PyQt5 using SIP.
154
155 %description -n python3-PyQt5-sip-devel -l pl.UTF-8
156 Pliki programistyczne Pythona 3 potrzebne do budowania wiązań dla klas
157 C++ dla PyQt5 przy użyciu SIP-a.
158
159 %prep
160 %setup -q
161
162 %build
163 # configure.py notes:
164 # - macros overrides must be last
165 # - cannot pass CXXFLAGS+="%{rpmcflags}" or so - builtin -O2 overrides rpmcflags
166
167 %if %{with python2}
168 install -d build-py2
169 cd build-py2
170 %{__python} ../configure.py \
171         -b %{_bindir} \
172         -e %{py_incdir} \
173         -v %{_sipfilesdir} \
174         -d %{py_sitedir} \
175         CC="%{__cc}" \
176         CXX="%{__cxx}" \
177         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
178         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
179         LINK="%{__cxx}" \
180         LINK_SHLIB="%{__cxx}"
181
182 %{__make}
183 cd ..
184
185 install -d build-py2-PyQt5
186 cd build-py2-PyQt5
187 %{__python} ../configure.py \
188         --sip-module=PyQt5.sip \
189         -b %{_bindir} \
190         -e %{py_incdir} \
191         -v %{_sipfilesdir} \
192         -d %{py_sitedir} \
193         CC="%{__cc}" \
194         CXX="%{__cxx}" \
195         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
196         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
197         LINK="%{__cxx}" \
198         LINK_SHLIB="%{__cxx}"
199
200 %{__make}
201 cd ..
202 %endif
203
204 %if %{with python3}
205 install -d build-py3
206 cd build-py3
207 %{__python3} ../configure.py \
208         -b %{_bindir} \
209         -e %{py3_incdir} \
210         -v %{_sipfilesdir} \
211         -d %{py3_sitedir} \
212         CC="%{__cc}" \
213         CXX="%{__cxx}" \
214         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
215         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
216         LINK="%{__cxx}" \
217         LINK_SHLIB="%{__cxx}"
218
219 %{__make}
220 cd ..
221
222 install -d build-py3-PyQt5
223 cd build-py3-PyQt5
224 %{__python3} ../configure.py \
225         --sip-module=PyQt5.sip \
226         -b %{_bindir} \
227         -e %{py3_incdir} \
228         -v %{_sipfilesdir} \
229         -d %{py3_sitedir} \
230         CC="%{__cc}" \
231         CXX="%{__cxx}" \
232         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
233         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
234         LINK="%{__cxx}" \
235         LINK_SHLIB="%{__cxx}"
236
237 %{__make}
238 cd ..
239 %endif
240
241 %install
242 rm -rf $RPM_BUILD_ROOT
243 install -d $RPM_BUILD_ROOT%{_sipfilesdir}
244
245 %if %{with python2}
246 %{__make} -C build-py2 install \
247         DESTDIR=$RPM_BUILD_ROOT
248
249 %{__make} -C build-py2-PyQt5 install \
250         DESTDIR=$RPM_BUILD_ROOT
251
252 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
253 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
254 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/{sip,PyQt5_sip}-%{version}.dist-info
255 %endif
256
257 %if %{with python3}
258 %{__make} -C build-py3 install \
259         DESTDIR=$RPM_BUILD_ROOT
260
261 %{__make} -C build-py3-PyQt5 install \
262         DESTDIR=$RPM_BUILD_ROOT
263
264 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
265 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
266 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/{sip,PyQt5_sip}-%{version}.dist-info
267 %endif
268
269 %clean
270 rm -rf $RPM_BUILD_ROOT
271
272 %files
273 %defattr(644,root,root,755)
274 %doc LICENSE NEWS README doc/html
275 %attr(755,root,root) %{_bindir}/sip
276 %dir %{_sipfilesdir}
277
278 %if %{with python2}
279 %files -n python-sip
280 %defattr(644,root,root,755)
281 %attr(755,root,root) %{py_sitedir}/sip.so
282
283 %files -n python-sip-devel
284 %defattr(644,root,root,755)
285 %{py_sitedir}/sipconfig.py
286 %{py_sitedir}/sipconfig.py[co]
287 %{py_sitedir}/sipdistutils.py
288 %{py_sitedir}/sipdistutils.py[co]
289 %{py_sitedir}/sip.pyi
290 %{py_incdir}/sip.h
291
292 %files -n python-PyQt5-sip
293 %defattr(644,root,root,755)
294 %dir %{py_sitedir}/PyQt5
295 %attr(755,root,root) %{py_sitedir}/PyQt5/sip.so
296
297 %files -n python-PyQt5-sip-devel
298 %defattr(644,root,root,755)
299 %{py_sitedir}/PyQt5/sip.pyi
300 %endif
301
302 %if %{with python3}
303 %files -n python3-sip
304 %defattr(644,root,root,755)
305 %attr(755,root,root) %{py3_sitedir}/sip.so
306
307 %files -n python3-sip-devel
308 %defattr(644,root,root,755)
309 %{py3_sitedir}/sipconfig.py
310 %{py3_sitedir}/sipdistutils.py
311 %{py3_sitedir}/__pycache__/sipconfig.cpython-*.py[co]
312 %{py3_sitedir}/__pycache__/sipdistutils.cpython-*.py[co]
313 %{py3_sitedir}/sip.pyi
314 %{py3_incdir}/sip.h
315
316 %files -n python3-PyQt5-sip
317 %defattr(644,root,root,755)
318 %dir %{py3_sitedir}/PyQt5
319 %attr(755,root,root) %{py3_sitedir}/PyQt5/sip.so
320
321 %files -n python3-PyQt5-sip-devel
322 %defattr(644,root,root,755)
323 %{py3_sitedir}/PyQt5/sip.pyi
324 %endif
This page took 0.086029 seconds and 2 git commands to generate.