source: packaging/qt.spec@ 1075

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

packaging: Fixed install script.

File size: 13.3 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: qt
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}/%{qtM}
68%define qt_libdir %{_libdir}
69%define qt_headerdir %{_includedir}/qt4
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}/%{qtM}
76%define qt_docdir %{qt_datadir}/doc
77%define qt_translationdir %{qt_datadir}/translations
78%define qt_sysconfdir %{_sysconfdir}/xdg
79
80%define qtM %{name}%{ver_major}
81
82# disable lxlite compression (Qt EXEs and DLLs are already compressed)
83%define __os_install_post %{nil}
84
85#------------------------------------------------------------------------------
86# main package
87#------------------------------------------------------------------------------
88
89Summary: Qt runtime
90Group: System Environment/Libraries
91
92Provides: %{qtM} = %{version}-%{release}
93
94%description
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,-)
102%{qt_libdir}/QtCore%{ver_major}.dll
103
104%pre
105
106%warpin_conflicts_begin
107netlabs.org\Qt4\Runtime
108%warpin_conflicts_end
109
110#------------------------------------------------------------------------------
111%package pm
112#------------------------------------------------------------------------------
113
114Summary: Qt GUI runtime
115Group: System Environment/Libraries
116
117Requires: %{name} = %{version}-%{release}
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,-)
129%{qt_libdir}/QtGui%{ver_major}.dll
130
131#------------------------------------------------------------------------------
132%package examples
133#------------------------------------------------------------------------------
134Summary: Example applications for Qt
135Group: Documentation
136
137Requires: %{name}-pm = %{version}-%{release}
138
139Provides: %{qtM}-examples = %{version}-%{release}
140
141%description examples
142%{descr_brief}
143
144This package contains the demo and example Qt applications and their
145source code. These applications demonstrate the possibilities of the
146Qt toolkit.
147
148%files examples
149%defattr(-,root,root,-)
150%{qt_bindir}/qtdemo.exe
151# @todo put shortcuts to /usr/bin
152#%if "%{qt_bindir}" != "%{_bindir}"
153#%endif
154#%dir %{qt_examplesdir}/
155#%dir %{qt_demosdir}/
156
157%post examples
158
159%wps_object_create_begin -n %{name}-examples
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}
163%wps_object_create_end
164
165%postun examples
166%wps_object_delete_all -n %{name}-examples
167
168#------------------------------------------------------------------------------
169%package linguist
170#------------------------------------------------------------------------------
171Summary: Qt Linguist tool
172Group: Development/Tools
173
174Requires: %{name}-pm = %{version}-%{release}
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
203Requires: %{name}-pm = %{version}-%{release}
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#------------------------------------------------------------------------------
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#------------------------------------------------------------------------------
258%package doc
259#------------------------------------------------------------------------------
260Summary: API documentation for Qt
261Group: Documentation
262BuildArch: noarch
263
264Requires: %{name}-assistant = %{version}-%{release}
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
286Requires: %{name}-pm = %{version}-%{release}
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
294applications using the Qt toolkit.
295
296%files devel
297%defattr(-,root,root,-)
298%{qt_bindir}/moc.exe
299
300#------------------------------------------------------------------------------
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#------------------------------------------------------------------------------
324%prep
325#------------------------------------------------------------------------------
326
327%if !0%{?skip_prep}
328
329%if "%{?QT_SOURCE_TREE}" != ""
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} .
334%else
335# use passed source tree as is (shadow build)
336%setup -n "%{name}-%{version}" -Tc%{?skip_prep_clean:D}
337%endif
338%else
339# use source zip
340%setup -q
341%endif
342
343%endif # if !0%{?skip_prep}
344
345#------------------------------------------------------------------------------
346%build
347#------------------------------------------------------------------------------
348
349%if !0%{?skip_build}
350
351die() { echo "ERROR: $@"; exit 1; }
352check_var() { eval "[ -n \"\$$1\" ] || die \"$1 variable is not set.\""; }
353
354# Qt source tree (DOS format)
355QT_SOURCE_TREE_D=$(echo "%{QT_SOURCE_TREE}" | tr '/' '\\')
356
357# Sanity checks (laking these would turn off features that must be ON)
358check_var "CUPS_INCLUDEPATH"
359check_var "MYSQL_INCLUDEPATH"
360check_var "MYSQL_LIBS"
361check_var "PSQL_INCLUDEPATH"
362check_var "PSQL_LIBS"
363
364[ -z "$MAKE_JOBS" ] && MAKE_JOBS=1
365
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
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
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
392# in make docs) in case if there is another Qt version installed
393export PATH="$BUILDDIR_D\\bin\;$PATH"
394export BEGINLIBPATH="$BUILDDIR_D\\bin\;$BEGINLIBPATH"
395
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
401cmd /c $QT_SOURCE_TREE_D\\configure.cmd $library_paths
402
403make -j$MAKE_JOBS
404
405# resture UNIXROOT
406export UNIXROOT="$UNIXROOT_OLD"
407
408%if !0%{?skip_build_docs}
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"
418make docs -j$MAKE_JOBS
419rm -f "%{_builddir}/%{buildsubdir}/bin/qt.conf"
420%endif
421
422%endif # if !0%{?skip_build}
423
424#------------------------------------------------------------------------------
425%install
426#------------------------------------------------------------------------------
427
428%if !0%{?skip_install}
429
430rm -rf %{buildroot}
431
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
434
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
442# copy READMEs (make install doesn't do that)
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}/
452
453%endif # if !0%{?skip_install}
454
455#------------------------------------------------------------------------------
456%clean
457#------------------------------------------------------------------------------
458
459#rm -rf %{buildroot}
460
461#------------------------------------------------------------------------------
462%changelog
Note: See TracBrowser for help on using the repository browser.