source: spec/trunk/SPECS/PyQt4.spec@ 1010

Last change on this file since 1010 was 822, checked in by Silvan Scherrer, 9 years ago

spec: PyQt4 fix some wrong path entries in pyconfig.py

File size: 13.4 KB
Line 
1#define svn_url e:/trees/pyqt4/trunk
2%define svn_url http://svn.netlabs.org/repos/ports/pyqt4/trunk
3%define svn_rev 1602
4
5%define target os2
6# remove the below 2 settings, as soon as we deliver qt macros
7%define _qt4_plugindir %{_libdir}/qt4/plugins
8%define _qt4_datadir %{_datadir}/qt4
9
10# switch this on when we have python3
11#global with_python3 1
12
13#global qtassistant 1
14%global webkit 1
15
16%if 0%{?with_python3}
17%{!?python3_inc:%global python3_inc %(%{__python3} -c "from distutils.sysconfig import get_python_inc; print(get_python_inc(1))")}
18#global python3_dbus_dir %(%{__python3} -c "import dbus.mainloop; print(dbus.mainloop.__path__[0])")
19%endif
20
21%{!?__python2:%global __python2 /@unixroot/usr/bin/python2}
22%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
23%{!?python2_sitearch:%global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
24%{!?python2_inc:%global python2_inc %(%{__python2} -c "from distutils.sysconfig import get_python_inc; print get_python_inc(1)")}
25# we don't have dbus atm
26#global python2_dbus_dir %(%{__python2} -c "import dbus.mainloop; print(dbus.mainloop.__path__[0])")
27
28Summary: Python bindings for Qt4
29Name: PyQt4
30Version: 4.11.4
31Release: 3%{?dist}
32
33# GPLv2 exceptions(see GPL_EXCEPTIONS*.txt)
34License: (GPLv3 or GPLv2 with exceptions) and BSD
35Url: http://www.riverbankcomputing.com/software/pyqt/
36Vendor: bww bitwise works GmbH
37Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
38
39#BuildRequires: dbus-python
40#BuildRequires: pkgconfig(dbus-1) pkgconfig(dbus-python)
41#BuildRequires: pkgconfig(phonon)
42#BuildRequires: pkgconfig(QtDBus)
43BuildRequires: libqt4-devel >= 4.7.3
44BuildRequires: python2-devel
45BuildRequires: sip-devel >= 4.16.8
46
47%if 0%{?with_python3}
48BuildRequires: python3-dbus
49BuildRequires: python3-devel
50BuildRequires: python3-sip-devel >= 4.16.8
51%endif # with_python3
52
53#Requires: dbus-python
54Requires: libqt4 >= 4.7.3
55%{?_sip_api:Requires: sip-api(%{_sip_api_major}) >= %{_sip_api}}
56
57Provides: python-qt4 = %{version}-%{release}
58Provides: python2-qt4 = %{version}-%{release}
59Provides: python2-PyQt4 = %{version}-%{release}
60Provides: pyqt4 = %{version}-%{release}
61
62%description
63These are Python bindings for Qt4.
64
65%package devel
66Summary: Files needed to build other bindings based on Qt4
67%if 0%{?webkit}
68Obsoletes: %{name}-webkit-devel < %{version}-%{release}
69Provides: %{name}-webkit-devel = %{version}-%{release}
70Obsoletes: PyQt4 < %{version}-%{release}
71Requires: %{name}-webkit = %{version}-%{release}
72%endif
73Provides: python-qt4-devel = %{version}-%{release}
74Provides: python2-qt4-doc = %{version}-%{release}
75Provides: python2-PyQt4-doc = %{version}-%{release}
76Provides: pyqt4-devel = %{version}-%{release}
77Requires: %{name} = %{version}-%{release}
78Requires: libqt4-devel
79Requires: sip-devel
80
81%description devel
82Files needed to build other bindings for C++ classes that inherit from any
83of the Qt4 classes (e.g. KDE or your own).
84
85%package doc
86Summary: PyQt4 developer documentation and examples
87BuildArch: noarch
88Provides: python-qt4-doc = %{version}-%{release}
89Provides: python2-qt4-doc = %{version}-%{release}
90Provides: python2-PyQt4-doc = %{version}-%{release}
91
92%description doc
93%{summary}.
94
95# split-out arch'd subpkg, since (currently) %%_qt4_datadir = %%_qt4_libdir
96%package qsci-api
97Summary: Qscintilla API file support
98# when split happened, upgrade path
99Provides: python-qt4-qsci-api = %{version}-%{release}
100Provides: python2-qt4-qsci-api = %{version}-%{release}
101Provides: python2-PyQt4-qsci-api = %{version}-%{release}
102
103%description qsci-api
104%{summary}.
105
106%if 0%{?qtassistant}
107%package assistant
108Summary: Python bindings for QtAssistant
109BuildRequires: qt4-assistant >= 4.7.3
110Provides: python-qt4-assistant = %{version}-%{release}
111Provides: python2-qt4-assistant = %{version}-%{release}
112Provides: python2-PyQt4-assistant = %{version}-%{release}
113Requires: %{name} = %{version}-%{release}
114
115%description assistant
116%{summary}.
117
118%if 0%{?with_python3}
119%package -n python3-%{name}-assistant
120Summary: Python 3 bindings for QtAssistant
121Provides: python3-qt4-assistant = %{version}-%{release}
122Requires: python3-%{name} = %{version}-%{release}
123
124%description -n python3-%{name}-assistant
125%{summary}.
126%endif
127%endif
128
129%if 0%{?webkit}
130%package webkit
131Summary: Python bindings for Qt4 Webkit
132BuildRequires: libqt4-webkit-devel >= 4.7.3
133Provides: python-qt4-webkit = %{version}-%{release}
134Provides: python2-qt4-webkit = %{version}-%{release}
135Provides: python2-PyQt4-webkit = %{version}-%{release}
136Provides: pyqt4-webkit = %{version}-%{release}
137Requires: %{name} = %{version}-%{release}
138
139%description webkit
140%{summary}.
141
142%if 0%{?with_python3}
143%package -n python3-%{name}-webkit
144Summary: Python3 bindings for Qt4 Webkit
145Provides: python3-qt4-webkit = %{version}-%{release}
146Requires: python3-PyQt4 = %{version}-%{release}
147
148%description -n python3-%{name}-webkit
149%{summary}.
150%endif
151%endif
152
153%if 0%{?with_python3}
154# The bindings are imported as "PyQt4", hence it's reasonable to name the
155# Python 3 subpackage "python3-PyQt4", despite the apparent tautology
156%package -n python3-%{name}
157Summary: Python 3 bindings for Qt4
158Requires: python3-dbus
159%{?_qt4_version:Requires: libqt4 >= %{_qt4_version}}
160%{?_sip_api:Requires: python3-sip-api(%{_sip_api_major}) >= %{_sip_api}}
161Provides: python3-qt4 = %{version}-%{release}
162
163%description -n python3-%{name}
164These are Python 3 bindings for Qt4.
165
166%package -n python3-%{name}-devel
167Summary: Python 3 bindings for Qt4
168%if 0%{?webkit}
169Provides: python3-%{name}-webkit-devel = %{version}-%{release}
170Requires: python3-%{name}-webkit = %{version}-%{release}
171%endif
172Provides: python3-qt4-devel = %{version}-%{release}
173Requires: python3-%{name} = %{version}-%{release}
174Requires: python3-sip-devel
175
176%description -n python3-%{name}-devel
177Files needed to build other Python 3 bindings for C++ classes that inherit
178from any of the Qt4 classes (e.g. KDE or your own).
179%endif
180
181# no debug package at the moment, as all is already built with -s
182#debug_package
183
184
185%prep
186%if %{?svn_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{!?svn_rev):0}
187%setup -q
188%else
189%setup -n "%{name}-%{version}" -Tc
190svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
191rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip"
192(cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}")
193%endif
194
195# save orig for comparison later
196cp -a ./sip/QtGui/opengl_types.sip ./sip/QtGui/opengl_types.sip.orig
197
198# permissions, mark examples non-executable
199find examples/ -name "*.py" | xargs chmod a-x
200
201
202%build
203# !!!!!!!! remove the below instructions, when switched to shell based qmake
204#
205# configure needs qmake_sh, as else install will never work
206# adjust qmake.conf to the following
207# first before the first isEmpty(QMAKE_SH) you need to add QMAKE_SH=$$(QMAKE_SH)
208# second you need to flip all !isEmpty(QMAKE_SH) as else sip will not work ok
209# third you need to exchange the current QMAKE_RUN_GENDEF with the below block
210#isEmpty(QMAKE_SH) {
211#QMAKE_RUN_GENDEF = \
212# $(QMAKESPECDIR)\\emxexpw.cmd -name $(basename $(TARGET)) \
213# -def $(DEF_FILE) \
214# $(if $(DEF_FILE_VERSION),-version \"$(DEF_FILE_VERSION)\") \
215# $(if $(DEF_FILE_DESCRIPTION),-desc \"$(DEF_FILE_DESCRIPTION)\") \
216# $(if $(DEF_FILE_VENDOR),-vendor \"$(DEF_FILE_VENDOR)\") \
217# $(if $(DEF_FILE_TEMPLATE),-template \"$(DEF_FILE_TEMPLATE)\")
218#} else {
219#QMAKE_RUN_GENDEF = \
220# $(QMAKESPECDIR)/emxexpw.cmd -name $(basename $(TARGET)) \
221# -def $(DEF_FILE) \
222# $(if $(DEF_FILE_VERSION),-version \"$(DEF_FILE_VERSION)\") \
223# $(if $(DEF_FILE_DESCRIPTION),-desc \"$(DEF_FILE_DESCRIPTION)\") \
224# $(if $(DEF_FILE_VENDOR),-vendor \"$(DEF_FILE_VENDOR)\") \
225# $(if $(DEF_FILE_TEMPLATE),-template \"$(DEF_FILE_TEMPLATE)\")
226#}
227# forth you need to garde QMAKE_MOC with isEmpty(QMAKE_SH) and add the below block
228#} else {
229#QMAKE_MOC = $$[QT_INSTALL_BINS]/moc.exe
230#QMAKE_UIC = $$[QT_INSTALL_BINS]/uic.exe
231#QMAKE_IDC = $$[QT_INSTALL_BINS]/idc.exe
232#}
233
234export QMAKE_SH=$SHELL
235# do a fast qt build, as runmapsym and wmapsym is not needed here
236export FAST_BUILD=1
237LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
238
239# Python 2 build:
240mkdir -p %{target}
241cd %{target}
242%{__python2} ../configure.py \
243 --assume-shared \
244 --confirm-license \
245 --no-timestamp \
246 --qsci-api --qsci-api-destdir=%{_qt4_datadir}/qsci \
247 --verbose \
248 CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" LFLAGS="$LDFLAGS"
249
250make %{?_smp_mflags}
251cd ..
252
253# Python 3 build:
254%if 0%{?with_python3}
255mkdir %{target}-python3
256pushd %{target}-python3
257%{__python3} ../configure.py \
258 --assume-shared \
259 --confirm-license \
260 --no-timestamp \
261 --qmake=%{_qt4_qmake} \
262 --no-qsci-api \
263 --sipdir=%{_datadir}/python3-sip/PyQt4 \
264 --verbose \
265 CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" LFLAGS="%{?__global_ldflags}"
266
267make %{?_smp_mflags}
268popd
269%endif # with_python3
270
271
272%install
273
274# Install Python 3 first, and move aside any executables, to avoid clobbering
275# the Python 2 installation:
276%if 0%{?with_python3}
277make install DESTDIR=%{buildroot} INSTALL_ROOT=%{buildroot} -C %{target}-python3
278%endif # with_python3
279
280make install DESTDIR=%{buildroot} INSTALL_ROOT=%{buildroot} -C %{target}
281
282# remove Python 3 code from Python 2.6 directory, fixes FTBFS (#564633)
283rm -rfv %{buildroot}%{python2_sitearch}/PyQt4/uic/port_v3/
284
285# likewise, remove Python 2 code from the Python 3.1 directory:
286rm -rfv %{buildroot}%{python3_sitearch}/PyQt4/uic/port_v2/
287
288# copy designer plugin by hand, as install target isn't working atm
289mkdir -p %{buildroot}%{_qt4_plugindir}/designer
290cp %{target}/designer/pyqt4.dll %{buildroot}%{_qt4_plugindir}/designer
291
292%check
293# verify opengl_types.sip sanity
294diff -u ./sip/QtGui/opengl_types.sip.orig \
295 ./sip/QtGui/opengl_types.sip ||:
296
297
298%files
299%doc NEWS README
300%doc LICENSE
301#{python2_dbus_dir}/qt.dll
302%dir %{python2_sitearch}/PyQt4/
303%{python2_sitearch}/PyQt4/__init__.py*
304%{python2_sitearch}/PyQt4/pyqtconfig.py*
305#{python2_sitearch}/PyQt4/phonon.pyd
306%{python2_sitearch}/PyQt4/Qt.pyd
307%{python2_sitearch}/PyQt4/QtCore.pyd
308#{python2_sitearch}/PyQt4/QtDBus.pyd
309%{python2_sitearch}/PyQt4/QtDecl.pyd
310%{python2_sitearch}/PyQt4/QtDeclarative.pyd
311%{python2_sitearch}/PyQt4/QtDsgn.pyd
312%{python2_sitearch}/PyQt4/QtDesigner.pyd
313%{python2_sitearch}/PyQt4/QtGui.pyd
314%{python2_sitearch}/PyQt4/QtHelp.pyd
315#%{python2_sitearch}/PyQt4/QtMultimedia.pyd
316%{python2_sitearch}/PyQt4/QtNet.pyd
317%{python2_sitearch}/PyQt4/QtNetwork.pyd
318#%{python2_sitearch}/PyQt4/QtOpenGL.pyd
319%{python2_sitearch}/PyQt4/QtScri.pyd
320%{python2_sitearch}/PyQt4/QtScript.pyd
321%{python2_sitearch}/PyQt4/QtScTl.pyd
322%{python2_sitearch}/PyQt4/QtScriptTools.pyd
323%{python2_sitearch}/PyQt4/QtSql.pyd
324%{python2_sitearch}/PyQt4/QtSvg.pyd
325%{python2_sitearch}/PyQt4/QtTest.pyd
326%{python2_sitearch}/PyQt4/QtXml.pyd
327%{python2_sitearch}/PyQt4/QtXmlP.pyd
328%{python2_sitearch}/PyQt4/QtXmlPatterns.pyd
329%{python2_sitearch}/PyQt4/uic/
330%{_qt4_plugindir}/designer/*
331
332%if 0%{?qtassistant}
333%files assistant
334%{python2_sitearch}/PyQt4/QtAssistant.pyd
335%endif
336
337%if 0%{?webkit}
338%files webkit
339%{python2_sitearch}/PyQt4/QtWebK.pyd
340%{python2_sitearch}/PyQt4/QtWebKit.pyd
341%endif
342
343%files devel
344%{_bindir}/pylupdate4.exe
345%{_bindir}/pyrcc4.exe
346%{_bindir}/pyuic4
347%{_datadir}/sip/PyQt4/
348
349%files doc
350%doc doc/*
351%doc examples/
352
353%files qsci-api
354# avoid dep on qscintilla-python, own %%_qt4_datadir/qsci/... here for now
355%dir %{_qt4_datadir}/qsci/
356%dir %{_qt4_datadir}/qsci/api/
357%dir %{_qt4_datadir}/qsci/api/python/
358%{_qt4_datadir}/qsci/api/python/PyQt4.api
359
360%if 0%{?with_python3}
361%files -n python3-%{name}
362%doc NEWS README
363%doc LICENSE
364%{python3_dbus_dir}/qt.so
365%dir %{python3_sitearch}/PyQt4/
366%{python3_sitearch}/PyQt4/__init__.py*
367%{python3_sitearch}/PyQt4/__pycache__/
368%{python3_sitearch}/PyQt4/pyqtconfig.py*
369%{python3_sitearch}/PyQt4/phonon.pyd
370%{python3_sitearch}/PyQt4/Qt.pyd
371%{python3_sitearch}/PyQt4/QtCore.pyd
372%{python3_sitearch}/PyQt4/QtDBus.pyd
373%{python3_sitearch}/PyQt4/QtDecl.pyd
374%{python3_sitearch}/PyQt4/QtDeclarative.pyd
375%{python3_sitearch}/PyQt4/QtDsgn.pyd
376%{python3_sitearch}/PyQt4/QtDesigner.pyd
377%{python3_sitearch}/PyQt4/QtGui.pyd
378%{python3_sitearch}/PyQt4/QtHelp.pyd
379%{python3_sitearch}/PyQt4/QtMultimedia.pyd
380%{python3_sitearch}/PyQt4/QtNet.pyd
381%{python3_sitearch}/PyQt4/QtNetwork.pyd
382%{python3_sitearch}/PyQt4/QtOpenGL.pyd
383%{python3_sitearch}/PyQt4/QtScri.pyd
384%{python3_sitearch}/PyQt4/QtScript.pyd
385%{python3_sitearch}/PyQt4/QtScTl.pyd
386%{python3_sitearch}/PyQt4/QtScriptTools.pyd
387%{python3_sitearch}/PyQt4/QtSql.pyd
388%{python3_sitearch}/PyQt4/QtSvg.pyd
389%{python3_sitearch}/PyQt4/QtTest.pyd
390%{python3_sitearch}/PyQt4/QtXml.pyd
391%{python3_sitearch}/PyQt4/QtXmlP.pyd
392%{python3_sitearch}/PyQt4/QtXmlPatterns.pyd
393%{python3_sitearch}/PyQt4/uic/
394
395%if 0%{?qtassistant}
396%files -n python3-%{name}-assistant
397%{python3_sitearch}/PyQt4/QtAssistant.pyd
398%endif
399
400%if 0%{?webkit}
401%files -n python3-%{name}-webkit
402%{python3_sitearch}/PyQt4/QtWebKit.pyd
403%endif
404
405%files -n python3-%{name}-devel
406%{_bindir}/pylupdate4.exe
407%{_bindir}/pyrcc4.exe
408%{_bindir}/pyuic4
409%{_datadir}/python3-sip/PyQt4/
410%endif
411
412
413%changelog
414* Fri Jul 01 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> - 4.11.4-4
415- workaround the absolute path bug in Qt4
416
417* Tue Jun 14 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> - 4.11.4-3
418- rebuilt because of python ucs2/ucs4 change
419
420* Fri Jun 3 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> - 4.11.4-2
421- add symlink for long names
422- add nameshort tag, as inplemented in sip
423
424* Thu May 26 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> - 4.11.4-1
425- initial version
Note: See TracBrowser for help on using the repository browser.