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