]> git.pld-linux.org Git - packages/python-PyQt4.git/blob - python-PyQt4.spec
a71c8c2e8b582737de9cd28200ca10480881c5bf
[packages/python-PyQt4.git] / python-PyQt4.spec
1 # TODO: __pycache__ for python3-PyQt4-uic
2 #
3 # Conditional build:
4 %bcond_without  python2 # CPython 2.x modules
5 %bcond_without  python3 # CPython 3.x modules
6
7 %define         module  PyQt4
8 # minimal required sip version
9 %define         sip_ver 2:4.19.1
10 # last qt version covered by these bindings (minimal required is currently 4.1.0)
11 %define         qt_ver  4.8.7
12
13 Summary:        Python 2 bindings for the Qt4 toolkit
14 Summary(pl.UTF-8):      Wiązania Pythona 2 do toolkitu Qt4
15 Name:           python-%{module}
16 Version:        4.12.1
17 Release:        5
18 Epoch:          1
19 License:        GPL v3
20 Group:          Libraries/Python
21 Source0:        http://downloads.sourceforge.net/pyqt/PyQt4_gpl_x11-%{version}.tar.gz
22 # Source0-md5:  0112e15858cd7d318a09e7366922f874
23 Patch0:         %{name}-dbuspath.patch
24 Patch1:         %{name}-64bit.patch
25 URL:            http://www.riverbankcomputing.com/software/pyqt/
26 # most of BR comes from configure.py
27 BuildRequires:  QtAssistant-compat-devel >= 4.6.3
28 BuildRequires:  QtCore-devel >= %{qt_ver}
29 BuildRequires:  QtDBus-devel >= %{qt_ver}
30 BuildRequires:  QtDeclarative-devel >= %{qt_ver}
31 BuildRequires:  QtDesigner-devel >= %{qt_ver}
32 BuildRequires:  QtGui-devel >= %{qt_ver}
33 BuildRequires:  QtHelp-devel >= %{qt_ver}
34 BuildRequires:  QtMultimedia-devel >= %{qt_ver}
35 BuildRequires:  QtNetwork-devel >= %{qt_ver}
36 BuildRequires:  QtOpenGL-devel >= %{qt_ver}
37 BuildRequires:  QtScript-devel >= %{qt_ver}
38 BuildRequires:  QtScriptTools-devel >= %{qt_ver}
39 BuildRequires:  QtSql-devel >= %{qt_ver}
40 BuildRequires:  QtSvg-devel >= %{qt_ver}
41 BuildRequires:  QtTest-devel >= %{qt_ver}
42 BuildRequires:  QtWebKit-devel >= %{qt_ver}
43 BuildRequires:  QtXml-devel >= %{qt_ver}
44 BuildRequires:  QtXmlPatterns-devel >= %{qt_ver}
45 BuildRequires:  phonon-devel
46 BuildRequires:  pkgconfig
47 BuildRequires:  python-dbus-devel >= 0.80
48 %if %{with python2}
49 BuildRequires:  python-dbus >= 0.80
50 BuildRequires:  python-sip-devel >= %{sip_ver}
51 %endif
52 %if %{with python3}
53 BuildRequires:  python3-dbus >= 0.80
54 BuildRequires:  python3-sip-devel >= %{sip_ver}
55 %endif
56 BuildRequires:  qt4-build >= 4.3.3-3
57 BuildRequires:  qt4-qmake >= 4.3.3-3
58 BuildRequires:  rpm-pythonprov
59 BuildRequires:  rpmbuild(macros) >= 1.219
60 Requires:       python-libs
61 Requires:       python-dbus >= 0.80
62 Requires:       python-sip >= %{sip_ver}
63 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64
65 %define         _sipfilesdir    %{_datadir}/sip
66
67 %description
68 PyQt4 is a set of Python bindings for the Qt4 toolkit. The bindings
69 are implemented as a set of Python modules: QtCore, QtDeclarative,
70 QtDesigner, QtGui, QtHelp, QtMultimedia, QtNetwork, QtOpenGL,
71 QtScript, QtScriptTools, QtSql, QtSvg, QtTest, QtWebKit, QtXml,
72 QtXmlPatterns and phonon.
73
74 This package contains Python 2 bindings.
75
76 %description -l pl.UTF-8
77 PyQt4 to zbiór wiązań Qt4 dla Pythona. Dowiązania zostały
78 zaimplementowane jako moduły Pythona: QtCore, QtDeclarative,
79 QtDesigner, QtGui, QtHelp, QtMultimedia, QtNetwork, QtOpenGL,
80 QtScript, QtScriptTools, QtSql, QtSvg, QtTest, QtWebKit, QtXml,
81 QtXmlPatterns oraz phonon.
82
83 Ten pakiet zawiera wiązania Pythona 2.
84
85 %package uic
86 Summary:        pyuic4 development tool for Python 2
87 Summary(pl.UTF-8):      Narzędzie programistyczne pyuic4 dla Pythona 2
88 Group:          Development/Tools
89 Requires:       %{name} = %{epoch}:%{version}-%{release}
90
91 %description uic
92 pyuic4 development tool for Python 2.
93
94 %description uic -l pl.UTF-8
95 Narzędzie programistyczne pyuic4 dla Pythona 2.
96
97 %package -n python3-PyQt4
98 Summary:        Python 2 bindings for the Qt4 toolkit
99 Summary(pl.UTF-8):      Wiązania Pythona 2 do toolkitu Qt4
100 Group:          Libraries/Python
101 Requires:       python3-libs
102 Requires:       python3-dbus >= 0.80
103 Requires:       python3-sip >= %{sip_ver}
104
105 %description -n python3-PyQt4
106 PyQt4 is a set of Python bindings for the Qt4 toolkit. The bindings
107 are implemented as a set of Python modules: QtCore, QtDeclarative,
108 QtDesigner, QtGui, QtHelp, QtMultimedia, QtNetwork, QtOpenGL,
109 QtScript, QtScriptTools, QtSql, QtSvg, QtTest, QtWebKit, QtXml,
110 QtXmlPatterns and phonon.
111
112 This package contains Python 3 bindings.
113
114 %description -n python3-PyQt4 -l pl.UTF-8
115 PyQt4 to zbiór wiązań Qt4 dla Pythona. Dowiązania zostały
116 zaimplementowane jako moduły Pythona: QtCore, QtDeclarative,
117 QtDesigner, QtGui, QtHelp, QtMultimedia, QtNetwork, QtOpenGL,
118 QtScript, QtScriptTools, QtSql, QtSvg, QtTest, QtWebKit, QtXml,
119 QtXmlPatterns oraz phonon.
120
121 Ten pakiet zawiera wiązania Pythona 3.
122
123 %package -n python3-PyQt4-uic
124 Summary:        pyuic4 development tool for Python 3
125 Summary(pl.UTF-8):      Narzędzie programistyczne pyuic4 dla Pythona 3
126 Group:          Development/Tools
127 Requires:       python3-PyQt4 = %{epoch}:%{version}-%{release}
128
129 %description -n python3-PyQt4-uic
130 pyuic4 development tool for Python 3.
131
132 %description -n python3-PyQt4-uic -l pl.UTF-8
133 Narzędzie programistyczne pyuic4 dla Pythona 3.
134
135 %package devel-tools
136 Summary:        PyQt4 development tools
137 Summary(pl.UTF-8):      Narzędzia programistyczne PyQt4
138 Group:          Development/Tools
139 Requires:       QtCore >= %{qt_ver}
140 Requires:       QtXml >= %{qt_ver}
141
142 %description devel-tools
143 PyQt4 development tools: pylupdate4, pyrcc4.
144
145 Note: this package doesn't depend on Python version.
146
147 %description devel-tools -l pl.UTF-8
148 Narzędzia programistyczne PyQt4: pylupdate4, pyrcc4.
149
150 Uwaga: ten pakiet nie jest zależny od wersji Pythona.
151
152 %package examples
153 Summary:        Examples for PyQt4
154 Summary(pl.UTF-8):      Przykłady do PyQt4
155 Group:          Libraries/Python
156 Requires:       %{name} = %{epoch}:%{version}-%{release}
157
158 %description examples
159 Examples code demonstrating how to use the Python bindings for Qt4.
160
161 %description examples -l pl.UTF-8
162 Przykładowy kod demonstrujący jak używać PyQt4.
163
164 %package -n sip-PyQt4
165 Summary:        SIP files needed to build other bindings based on Qt4
166 Summary(pl.UTF-8):      Pliki SIP potrzebne do budowania innych wiązań opartych na Qt4
167 Group:          Development/Languages/Python
168 Requires:       sip >= %{sip_ver}
169 Obsoletes:      python-PyQt4-devel < 4.11.3-2
170
171 %description -n sip-PyQt4
172 SIP files needed to build other bindings for C++ classes that inherit
173 from any of the Qt4 classes (e.g. KDE or your own).
174
175 %description -n sip-PyQt4 -l pl.UTF-8
176 Pliki SIP potrzebne do budowania innych wiązań do klas C++
177 dziedziczących z dowolnej klasy Qt4 (np. KDE lub własnych).
178
179 %package -n QtDesigner-plugin-pyqt4
180 Summary:        Qt Designer plugin for Python plugins with widgets
181 Summary(pl.UTF-8):      Wtyczka Qt Designera dla wtyczek Pythona zawierających widgety
182 # can build only for one python version
183 %if %{with python2}
184 Requires:       %{name} = %{epoch}:%{version}-%{release}
185 %else
186 Requires:       python3-PyQt4 = %{epoch}:%{version}-%{release}
187 %endif
188
189 %description -n QtDesigner-plugin-pyqt4
190 This is the Qt Designer plugin that collects all the Python plugins it
191 can find as a widget collection to Designer.
192
193 %description -n QtDesigner-plugin-pyqt4 -l pl.UTF-8
194 Ten pakiet zawiera wtyczkę Qt Designera zbierającą wszystkie wtyczki
195 Pythona, które jest w stanie znaleźć, jako zestaw widgetów dla
196 Designera.
197
198 %package -n qscintilla2-%{module}-api
199 Summary:        PyQt4 API file for QScintilla
200 Summary(pl.UTF-8):      Plik API PyQt4 dla QScintilli
201 Group:          Libraries/Python
202 Requires:       qscintilla2-qt4 >= 2.8.4
203
204 %description -n qscintilla2-%{module}-api
205 PyQt4 API file can be used by the QScintilla editor component to
206 enable the use of auto-completion and call tips when editing PyQt4
207 code.
208
209 %description -n qscintilla2-%{module}-api -l pl.UTF-8
210 Plik API PyQt4 może być używany przez komponent edytora QScintilla aby
211 umożliwić automatyczne dopełnianie i podpowiedzi przy modyfikowaniu
212 kodu wykorzystującego PyQt4.
213
214 %prep
215 %setup -q -n PyQt4_gpl_x11-%{version}
216 # small hack to build for shared libs - symbol QT_SHARED not defined anymore?
217 %{__sed} -i 's/qt_shared = lines\[.*\]/qt_shared = "y"/' configure.py
218 %{__sed} -i 's/resp = sys.stdin.readline.*/resp = "yes"/' configure.py
219 %patch0 -p1
220 %patch1 -p1
221
222 %build
223 %if %{with python2}
224 install -d build-py2
225 cd build-py2
226 %{__python} ../configure.py \
227         --confirm-license \
228         -c -j 3 \
229         -a \
230         -b %{_bindir} \
231         -d %{py_sitedir} \
232         -q "%{_bindir}/qmake-qt4" \
233         -v %{_sipfilesdir}/%{module} \
234         --dbus-path="%{py_sitedir}/dbus/mainloop" \
235         LIBDIR_QT="%{_libdir}" \
236         CC="%{__cc}" \
237         CXX="%{__cxx}"
238
239 %{__make}
240 cd ..
241 %endif
242
243 %if %{with python3}
244 install -d build-py3
245 cd build-py3
246 %{__python3} ../configure.py \
247         --confirm-license \
248         -c -j 3 \
249         -a \
250         -b %{_bindir} \
251         -d %{py3_sitedir} \
252         -q "%{_bindir}/qmake-qt4" \
253         -v %{_sipfilesdir}/%{module} \
254         --dbus-path="%{py3_sitedir}/dbus/mainloop" \
255         LIBDIR_QT="%{_libdir}" \
256         CC="%{__cc}" \
257         CXX="%{__cxx}"
258
259 %{__make}
260 cd ..
261 %endif
262
263 %install
264 rm -rf $RPM_BUILD_ROOT
265 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
266
267 %if %{with python3}
268 %{__make} -C build-py3 install \
269         DESTDIR=$RPM_BUILD_ROOT \
270         INSTALL_ROOT=$RPM_BUILD_ROOT
271
272 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pyuic4{,-3}
273
274 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
275 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
276 %endif
277
278 %if %{with python2}
279 %{__make} -C build-py2 install \
280         DESTDIR=$RPM_BUILD_ROOT \
281         INSTALL_ROOT=$RPM_BUILD_ROOT
282
283 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
284 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
285
286 # don't use py_postclean, leave *.py in %{py_sitedir}/PyQt4/uic/widget-plugins
287 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/PyQt4/*.py
288 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/PyQt4/uic/*.py
289 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/PyQt4/uic/Compiler/*.py
290 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/PyQt4/uic/Loader/*.py
291 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/PyQt4/uic/port_v2/*.py
292 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/PyQt4/uic/port_v3/*.py
293
294 %{__sed} -i 's,pyuic.py,pyuic.pyc,' $RPM_BUILD_ROOT%{_bindir}/pyuic4
295 %endif
296
297 cp -R examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
298
299 %clean
300 rm -rf $RPM_BUILD_ROOT
301
302 %if %{with python2}
303 %files
304 %defattr(644,root,root,755)
305 %doc NEWS README THANKS
306 %dir %{py_sitedir}/PyQt4
307 %attr(755,root,root) %{py_sitedir}/PyQt4/Qt.so
308 %attr(755,root,root) %{py_sitedir}/PyQt4/QtAssistant.so
309 %attr(755,root,root) %{py_sitedir}/PyQt4/QtCore.so
310 %attr(755,root,root) %{py_sitedir}/PyQt4/QtDBus.so
311 %attr(755,root,root) %{py_sitedir}/PyQt4/QtDeclarative.so
312 %attr(755,root,root) %{py_sitedir}/PyQt4/QtDesigner.so
313 %attr(755,root,root) %{py_sitedir}/PyQt4/QtGui.so
314 %attr(755,root,root) %{py_sitedir}/PyQt4/QtHelp.so
315 %attr(755,root,root) %{py_sitedir}/PyQt4/QtMultimedia.so
316 %attr(755,root,root) %{py_sitedir}/PyQt4/QtNetwork.so
317 %attr(755,root,root) %{py_sitedir}/PyQt4/QtOpenGL.so
318 %attr(755,root,root) %{py_sitedir}/PyQt4/QtScript.so
319 %attr(755,root,root) %{py_sitedir}/PyQt4/QtScriptTools.so
320 %attr(755,root,root) %{py_sitedir}/PyQt4/QtSql.so
321 %attr(755,root,root) %{py_sitedir}/PyQt4/QtSvg.so
322 %attr(755,root,root) %{py_sitedir}/PyQt4/QtTest.so
323 %attr(755,root,root) %{py_sitedir}/PyQt4/QtWebKit.so
324 %attr(755,root,root) %{py_sitedir}/PyQt4/QtXml.so
325 %attr(755,root,root) %{py_sitedir}/PyQt4/QtXmlPatterns.so
326 %attr(755,root,root) %{py_sitedir}/PyQt4/phonon.so
327 %{py_sitedir}/PyQt4/__init__.py[co]
328 %{py_sitedir}/PyQt4/pyqtconfig.py[co]
329 %attr(755,root,root) %{py_sitedir}/dbus/mainloop/qt.so
330
331 %files uic
332 %defattr(644,root,root,755)
333 %attr(755,root,root) %{_bindir}/pyuic4
334 %{py_sitedir}/PyQt4/uic
335 %endif
336
337 %if %{with python3}
338 %files -n python3-PyQt4
339 %defattr(644,root,root,755)
340 %doc NEWS README THANKS
341 %dir %{py3_sitedir}/PyQt4
342 %attr(755,root,root) %{py3_sitedir}/PyQt4/Qt.so
343 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtAssistant.so
344 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtCore.so
345 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtDBus.so
346 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtDeclarative.so
347 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtDesigner.so
348 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtGui.so
349 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtHelp.so
350 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtMultimedia.so
351 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtNetwork.so
352 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtOpenGL.so
353 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtScript.so
354 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtScriptTools.so
355 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtSql.so
356 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtSvg.so
357 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtTest.so
358 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtWebKit.so
359 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtXml.so
360 %attr(755,root,root) %{py3_sitedir}/PyQt4/QtXmlPatterns.so
361 %attr(755,root,root) %{py3_sitedir}/PyQt4/phonon.so
362 %{py3_sitedir}/PyQt4/__pycache__
363 %{py3_sitedir}/PyQt4/__init__.py
364 %{py3_sitedir}/PyQt4/pyqtconfig.py
365 %attr(755,root,root) %{py3_sitedir}/dbus/mainloop/qt.so
366
367 %files -n python3-PyQt4-uic
368 %defattr(644,root,root,755)
369 %attr(755,root,root) %{_bindir}/pyuic4-3
370 %{py3_sitedir}/PyQt4/uic
371 %endif
372
373 %files devel-tools
374 %defattr(644,root,root,755)
375 %attr(755,root,root) %{_bindir}/pylupdate4
376 %attr(755,root,root) %{_bindir}/pyrcc4
377
378 %files examples
379 %defattr(644,root,root,755)
380 %{_examplesdir}/%{name}-%{version}
381
382 %files -n sip-PyQt4
383 %defattr(644,root,root,755)
384 %{_sipfilesdir}/PyQt4
385
386 %files -n QtDesigner-plugin-pyqt4
387 %defattr(644,root,root,755)
388 %attr(755,root,root) %{_libdir}/qt4/plugins/designer/libpyqt4.so
389
390 %files -n qscintilla2-%{module}-api
391 %defattr(644,root,root,755)
392 %{_datadir}/qt4/qsci/api/python/PyQt4.api
This page took 0.125062 seconds and 2 git commands to generate.