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