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

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

spec: PyQt4 rebuilt with latest python changes

File size: 13.1 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 1590
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
228export QMAKE_SH=$SHELL
229# do a fast qt build, as runmapsym and wmapsym is not needed here
230export FAST_BUILD=1
231LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
232
233# Python 2 build:
234mkdir -p %{target}
235cd %{target}
236%{__python2} ../configure.py \
237 --assume-shared \
238 --confirm-license \
239 --no-timestamp \
240 --qsci-api --qsci-api-destdir=%{_qt4_datadir}/qsci \
241 --verbose \
242 CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" LFLAGS="$LDFLAGS"
243
244make %{?_smp_mflags}
245cd ..
246
247# Python 3 build:
248%if 0%{?with_python3}
249mkdir %{target}-python3
250pushd %{target}-python3
251%{__python3} ../configure.py \
252 --assume-shared \
253 --confirm-license \
254 --no-timestamp \
255 --qmake=%{_qt4_qmake} \
256 --no-qsci-api \
257 --sipdir=%{_datadir}/python3-sip/PyQt4 \
258 --verbose \
259 CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" LFLAGS="%{?__global_ldflags}"
260
261make %{?_smp_mflags}
262popd
263%endif # with_python3
264
265
266%install
267
268# Install Python 3 first, and move aside any executables, to avoid clobbering
269# the Python 2 installation:
270%if 0%{?with_python3}
271make install DESTDIR=%{buildroot} INSTALL_ROOT=%{buildroot} -C %{target}-python3
272%endif # with_python3
273
274make install DESTDIR=%{buildroot} INSTALL_ROOT=%{buildroot} -C %{target}
275
276# remove Python 3 code from Python 2.6 directory, fixes FTBFS (#564633)
277rm -rfv %{buildroot}%{python2_sitearch}/PyQt4/uic/port_v3/
278
279# likewise, remove Python 2 code from the Python 3.1 directory:
280rm -rfv %{buildroot}%{python3_sitearch}/PyQt4/uic/port_v2/
281
282# copy designer plugin by hand, as install target isn't working atm
283mkdir -p %{buildroot}%{_qt4_plugindir}/designer
284cp %{target}/designer/pyqt4.dll %{buildroot}%{_qt4_plugindir}/designer
285
286%check
287# verify opengl_types.sip sanity
288diff -u ./sip/QtGui/opengl_types.sip.orig \
289 ./sip/QtGui/opengl_types.sip ||:
290
291
292%files
293%doc NEWS README
294%doc LICENSE
295#{python2_dbus_dir}/qt.dll
296%dir %{python2_sitearch}/PyQt4/
297%{python2_sitearch}/PyQt4/__init__.py*
298%{python2_sitearch}/PyQt4/pyqtconfig.py*
299#{python2_sitearch}/PyQt4/phonon.pyd
300%{python2_sitearch}/PyQt4/Qt.pyd
301%{python2_sitearch}/PyQt4/QtCore.pyd
302#{python2_sitearch}/PyQt4/QtDBus.pyd
303%{python2_sitearch}/PyQt4/QtDecl.pyd
304%{python2_sitearch}/PyQt4/QtDeclarative.pyd
305%{python2_sitearch}/PyQt4/QtDsgn.pyd
306%{python2_sitearch}/PyQt4/QtDesigner.pyd
307%{python2_sitearch}/PyQt4/QtGui.pyd
308%{python2_sitearch}/PyQt4/QtHelp.pyd
309#%{python2_sitearch}/PyQt4/QtMultimedia.pyd
310%{python2_sitearch}/PyQt4/QtNet.pyd
311%{python2_sitearch}/PyQt4/QtNetwork.pyd
312#%{python2_sitearch}/PyQt4/QtOpenGL.pyd
313%{python2_sitearch}/PyQt4/QtScri.pyd
314%{python2_sitearch}/PyQt4/QtScript.pyd
315%{python2_sitearch}/PyQt4/QtScTl.pyd
316%{python2_sitearch}/PyQt4/QtScriptTools.pyd
317%{python2_sitearch}/PyQt4/QtSql.pyd
318%{python2_sitearch}/PyQt4/QtSvg.pyd
319%{python2_sitearch}/PyQt4/QtTest.pyd
320%{python2_sitearch}/PyQt4/QtXml.pyd
321%{python2_sitearch}/PyQt4/QtXmlP.pyd
322%{python2_sitearch}/PyQt4/QtXmlPatterns.pyd
323%{python2_sitearch}/PyQt4/uic/
324%{_qt4_plugindir}/designer/*
325
326%if 0%{?qtassistant}
327%files assistant
328%{python2_sitearch}/PyQt4/QtAssistant.pyd
329%endif
330
331%if 0%{?webkit}
332%files webkit
333%{python2_sitearch}/PyQt4/QtWebK.pyd
334%{python2_sitearch}/PyQt4/QtWebKit.pyd
335%endif
336
337%files devel
338%{_bindir}/pylupdate4.exe
339%{_bindir}/pyrcc4.exe
340%{_bindir}/pyuic4
341%{_datadir}/sip/PyQt4/
342
343%files doc
344%doc doc/*
345%doc examples/
346
347%files qsci-api
348# avoid dep on qscintilla-python, own %%_qt4_datadir/qsci/... here for now
349%dir %{_qt4_datadir}/qsci/
350%dir %{_qt4_datadir}/qsci/api/
351%dir %{_qt4_datadir}/qsci/api/python/
352%{_qt4_datadir}/qsci/api/python/PyQt4.api
353
354%if 0%{?with_python3}
355%files -n python3-%{name}
356%doc NEWS README
357%doc LICENSE
358%{python3_dbus_dir}/qt.so
359%dir %{python3_sitearch}/PyQt4/
360%{python3_sitearch}/PyQt4/__init__.py*
361%{python3_sitearch}/PyQt4/__pycache__/
362%{python3_sitearch}/PyQt4/pyqtconfig.py*
363%{python3_sitearch}/PyQt4/phonon.pyd
364%{python3_sitearch}/PyQt4/Qt.pyd
365%{python3_sitearch}/PyQt4/QtCore.pyd
366%{python3_sitearch}/PyQt4/QtDBus.pyd
367%{python3_sitearch}/PyQt4/QtDecl.pyd
368%{python3_sitearch}/PyQt4/QtDeclarative.pyd
369%{python3_sitearch}/PyQt4/QtDsgn.pyd
370%{python3_sitearch}/PyQt4/QtDesigner.pyd
371%{python3_sitearch}/PyQt4/QtGui.pyd
372%{python3_sitearch}/PyQt4/QtHelp.pyd
373%{python3_sitearch}/PyQt4/QtMultimedia.pyd
374%{python3_sitearch}/PyQt4/QtNet.pyd
375%{python3_sitearch}/PyQt4/QtNetwork.pyd
376%{python3_sitearch}/PyQt4/QtOpenGL.pyd
377%{python3_sitearch}/PyQt4/QtScri.pyd
378%{python3_sitearch}/PyQt4/QtScript.pyd
379%{python3_sitearch}/PyQt4/QtScTl.pyd
380%{python3_sitearch}/PyQt4/QtScriptTools.pyd
381%{python3_sitearch}/PyQt4/QtSql.pyd
382%{python3_sitearch}/PyQt4/QtSvg.pyd
383%{python3_sitearch}/PyQt4/QtTest.pyd
384%{python3_sitearch}/PyQt4/QtXml.pyd
385%{python3_sitearch}/PyQt4/QtXmlP.pyd
386%{python3_sitearch}/PyQt4/QtXmlPatterns.pyd
387%{python3_sitearch}/PyQt4/uic/
388
389%if 0%{?qtassistant}
390%files -n python3-%{name}-assistant
391%{python3_sitearch}/PyQt4/QtAssistant.pyd
392%endif
393
394%if 0%{?webkit}
395%files -n python3-%{name}-webkit
396%{python3_sitearch}/PyQt4/QtWebKit.pyd
397%endif
398
399%files -n python3-%{name}-devel
400%{_bindir}/pylupdate4.exe
401%{_bindir}/pyrcc4.exe
402%{_bindir}/pyuic4
403%{_datadir}/python3-sip/PyQt4/
404%endif
405
406
407%changelog
408* Tue Jun 14 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> - 4.11.4-3
409- rebuilt because of python ucs2/ucs4 change
410
411* Fri Jun 3 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> - 4.11.4-2
412- add symlink for long names
413- add nameshort tag, as inplemented in sip
414
415* Thu May 26 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> - 4.11.4-1
416- initial version
Note: See TracBrowser for help on using the repository browser.