source: packaging/qt.spec@ 1068

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

packaging: Further work on .spec.

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