1 | #
|
---|
2 | # http://svn.netlabs.org/qt4
|
---|
3 | #
|
---|
4 | # If you are a packager, please read HowToDistribute.txt for general
|
---|
5 | # instructions.
|
---|
6 | #
|
---|
7 |
|
---|
8 | Name: qt
|
---|
9 | Vendor: netlabs.org
|
---|
10 | License: LGPLv2 with exceptions or GPLv3 with exceptions
|
---|
11 | Url: 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}
|
---|
33 | Version: %{ver_major}.%{ver_minor}.%{ver_patch}.%{os2_release}
|
---|
34 | %else
|
---|
35 | Version: %{ver_major}.%{ver_minor}.%{ver_patch}
|
---|
36 | %endif
|
---|
37 | Release: %{rpm_release}
|
---|
38 |
|
---|
39 | Source: %{name}-%{version}.zip
|
---|
40 |
|
---|
41 | #BuildRequires: gnumake (when available)
|
---|
42 | BuildRequires: libc-devel
|
---|
43 | BuildRequires: gcc
|
---|
44 | BuildRequires: gcc-wlink
|
---|
45 | BuildRequires: gcc-wrc
|
---|
46 | #BuildRequires: cups-devel (when available)
|
---|
47 | BuildRequires: openssl-devel
|
---|
48 | BuildRequires: 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 |
|
---|
89 | Summary: Qt runtime
|
---|
90 | Group: System Environment/Libraries
|
---|
91 |
|
---|
92 | Provides: %{qtM} = %{version}-%{release}
|
---|
93 |
|
---|
94 | %description
|
---|
95 | %{descr_brief}
|
---|
96 |
|
---|
97 | This package contains runtime Qt libraries for console applications, including
|
---|
98 | core, 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
|
---|
107 | netlabs.org\Qt4\Runtime
|
---|
108 | %warpin_conflicts_end
|
---|
109 |
|
---|
110 | #------------------------------------------------------------------------------
|
---|
111 | %package pm
|
---|
112 | #------------------------------------------------------------------------------
|
---|
113 |
|
---|
114 | Summary: Qt GUI runtime
|
---|
115 | Group: System Environment/Libraries
|
---|
116 |
|
---|
117 | Requires: %{name} = %{version}-%{release}
|
---|
118 |
|
---|
119 | Provides: %{qtM}-pm = %{version}-%{release}
|
---|
120 |
|
---|
121 | %description pm
|
---|
122 | %{descr_brief}
|
---|
123 |
|
---|
124 | This package contains runtime Qt libraries for Presentation Manager GUI
|
---|
125 | applications.
|
---|
126 |
|
---|
127 | %files pm
|
---|
128 | %defattr(-,root,root,-)
|
---|
129 | %{qt_libdir}/QtGui%{ver_major}.dll
|
---|
130 |
|
---|
131 | #------------------------------------------------------------------------------
|
---|
132 | %package examples
|
---|
133 | #------------------------------------------------------------------------------
|
---|
134 | Summary: Example applications for Qt
|
---|
135 | Group: Documentation
|
---|
136 |
|
---|
137 | Requires: %{name}-pm = %{version}-%{release}
|
---|
138 |
|
---|
139 | Provides: %{qtM}-examples = %{version}-%{release}
|
---|
140 |
|
---|
141 | %description examples
|
---|
142 | %{descr_brief}
|
---|
143 |
|
---|
144 | This package contains the demo and example Qt applications and their
|
---|
145 | source code. These applications demonstrate the possibilities of the
|
---|
146 | Qt 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 | #------------------------------------------------------------------------------
|
---|
171 | Summary: Qt Linguist tool
|
---|
172 | Group: Development/Tools
|
---|
173 |
|
---|
174 | Requires: %{name}-pm = %{version}-%{release}
|
---|
175 |
|
---|
176 | Provides: %{qtM}-linguist = %{version}-%{release}
|
---|
177 |
|
---|
178 | %description linguist
|
---|
179 | %{descr_brief}
|
---|
180 |
|
---|
181 | This package contains the Qt Linguist tool used to edit the translation files
|
---|
182 | for 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}
|
---|
191 | QT4_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 | #------------------------------------------------------------------------------
|
---|
200 | Summary: Qt Assistant tool
|
---|
201 | Group: Development/Tools
|
---|
202 |
|
---|
203 | Requires: %{name}-pm = %{version}-%{release}
|
---|
204 |
|
---|
205 | Provides: %{qtM}-assistant = %{version}-%{release}
|
---|
206 |
|
---|
207 | %description assistant
|
---|
208 | %{descr_brief}
|
---|
209 |
|
---|
210 | This package contains the Qt Assistant tool used to read and search the Qt
|
---|
211 | Toolkit reference documentation.
|
---|
212 |
|
---|
213 | %files assistant
|
---|
214 | %defattr(-,root,root,-)
|
---|
215 | %{qt_bindir}/assistant.exe
|
---|
216 |
|
---|
217 | #------------------------------------------------------------------------------
|
---|
218 | %package designer
|
---|
219 | #------------------------------------------------------------------------------
|
---|
220 | Summary: Qt Designer tool
|
---|
221 | Group: Development/Tools
|
---|
222 |
|
---|
223 | Requires: %{name}-pm = %{version}-%{release}
|
---|
224 |
|
---|
225 | Provides: %{qtM}-designer = %{version}-%{release}
|
---|
226 |
|
---|
227 | %description designer
|
---|
228 | %{descr_brief}
|
---|
229 |
|
---|
230 | This package contains the Qt Designer tool used to for designing and building
|
---|
231 | graphical 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 | #------------------------------------------------------------------------------
|
---|
240 | Summary: Qt development tools
|
---|
241 | Group: Development/Tools
|
---|
242 |
|
---|
243 | Requires: %{name}-pm = %{version}-%{release}
|
---|
244 |
|
---|
245 | Provides: %{qtM}-devel-tools = %{version}-%{release}
|
---|
246 |
|
---|
247 | %description devel-tools
|
---|
248 | %{descr_brief}
|
---|
249 |
|
---|
250 | This package contains tools used to assist in Qt development, including
|
---|
251 | PixelTool, 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 | #------------------------------------------------------------------------------
|
---|
260 | Summary: API documentation for Qt
|
---|
261 | Group: Documentation
|
---|
262 | BuildArch: noarch
|
---|
263 |
|
---|
264 | Requires: %{name}-assistant = %{version}-%{release}
|
---|
265 |
|
---|
266 | Provides: %{qtM}-doc = %{version}-%{release}
|
---|
267 |
|
---|
268 | %description doc
|
---|
269 | %{descr_brief}
|
---|
270 |
|
---|
271 | This package contains the Qt Toolkit reference documentation that provides the
|
---|
272 | detailed 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 | #------------------------------------------------------------------------------
|
---|
283 | Summary: Development files for Qt
|
---|
284 | Group: Development/Libraries
|
---|
285 |
|
---|
286 | Requires: %{name}-pm = %{version}-%{release}
|
---|
287 |
|
---|
288 | Provides: %{qtM}-devel = %{version}-%{release}
|
---|
289 |
|
---|
290 | %description devel
|
---|
291 | %{descr_brief}
|
---|
292 |
|
---|
293 | This package contains the headers, libraries and tools necessary to develop
|
---|
294 | applications using the Qt toolkit.
|
---|
295 |
|
---|
296 | %files devel
|
---|
297 | %defattr(-,root,root,-)
|
---|
298 | %{qt_bindir}/moc.exe
|
---|
299 |
|
---|
300 | #------------------------------------------------------------------------------
|
---|
301 | %package devel-all
|
---|
302 | #------------------------------------------------------------------------------
|
---|
303 | Summary: Qt development kit
|
---|
304 | Group: Development/Libraries
|
---|
305 |
|
---|
306 | Requires: %{name}-examples = %{version}-%{release}
|
---|
307 | Requires: %{name}-linguist = %{version}-%{release}
|
---|
308 | Requires: %{name}-assistant = %{version}-%{release}
|
---|
309 | Requires: %{name}-designer = %{version}-%{release}
|
---|
310 | Requires: %{name}-devel-tools = %{version}-%{release}
|
---|
311 | Requires: %{name}-doc = %{version}-%{release}
|
---|
312 |
|
---|
313 | Provides: %{qtM}-devel-all = %{version}-%{release}
|
---|
314 |
|
---|
315 | %description devel-all
|
---|
316 | %{descr_brief}
|
---|
317 |
|
---|
318 | This meta package installs all individual packages containing various Qt
|
---|
319 | development components, including the Qt headers and libraries, the Linguist,
|
---|
320 | Assistant and designer Designer applications, development tools, example
|
---|
321 | Qt 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
|
---|
333 | svn 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 |
|
---|
351 | die() { echo "ERROR: $@"; exit 1; }
|
---|
352 | check_var() { eval "[ -n \"\$$1\" ] || die \"$1 variable is not set.\""; }
|
---|
353 |
|
---|
354 | # Qt source tree (DOS format)
|
---|
355 | QT_SOURCE_TREE_D=$(echo "%{QT_SOURCE_TREE}" | tr '/' '\\')
|
---|
356 |
|
---|
357 | # Sanity checks (laking these would turn off features that must be ON)
|
---|
358 | check_var "CUPS_INCLUDEPATH"
|
---|
359 | check_var "MYSQL_INCLUDEPATH"
|
---|
360 | check_var "MYSQL_LIBS"
|
---|
361 | check_var "PSQL_INCLUDEPATH"
|
---|
362 | check_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)
|
---|
367 | export 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
|
---|
370 | export MAKESHELL=%{os2_boot_drive}\\OS2\\CMD.EXE
|
---|
371 |
|
---|
372 | # Qt doesn't understand /@unixroot in library paths, replace it with $(UNIXROOT)
|
---|
373 | library_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 |
|
---|
389 | BUILDDIR_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
|
---|
393 | export PATH="$BUILDDIR_D\\bin\;$PATH"
|
---|
394 | export 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)
|
---|
398 | UNIXROOT_OLD="$UNIXROOT"
|
---|
399 | export UNIXROOT=
|
---|
400 |
|
---|
401 | cmd /c $QT_SOURCE_TREE_D\\configure.cmd $library_paths
|
---|
402 |
|
---|
403 | make -j$MAKE_JOBS
|
---|
404 |
|
---|
405 | # resture UNIXROOT
|
---|
406 | export 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
|
---|
411 | echo \
|
---|
412 | "[Paths]
|
---|
413 | Prefix = ..
|
---|
414 | Settings = \$(ETC)/xdg
|
---|
415 | Examples = examples
|
---|
416 | Demos = demos" \
|
---|
417 | > "%{_builddir}/%{buildsubdir}/bin/qt.conf"
|
---|
418 | make docs -j$MAKE_JOBS
|
---|
419 | rm -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 |
|
---|
430 | rm -rf %{buildroot}
|
---|
431 |
|
---|
432 | # Qt links to some OS/2 DLLs directly (w/o import libs)
|
---|
433 | export 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
|
---|
436 | export MAKESHELL=%{os2_boot_drive}\\OS2\\CMD.EXE
|
---|
437 |
|
---|
438 | # exclude install_htmldocs from install targets
|
---|
439 | make 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)
|
---|
443 | mkdir -p %{buildroot}/%{pkg_docdir}/
|
---|
444 | cp -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
|
---|