source: packaging/qt.spec@ 1077

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

packaging: Fixed install script.

File size: 13.3 KB
RevLine 
[1041]1#
2# http://svn.netlabs.org/qt4
3#
[1068]4# If you are a packager, please read HowToDistribute.txt for general
5# instructions.
6#
[1041]7
[1068]8Name: qt
9Vendor: netlabs.org
10License: LGPLv2 with exceptions or GPLv3 with exceptions
11Url: http://www.qtsoftware.com/
12
[1041]13%define ver_major 4
[1068]14%define ver_minor 7
[1041]15%define ver_patch 3
16
[1068]17%define os2_release 0
18
[1041]19%define rpm_release 1
20
[1068]21%define svn_revision 1070
[1041]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
[1068]30%define pkg_docdir %{_docdir}/%{name}
[1041]31
[1068]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
[1041]67%define qt_prefix %{_libdir}/%{qtM}
68%define qt_libdir %{_libdir}
[1062]69%define qt_headerdir %{_includedir}/qt4
[1041]70%define qt_bindir %{qt_prefix}/bin
71%define qt_plugindir %{qt_prefix}/plugins
[1062]72%define qt_importdir %{qt_prefix}/imports
[1041]73%define qt_demosdir %{qt_prefix}/demos
74%define qt_examplesdir %{qt_prefix}/examples
[1062]75%define qt_datadir %{_datadir}/%{qtM}
[1041]76%define qt_docdir %{qt_datadir}/doc
77%define qt_translationdir %{qt_datadir}/translations
78%define qt_sysconfdir %{_sysconfdir}/xdg
79
[1068]80%define qtM %{name}%{ver_major}
81
[1075]82# disable lxlite compression (Qt EXEs and DLLs are already compressed)
83%define __os_install_post %{nil}
84
[1041]85#------------------------------------------------------------------------------
86# main package
87#------------------------------------------------------------------------------
88
89Summary: Qt runtime
90Group: System Environment/Libraries
91
92Provides: %{qtM} = %{version}-%{release}
93
[1062]94%description
[1041]95%{descr_brief}
96
97This package contains runtime Qt libraries for console applications, including
98core, network and XML modules.
99
100%files
101%defattr(-,root,root,-)
[1068]102%{qt_libdir}/QtCore%{ver_major}.dll
[1041]103
104%pre
105
[1068]106%warpin_conflicts_begin
107netlabs.org\Qt4\Runtime
108%warpin_conflicts_end
[1041]109
110#------------------------------------------------------------------------------
111%package pm
112#------------------------------------------------------------------------------
113
114Summary: Qt GUI runtime
115Group: System Environment/Libraries
116
[1068]117Requires: %{name} = %{version}-%{release}
[1041]118
119Provides: %{qtM}-pm = %{version}-%{release}
120
121%description pm
122%{descr_brief}
123
124This package contains runtime Qt libraries for Presentation Manager GUI
125applications.
126
127%files pm
128%defattr(-,root,root,-)
[1068]129%{qt_libdir}/QtGui%{ver_major}.dll
[1041]130
131#------------------------------------------------------------------------------
[1068]132%package examples
[1041]133#------------------------------------------------------------------------------
[1068]134Summary: Example applications for Qt
[1041]135Group: Documentation
136
[1068]137Requires: %{name}-pm = %{version}-%{release}
[1041]138
[1068]139Provides: %{qtM}-examples = %{version}-%{release}
[1041]140
[1068]141%description examples
[1041]142%{descr_brief}
143
[1062]144This package contains the demo and example Qt applications and their
145source code. These applications demonstrate the possibilities of the
146Qt toolkit.
[1041]147
[1068]148%files examples
[1041]149%defattr(-,root,root,-)
150%{qt_bindir}/qtdemo.exe
151# @todo put shortcuts to /usr/bin
152#%if "%{qt_bindir}" != "%{_bindir}"
153#%endif
[1068]154#%dir %{qt_examplesdir}/
155#%dir %{qt_demosdir}/
[1041]156
[1068]157%post examples
[1062]158
[1068]159%wps_object_create_begin -n %{name}-examples
[1062]160%pkg_wps_folder_create%
161%{pkg_wps_base}_DEMO:WPProgram|Examples and Demos|<QT4_FOLDER>|EXENAME=((%{qt_bindir}/qtdemo.exe))
162#%{pkg_wps_base}_CHANGELOG:WPProgram|ChangeLog|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/ChangeLog}
[1041]163%wps_object_create_end
164
[1068]165%postun examples
166%wps_object_delete_all -n %{name}-examples
[1041]167
168#------------------------------------------------------------------------------
169%package linguist
170#------------------------------------------------------------------------------
171Summary: Qt Linguist tool
172Group: Development/Tools
173
[1068]174Requires: %{name}-pm = %{version}-%{release}
[1041]175
176Provides: %{qtM}-linguist = %{version}-%{release}
177
178%description linguist
179%{descr_brief}
180
181This package contains the Qt Linguist tool used to edit the translation files
182for Qt applications.
183
184%files linguist
185%defattr(-,root,root,-)
186%{qt_bindir}/linguist.exe
187
188%post linguist
189%wps_object_create_begin -n %{name}-linguist
190%{wps_qt4_folder}
191QT4_LINGUIST:WPProgram|Linguist|<QT4_FOLDER>|EXENAME=((%{qt_bindir}/linguist.exe))
192%wps_object_create_end
193
194%postun linguist
195%wps_object_delete_all -n %{name}-linguist
196
197#------------------------------------------------------------------------------
198%package assistant
199#------------------------------------------------------------------------------
200Summary: Qt Assistant tool
201Group: Development/Tools
202
[1068]203Requires: %{name}-pm = %{version}-%{release}
[1041]204
205Provides: %{qtM}-assistant = %{version}-%{release}
206
207%description assistant
208%{descr_brief}
209
210This package contains the Qt Assistant tool used to read and search the Qt
211Toolkit reference documentation.
212
213%files assistant
214%defattr(-,root,root,-)
215%{qt_bindir}/assistant.exe
216
217#------------------------------------------------------------------------------
[1068]218%package designer
219#------------------------------------------------------------------------------
220Summary: Qt Designer tool
221Group: Development/Tools
222
223Requires: %{name}-pm = %{version}-%{release}
224
225Provides: %{qtM}-designer = %{version}-%{release}
226
227%description designer
228%{descr_brief}
229
230This package contains the Qt Designer tool used to for designing and building
231graphical user interfaces from Qt components.
232
233%files designer
234%defattr(-,root,root,-)
235%{qt_bindir}/designer.exe
236
237#------------------------------------------------------------------------------
238%package devel-tools
239#------------------------------------------------------------------------------
240Summary: Qt development tools
241Group: Development/Tools
242
243Requires: %{name}-pm = %{version}-%{release}
244
245Provides: %{qtM}-devel-tools = %{version}-%{release}
246
247%description devel-tools
248%{descr_brief}
249
250This package contains tools used to assist in Qt development, including
251PixelTool, QML Viewer, Help Converter and other applications.
252
253%files devel-tools
254%defattr(-,root,root,-)
255%{qt_bindir}/pixeltool.exe
256
257#------------------------------------------------------------------------------
[1041]258%package doc
259#------------------------------------------------------------------------------
260Summary: API documentation for Qt
261Group: Documentation
262BuildArch: noarch
263
[1068]264Requires: %{name}-assistant = %{version}-%{release}
[1041]265
266Provides: %{qtM}-doc = %{version}-%{release}
267
268%description doc
269%{descr_brief}
270
271This package contains the Qt Toolkit reference documentation that provides the
272detailed description of all Qt classes and tools.
273
274%files doc
275%defattr(-,root,root,-)
276%{qt_docdir}/qch/*.qch
277
278# @todo assistant.exe -remove-search-index
279
280#------------------------------------------------------------------------------
281%package devel
282#------------------------------------------------------------------------------
283Summary: Development files for Qt
284Group: Development/Libraries
285
[1068]286Requires: %{name}-pm = %{version}-%{release}
[1041]287
288Provides: %{qtM}-devel = %{version}-%{release}
289
290%description devel
291%{descr_brief}
292
293This package contains the headers, libraries and tools necessary to develop
[1068]294applications using the Qt toolkit.
[1041]295
296%files devel
297%defattr(-,root,root,-)
[1068]298%{qt_bindir}/moc.exe
[1041]299
300#------------------------------------------------------------------------------
[1068]301%package devel-all
302#------------------------------------------------------------------------------
303Summary: Qt development kit
304Group: Development/Libraries
305
306Requires: %{name}-examples = %{version}-%{release}
307Requires: %{name}-linguist = %{version}-%{release}
308Requires: %{name}-assistant = %{version}-%{release}
309Requires: %{name}-designer = %{version}-%{release}
310Requires: %{name}-devel-tools = %{version}-%{release}
311Requires: %{name}-doc = %{version}-%{release}
312
313Provides: %{qtM}-devel-all = %{version}-%{release}
314
315%description devel-all
316%{descr_brief}
317
318This meta package installs all individual packages containing various Qt
319development components, including the Qt headers and libraries, the Linguist,
320Assistant and designer Designer applications, development tools, example
321Qt applications and the API documentation.
322
323#------------------------------------------------------------------------------
[1041]324%prep
325#------------------------------------------------------------------------------
326
[1068]327%if !0%{?skip_prep}
328
[1062]329%if "%{?QT_SOURCE_TREE}" != ""
[1068]330%if !0%{?skip_prep_export}
331# get clean source tree from SVN
332%setup -n "%{name}-%{version}" -Tc
333svn export -r %{svn_revision} %{QT_SOURCE_TREE} .
[1041]334%else
[1068]335# use passed source tree as is (shadow build)
[1075]336%setup -n "%{name}-%{version}" -Tc%{?skip_prep_clean:D}
[1041]337%endif
[1068]338%else
339# use source zip
340%setup -q
341%endif
[1041]342
[1068]343%endif # if !0%{?skip_prep}
344
[1041]345#------------------------------------------------------------------------------
346%build
347#------------------------------------------------------------------------------
348
[1068]349%if !0%{?skip_build}
[1041]350
[1062]351die() { echo "ERROR: $@"; exit 1; }
352check_var() { eval "[ -n \"\$$1\" ] || die \"$1 variable is not set.\""; }
353
[1068]354# Qt source tree (DOS format)
[1062]355QT_SOURCE_TREE_D=$(echo "%{QT_SOURCE_TREE}" | tr '/' '\\')
356
357# Sanity checks (laking these would turn off features that must be ON)
[1068]358check_var "CUPS_INCLUDEPATH"
[1062]359check_var "MYSQL_INCLUDEPATH"
360check_var "MYSQL_LIBS"
361check_var "PSQL_INCLUDEPATH"
362check_var "PSQL_LIBS"
363
[1075]364[ -z "$MAKE_JOBS" ] && MAKE_JOBS=1
365
[1068]366# Qt links to some OS/2 DLLs directly (w/o import libs)
367export LIBRARY_PATH=%{os2_boot_drive}/OS2/DLL\;%{os2_boot_drive}/MPTN/DLL\;$LIBRARY_PATH
368
[1062]369# CMD.EXE is required by the build process for now
370export MAKESHELL=%{os2_boot_drive}\\OS2\\CMD.EXE
371
372# Qt doesn't understand /@unixroot in library paths, replace it with $(UNIXROOT)
373library_paths=$(echo \
374 --official-build-quiet %{svn_revision} \
375 -prefix "%{qt_prefix}" \
376 -datadir "%{qt_datadir}" \
377 -libdir "%{qt_libdir}" \
378 -headerdir "%{qt_headerdir}" \
379 -bindir "%{qt_bindir}" \
380 -plugindir "%{qt_plugindir}" \
381 -importdir "%{qt_importdir}" \
382 -demosdir "%{qt_demosdir}" \
383 -examplesdir "%{qt_examplesdir}" \
384 -docdir "%{qt_docdir}" \
385 -translationdir "%{qt_translationdir}" \
386 -sysconfdir "%{qt_sysconfdir}" \
387| sed -re 's,/@unixroot,$(UNIXROOT),g')
388
[1071]389BUILDDIR_D=$(echo "%{_builddir}/%{buildsubdir}" | sed -re 's,/,\\,g')
390
391# make sure the right DLLs are used by the build (and in particular by qdoc
[1075]392# in make docs) in case if there is another Qt version installed
[1071]393export PATH="$BUILDDIR_D\\bin\;$PATH"
394export BEGINLIBPATH="$BUILDDIR_D\\bin\;$BEGINLIBPATH"
395
[1075]396# temporarily reset UNIXROOT so that install targets will get only Qt prefixes
397# w/o the UNIXROOT directory chain (if it's not at root)
398UNIXROOT_OLD="$UNIXROOT"
399export UNIXROOT=
400
[1062]401cmd /c $QT_SOURCE_TREE_D\\configure.cmd $library_paths
402
[1075]403make -j$MAKE_JOBS
404
405# resture UNIXROOT
406export UNIXROOT="$UNIXROOT_OLD"
407
408%if !0%{?skip_build_docs}
[1071]409# qdoc needs the qsqlite plugin but nothing is installed to target locations
410# yet, so generate qt.conf to override paths
411echo \
412"[Paths]
413Prefix = ..
414Settings = \$(ETC)/xdg
415Examples = examples
416Demos = demos" \
417> "%{_builddir}/%{buildsubdir}/bin/qt.conf"
[1068]418make docs -j$MAKE_JOBS
[1075]419rm -f "%{_builddir}/%{buildsubdir}/bin/qt.conf"
[1068]420%endif
421
422%endif # if !0%{?skip_build}
423
[1041]424#------------------------------------------------------------------------------
425%install
426#------------------------------------------------------------------------------
427
[1068]428%if !0%{?skip_install}
429
[1041]430rm -rf %{buildroot}
431
[1075]432# Qt links to some OS/2 DLLs directly (w/o import libs)
433export LIBRARY_PATH=%{os2_boot_drive}/OS2/DLL\;%{os2_boot_drive}/MPTN/DLL\;$LIBRARY_PATH
[1041]434
[1075]435# CMD.EXE is required by the build process for now
436export MAKESHELL=%{os2_boot_drive}\\OS2\\CMD.EXE
437
438# exclude install_htmldocs from install targets
439make install_subtargets install_qchdocs install_qmake install_mkspecs \
440 INSTALL_ROOT=$(echo "%{buildroot}/@unixroot" | sed -re 's,/,\\,g')
441
[1068]442# copy READMEs (make install doesn't do that)
[1075]443mkdir -p %{buildroot}/%{pkg_docdir}/
444cp -dp \
445 %{QT_SOURCE_TREE}/LICENSE.* \
446 %{QT_SOURCE_TREE}/LGPL_EXCEPTION.txt \
447 %{QT_SOURCE_TREE}/README \
448 %{QT_SOURCE_TREE}/changes-%{ver_major}.%{ver_minor}.%{ver_patch} \
449 %{QT_SOURCE_TREE}/README.OS2 \
450 %{QT_SOURCE_TREE}/CHANGES.OS2 \
451 %{buildroot}/%{pkg_docdir}/
[1041]452
[1068]453%endif # if !0%{?skip_install}
454
[1041]455#------------------------------------------------------------------------------
456%clean
457#------------------------------------------------------------------------------
458
[1068]459#rm -rf %{buildroot}
[1041]460
461#------------------------------------------------------------------------------
462%changelog
Note: See TracBrowser for help on using the repository browser.