source: packaging/qt4.spec@ 1079

Last change on this file since 1079 was 1079, checked in by Dmitry A. Kuminov, 14 years ago

packaging: Change package base name from "qt" to "qt4".

This is to not mix with any previous or future major version of Qt
(which will be binary and may be even source incompatible anyway).

File size: 18.8 KB
Line 
1#
2# http://svn.netlabs.org/qt4
3#
4# If you are a packager, please read HowToDistribute.txt for general
5# instructions.
6#
7
8Name: qt4
9Vendor: netlabs.org
10License: LGPLv2 with exceptions or GPLv3 with exceptions
11Url: http://www.qtsoftware.com/
12
13%define ver_major 4
14%define ver_minor 7
15%define ver_patch 3
16
17%define os2_release 0
18
19%define rpm_release 1
20
21%define svn_revision 1070
22
23%define descr_brief Qt is a software toolkit for developing applications.
24
25%define pkg_wps_base QT4
26%define pkg_wps_folder_id <%{pkg_wps_base}_FOLDER>
27%define pkg_wps_folder_create %{pkg_wps_base}_FOLDER:WPFolder|Qt 4|<WP_DESKTOP>
28%define pkg_wps_view_txt() EXENAME=e.exe;PROGTYPE=PROG_PM;PARAMETERS=((%*))
29
30%define pkg_docdir %{_docdir}/%{name}
31
32%if 0%{?os2_release}
33Version: %{ver_major}.%{ver_minor}.%{ver_patch}.%{os2_release}
34%else
35Version: %{ver_major}.%{ver_minor}.%{ver_patch}
36%endif
37Release: %{rpm_release}
38
39Source: %{name}-%{version}.zip
40
41#BuildRequires: gnumake (when available)
42BuildRequires: libc-devel
43BuildRequires: gcc
44BuildRequires: gcc-wlink
45BuildRequires: gcc-wrc
46#BuildRequires: cups-devel (when available)
47BuildRequires: openssl-devel
48BuildRequires: pthread-devel
49#BuildRequires: mysql-devel (when available)
50#BuildRequires: psql-devel (when available)
51
52# @todo add wrc support to Qt!
53
54#------------------------------------------------------------------------------
55# commons
56#------------------------------------------------------------------------------
57
58# process command line arguments
59%if "%{?QT_SOURCE_TREE}" == ""
60%define QT_SOURCE_TREE .
61%endif
62
63# @todo temporary
64%define skip_prep_export 1
65
66# installation paths
67%define qt_prefix %{_libdir}/%{name}
68%define qt_libdir %{_libdir}
69%define qt_headerdir %{_includedir}/%{name}
70%define qt_bindir %{qt_prefix}/bin
71%define qt_plugindir %{qt_prefix}/plugins
72%define qt_importdir %{qt_prefix}/imports
73%define qt_demosdir %{qt_prefix}/demos
74%define qt_examplesdir %{qt_prefix}/examples
75%define qt_datadir %{_datadir}/%{name}
76%define qt_docdir %{qt_datadir}/doc
77%define qt_translationdir %{qt_datadir}/translations
78%define qt_sysconfdir %{_sysconfdir}/xdg
79
80# disable lxlite compression (Qt EXEs and DLLs are already compressed)
81%define __os_install_post %{nil}
82
83#------------------------------------------------------------------------------
84# main package
85#------------------------------------------------------------------------------
86
87Summary: Qt 4 runtime
88Group: System Environment/Libraries
89
90%description
91%{descr_brief}
92
93This package contains runtime Qt libraries for console applications, including
94core, network and XML modules.
95
96%files
97%defattr(-,root,root,-)
98%docdir %{pkg_docdir}/
99%doc %{pkg_docdir}/*
100%if "%{qt_prefix}" != "%{_prefix}"
101%dir %{qt_prefix}/
102%endif
103%if "%{qt_libdir}" != "%{_libdir}"
104%dir %{qt_libdir}/
105%endif
106%if "%{qt_bindir}" != "%{_bindir}"
107%dir %{qt_bindir}/
108%endif
109%dir %{qt_plugindir}
110%{qt_plugindir}/bearer/
111%{qt_plugindir}/codecs/
112%dir %{qt_plugindir}/sqldrivers/
113%{qt_plugindir}/sqldrivers/*
114%dir %{qt_datadir}/
115%dir %{qt_docdir}/
116%dir %{qt_docdir}/qch/
117%dir %{qt_translationdir}/
118%{qt_translationdir}/qt_??.qm
119%{qt_translationdir}/qt_??_??.qm
120%if "%{qt_sysconfdir}" != "%{_sysconfdir}" && "%{qt_sysconfdir}" != "%{_sysconfdir}/xdg"
121%dir %{qt_sysconfdir}/
122%endif
123%{qt_libdir}/QtCore%{ver_major}.dll
124%{qt_libdir}/QtNet%{ver_major}.dll
125%{qt_libdir}/QtScri%{ver_major}.dll
126%{qt_libdir}/QtSql%{ver_major}.dll
127%{qt_libdir}/QtTest%{ver_major}.dll
128%{qt_libdir}/QtXml%{ver_major}.dll
129%{qt_libdir}/QtXmlP%{ver_major}.dll
130
131%pre
132
133%warpin_conflicts_begin
134netlabs.org\Qt4\Runtime
135%warpin_conflicts_end
136
137#------------------------------------------------------------------------------
138%package pm
139#------------------------------------------------------------------------------
140
141Summary: Qt 4 GUI runtime
142Group: System Environment/Libraries
143
144Requires: %{name} = %{version}-%{release}
145
146%description pm
147%{descr_brief}
148
149This package contains runtime Qt libraries for Presentation Manager GUI
150applications.
151
152%files pm
153%defattr(-,root,root,-)
154%dir %{qt_plugindir}/designer
155%{qt_plugindir}/designer/qdeclv.dll
156%{qt_plugindir}/accessible/
157%{qt_plugindir}/graphicssystems/
158%{qt_plugindir}/iconengines/
159%{qt_plugindir}/imageformats/
160%{qt_plugindir}/qmltooling/
161%{qt_translationdir}/qt_help_??.qm
162%{qt_translationdir}/qt_help_??_??.qm
163%dir %{qt_importdir}/
164%{qt_importdir}/Qt/
165%{qt_libdir}/QtCLuc%{ver_major}.dll
166%{qt_libdir}/QtDecl%{ver_major}.dll
167%{qt_libdir}/QtGui%{ver_major}.dll
168%{qt_libdir}/QtHelp%{ver_major}.dll
169%{qt_libdir}/QtScTl%{ver_major}.dll
170%{qt_libdir}/QtSvg%{ver_major}.dll
171
172#------------------------------------------------------------------------------
173%package webkit
174#------------------------------------------------------------------------------
175
176Summary: Qt 4 WebKit runtime
177Group: System Environment/Libraries
178
179Requires: %{name}-pm = %{version}-%{release}
180
181%description webkit
182%{descr_brief}
183
184This package contains runtime Qt libraries for applications based on the WebKit
185technology.
186
187%files webkit
188%defattr(-,root,root,-)
189%{qt_plugindir}/designer/qwebv.dll
190%{qt_importdir}/QtWebKit/
191%{qt_libdir}/QtWebK%{ver_major}.dll
192
193#------------------------------------------------------------------------------
194%package demos
195#------------------------------------------------------------------------------
196Summary: Qt 4 demos and examples
197Group: Documentation
198
199Requires: %{name}-pm = %{version}-%{release}
200Requires: %{name}-webkit = %{version}-%{release}
201
202%description demos
203%{descr_brief}
204
205This package contains the demo and example Qt applications and their
206source code. These applications demonstrate the possibilities of the
207Qt toolkit.
208
209%files demos
210%defattr(-,root,root,-)
211%{qt_plugindir}/designer/
212%exclude %{qt_plugindir}/designer/qdeclv.dll
213%exclude %{qt_plugindir}/designer/qwebv.dll
214%{qt_bindir}/qtdemo.exe
215%{qt_examplesdir}
216%{qt_demosdir}
217
218%post demos
219%wps_object_create_begin -n %{name}-demos
220%{pkg_wps_folder_create}
221%{pkg_wps_base}_DEMO:WPProgram|Examples and Demos|%{pkg_wps_folder_id}|EXENAME=((%{qt_bindir}/qtdemo.exe))
222%wps_object_create_end
223
224%postun demos
225%wps_object_delete_all -n %{name}-demos
226
227#------------------------------------------------------------------------------
228%package qmlviewer
229#------------------------------------------------------------------------------
230Summary: Qt 4 QML Viewer tool
231Group: Development/Tools
232
233Requires: %{name}-pm = %{version}-%{release}
234
235%description qmlviewer
236%{descr_brief}
237
238This package contains the Qt QML Viewer tool that allows to view QML files.
239
240%files qmlviewer
241%defattr(-,root,root,-)
242%{qt_bindir}/qmlviewer.exe
243
244%post qmlviewer
245%wps_object_create_begin -n %{name}-qmlviewer
246%{pkg_wps_folder_create}
247%{pkg_wps_base}_QMLVIEWER:WPProgram|QML Viewer|%{pkg_wps_folder_id}|EXENAME=((%{qt_bindir}/qmlview.exe))
248%wps_object_create_end
249
250%postun qmlviewer
251%wps_object_delete_all -n %{name}-qmlviewer
252
253#------------------------------------------------------------------------------
254%package linguist
255#------------------------------------------------------------------------------
256Summary: Qt 4 Linguist tool
257Group: Development/Tools
258
259Requires: %{name}-pm = %{version}-%{release}
260
261%description linguist
262%{descr_brief}
263
264This package contains the Qt Linguist tool used to edit the translation files
265for Qt applications.
266
267%files linguist
268%defattr(-,root,root,-)
269%{qt_translationdir}/linguist_??.qm
270%{qt_translationdir}/linguist_??_??.qm
271%dir %{qt_datadir}/phrasebooks/
272%{qt_datadir}/phrasebooks/*
273%{qt_bindir}/linguist.exe
274
275%post linguist
276%wps_object_create_begin -n %{name}-linguist
277%{wps_qt4_folder}
278%{pkg_wps_base}_LINGUIST:WPProgram|Linguist|%{pkg_wps_folder_id}|EXENAME=((%{qt_bindir}/linguist.exe))
279%wps_object_create_end
280
281%postun linguist
282%wps_object_delete_all -n %{name}-linguist
283
284#------------------------------------------------------------------------------
285%package assistant
286#------------------------------------------------------------------------------
287Summary: Qt 4 Assistant tool
288Group: Development/Tools
289
290Requires: %{name}-pm = %{version}-%{release}
291
292%description assistant
293%{descr_brief}
294
295This package contains the Qt Assistant tool used to read and search the Qt
296Toolkit reference documentation.
297
298%files assistant
299%defattr(-,root,root,-)
300%{qt_translationdir}/assistant_??.qm
301%{qt_translationdir}/assistant_??_??.qm
302%{qt_bindir}/assistant.exe
303
304%post assistant
305%wps_object_create_begin -n %{name}-assistant
306%{wps_qt4_folder}
307%{pkg_wps_base}_ASSISTANT:WPProgram|Assistant|%{pkg_wps_folder_id}|EXENAME=((%{qt_bindir}/assistant.exe))
308%wps_object_create_end
309
310%postun assistant
311%wps_object_delete_all -n %{name}-assistant
312
313#------------------------------------------------------------------------------
314%package designer
315#------------------------------------------------------------------------------
316Summary: Qt 4 Designer tool
317Group: Development/Tools
318
319Requires: %{name}-pm = %{version}-%{release}
320
321%description designer
322%{descr_brief}
323
324This package contains the Qt Designer tool used to for designing and building
325graphical user interfaces from Qt components.
326
327%files designer
328%defattr(-,root,root,-)
329%{qt_translationdir}/designer_??.qm
330%{qt_translationdir}/designer_??_??.qm
331%{qt_libdir}/QtDsgC%{ver_major}.dll
332%{qt_libdir}/QtDsgn%{ver_major}.dll
333%{qt_bindir}/designer.exe
334
335%post designer
336%wps_object_create_begin -n %{name}-designer
337%{wps_qt4_folder}
338%{pkg_wps_base}_DESIGNER:WPProgram|Designer|%{pkg_wps_folder_id}|EXENAME=((%{qt_bindir}/designer.exe))
339%wps_object_create_end
340
341%postun designer
342%wps_object_delete_all -n %{name}-designer
343
344#------------------------------------------------------------------------------
345%package devel-tools
346#------------------------------------------------------------------------------
347Summary: Qt 4 development tools
348Group: Development/Tools
349
350Requires: %{name}-pm = %{version}-%{release}
351
352%description devel-tools
353%{descr_brief}
354
355This package contains tools used to assist in Qt development, including
356PixelTool, Help Converter and other applications.
357
358%files devel-tools
359%defattr(-,root,root,-)
360%{qt_bindir}/lconvert.exe
361%{qt_bindir}/pixeltool.exe
362%{qt_bindir}/qcollectiongenerator.exe
363%{qt_bindir}/qdoc3.exe
364%{qt_bindir}/qhelpconverter.exe
365%{qt_bindir}/qhelpgenerator.exe
366%{qt_bindir}/qt3to4.exe
367%{qt_bindir}/qttracereplay.exe
368%{qt_bindir}/xmlpatterns.exe
369%{qt_bindir}/xmlpatternsvalidator.exe
370
371#------------------------------------------------------------------------------
372%package doc
373#------------------------------------------------------------------------------
374Summary: Qt 4 API documentation
375Group: Documentation
376BuildArch: noarch
377
378Requires: %{name}-assistant = %{version}-%{release}
379
380%description doc
381%{descr_brief}
382
383This package contains the Qt Toolkit reference documentation that provides the
384detailed description of all Qt classes and tools.
385
386%files doc
387%defattr(-,root,root,-)
388%{qt_docdir}/qch/*.qch
389
390#------------------------------------------------------------------------------
391%package devel
392#------------------------------------------------------------------------------
393Summary: Qt 4 development files
394Group: Development/Libraries
395
396Requires: %{name}-pm = %{version}-%{release}
397
398%description devel
399%{descr_brief}
400
401This package contains the headers, libraries and tools necessary to develop
402applications using the Qt toolkit.
403
404%files devel
405%defattr(-,root,root,-)
406%if "%{qt_headerdir}" != "%{_includedir}"
407%dir %{qt_headerdir}/
408%endif
409%{qt_headerdir}/*
410%exclude %{qt_headerdir}/Qt/QtWebKit
411%exclude %{qt_headerdir}/Qt/qgraphicswebview.h
412%exclude %{qt_headerdir}/Qt/qweb*.h
413%exclude %{qt_headerdir}/QtWebKit/
414%{qt_libdir}/*.lib
415%{qt_libdir}/*.prl
416%exclude %{qt_libdir}/QtWebKit%{ver_major}.lib
417%exclude %{qt_libdir}/QtWebKit.prl
418%dir %{qt_datadir}/mkspecs/
419%{qt_datadir}/mkspecs/*
420%exclude %{qt_datadir}/mkspecs/modules/qt_webkit_version.pri
421%{qt_datadir}/q3porting.xml
422%{qt_bindir}/lrelease.exe
423%{qt_bindir}/lupdate.exe
424%{qt_bindir}/moc.exe
425%if "%{qt_bindir}" != "%{_bindir}"
426%{_bindir}/qmake.exe
427%endif
428%{qt_bindir}/qmake.exe
429%{qt_bindir}/rcc.exe
430%{qt_bindir}/uic.exe
431
432#------------------------------------------------------------------------------
433%package webkit-devel
434#------------------------------------------------------------------------------
435Summary: Qt 4 WebKit development files
436Group: Development/Libraries
437
438Requires: %{name}-webkit = %{version}-%{release}
439Requires: %{name}-devel = %{version}-%{release}
440
441%description webkit-devel
442%{descr_brief}
443
444This package contains the headers, libraries and tools necessary to
445develop applications using the Qt WebKit technology.
446
447%files webkit-devel
448%defattr(-,root,root,-)
449%{qt_headerdir}/Qt/QtWebKit
450%{qt_headerdir}/Qt/qgraphicswebview.h
451%{qt_headerdir}/Qt/qweb*.h
452%{qt_headerdir}/QtWebKit/
453%{qt_libdir}/QtWebKit%{ver_major}.lib
454%{qt_libdir}/QtWebKit.prl
455%{qt_datadir}/mkspecs/modules/qt_webkit_version.pri
456
457#------------------------------------------------------------------------------
458%package devel-all
459#------------------------------------------------------------------------------
460Summary: Qt 4 development kit
461Group: Development/Libraries
462
463Requires: %{name}-demos = %{version}-%{release}
464Requires: %{name}-qmlviewer = %{version}-%{release}
465Requires: %{name}-linguist = %{version}-%{release}
466Requires: %{name}-assistant = %{version}-%{release}
467Requires: %{name}-designer = %{version}-%{release}
468Requires: %{name}-devel-tools = %{version}-%{release}
469Requires: %{name}-doc = %{version}-%{release}
470Requires: %{name}-devel = %{version}-%{release}
471Requires: %{name}-webkit-devel = %{version}-%{release}
472
473%description devel-all
474%{descr_brief}
475
476This meta package installs all individual packages containing various Qt
477development components, including the Qt headers and libraries, the Linguist,
478Assistant and Designer applications, development tools, example
479Qt applications and the API documentation.
480
481#------------------------------------------------------------------------------
482%prep
483#------------------------------------------------------------------------------
484
485%if !0%{?skip_prep}
486
487%if "%{?QT_SOURCE_TREE}" != ""
488%if !0%{?skip_prep_export}
489# get clean source tree from SVN
490%setup -n "%{name}-%{version}" -Tc
491svn export -r %{svn_revision} %{QT_SOURCE_TREE} .
492%else
493# use passed source tree as is (shadow build)
494%setup -n "%{name}-%{version}" -Tc%{?skip_prep_clean:D}
495%endif
496%else
497# use source zip
498%setup -q
499%endif
500
501%endif # if !0%{?skip_prep}
502
503#------------------------------------------------------------------------------
504%build
505#------------------------------------------------------------------------------
506
507%if !0%{?skip_build}
508
509die() { echo "ERROR: $@"; exit 1; }
510check_var() { eval "[ -n \"\$$1\" ] || die \"$1 variable is not set.\""; }
511
512# Qt source tree (DOS format)
513QT_SOURCE_TREE_D=$(echo "%{QT_SOURCE_TREE}" | tr '/' '\\')
514
515# Sanity checks (laking these would turn off features that must be ON)
516check_var "CUPS_INCLUDEPATH"
517check_var "MYSQL_INCLUDEPATH"
518check_var "MYSQL_LIBS"
519check_var "PSQL_INCLUDEPATH"
520check_var "PSQL_LIBS"
521
522[ -z "$MAKE_JOBS" ] && MAKE_JOBS=1
523
524# Qt links to some OS/2 DLLs directly (w/o import libs)
525export LIBRARY_PATH=%{os2_boot_drive}/OS2/DLL\;%{os2_boot_drive}/MPTN/DLL\;$LIBRARY_PATH
526
527# CMD.EXE is required by the build process for now
528export MAKESHELL=%{os2_boot_drive}\\OS2\\CMD.EXE
529
530# Qt doesn't understand /@unixroot in library paths, replace it with $(UNIXROOT)
531library_paths=$(echo \
532 --official-build-quiet %{svn_revision} \
533 -prefix "%{qt_prefix}" \
534 -datadir "%{qt_datadir}" \
535 -libdir "%{qt_libdir}" \
536 -headerdir "%{qt_headerdir}" \
537 -bindir "%{qt_bindir}" \
538 -plugindir "%{qt_plugindir}" \
539 -importdir "%{qt_importdir}" \
540 -demosdir "%{qt_demosdir}" \
541 -examplesdir "%{qt_examplesdir}" \
542 -docdir "%{qt_docdir}" \
543 -translationdir "%{qt_translationdir}" \
544 -sysconfdir "%{qt_sysconfdir}" \
545| sed -re 's,/@unixroot,$(UNIXROOT),g')
546
547BUILDDIR_D=$(echo "%{_builddir}/%{buildsubdir}" | sed -re 's,/,\\,g')
548
549# make sure the right DLLs are used by the build (and in particular by qdoc
550# in make docs) in case if there is another Qt version installed
551export PATH="$BUILDDIR_D\\bin\;$PATH"
552export BEGINLIBPATH="$BUILDDIR_D\\bin\;$BEGINLIBPATH"
553
554# temporarily reset UNIXROOT so that install targets will get only Qt prefixes
555# w/o the UNIXROOT directory chain (if it's not at root)
556UNIXROOT_OLD="$UNIXROOT"
557export UNIXROOT=/.
558
559cmd /c $QT_SOURCE_TREE_D\\configure.cmd $library_paths
560
561make -j$MAKE_JOBS
562
563# resture UNIXROOT
564export UNIXROOT="$UNIXROOT_OLD"
565
566%if !0%{?skip_build_docs}
567# qdoc needs the qsqlite plugin but nothing is installed to target locations
568# yet, so generate qt.conf to override paths
569echo \
570"[Paths]
571Prefix = ..
572Settings = \$(ETC)/xdg
573Examples = examples
574Demos = demos" \
575> "%{_builddir}/%{buildsubdir}/bin/qt.conf"
576make docs -j$MAKE_JOBS
577rm -f "%{_builddir}/%{buildsubdir}/bin/qt.conf"
578%endif
579
580%endif # if !0%{?skip_build}
581
582#------------------------------------------------------------------------------
583%install
584#------------------------------------------------------------------------------
585
586%if !0%{?skip_install}
587
588rm -rf %{buildroot}
589
590# Qt links to some OS/2 DLLs directly (w/o import libs)
591export LIBRARY_PATH=%{os2_boot_drive}/OS2/DLL\;%{os2_boot_drive}/MPTN/DLL\;$LIBRARY_PATH
592
593# CMD.EXE is required by the build process for now
594export MAKESHELL=%{os2_boot_drive}\\OS2\\CMD.EXE
595
596# exclude install_htmldocs from install targets
597make install_subtargets install_qchdocs install_qmake install_mkspecs \
598 INSTALL_ROOT=$(echo "%{buildroot}/@unixroot" | sed -re 's,/,\\,g')
599
600# copy READMEs (make install doesn't do that)
601mkdir -p "%{buildroot}/%{pkg_docdir}/"
602cp -dp \
603 "%{QT_SOURCE_TREE}/LICENSE.*" \
604 "%{QT_SOURCE_TREE}/LGPL_EXCEPTION.txt" \
605 "%{QT_SOURCE_TREE}/README" \
606 "%{QT_SOURCE_TREE}/changes-%{ver_major}.%{ver_minor}.%{ver_patch}" \
607 "%{QT_SOURCE_TREE}/README.OS2" \
608 "%{QT_SOURCE_TREE}/CHANGES.OS2" \
609 "%{buildroot}/%{pkg_docdir}/"
610
611# remove *.dll from bin (they will live in %{qt_libdir})
612rm -f "%{buildroot}/%{qt_bindir}/*.dll" "%{buildroot}/%{qt_bindir}/*.sym"
613
614# remove translations we don't need
615rm -f "%{buildroot}/%{qt_translationdir}/qtconfig_??.qm" \
616 "%{buildroot}/%{qt_translationdir}/qtconfig_??_??.qm"
617rm -f "%{buildroot}/%{qt_translationdir}/qvfb_??.qm" \
618 "%{buildroot}/%{qt_translationdir}/qvfb_??_??.qm"
619
620# move qmake.exe to %{_bindir} (to have it in PATH) and symlink back to qt4/bin
621%if "%{qt_bindir}" != "%{_bindir}"
622mkdir -p "%{buildroot}/%{_bindir}/"
623mv "%{buildroot}/%{qt_bindir}/qmake.exe" "%{buildroot}/%{_bindir}/"
624ln -s "%{_bindir}/qmake.exe" "%{buildroot}/%{qt_bindir}/qmake.exe"
625%endif
626
627# @todo temporarily delete .sym files (until we generate -debuginfo packages)
628find "%{buildroot}/" -type f -name "*.sym" -exec rm -f "{}" \;
629
630%endif # if !0%{?skip_install}
631
632#------------------------------------------------------------------------------
633%clean
634#------------------------------------------------------------------------------
635
636#rm -rf %{buildroot}
637
638#------------------------------------------------------------------------------
639%changelog
Note: See TracBrowser for help on using the repository browser.