source: packaging/qt4.spec@ 1091

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

Spec for release 4.7.3-1.

File size: 24.1 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
[1079]8Name: qt4
[1068]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
[1091]21%define svn_url http://svn.netlabs.org/repos/qt4/tags/%{version}
[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
[1079]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 .
[1091]61%else
62%define skip_prep_export 1
[1068]63%endif
64
65# installation paths
[1079]66%define qt_prefix %{_libdir}/%{name}
[1041]67%define qt_libdir %{_libdir}
[1082]68%define qt_headerdir %{_includedir}
[1041]69%define qt_bindir %{qt_prefix}/bin
70%define qt_plugindir %{qt_prefix}/plugins
[1062]71%define qt_importdir %{qt_prefix}/imports
[1041]72%define qt_demosdir %{qt_prefix}/demos
73%define qt_examplesdir %{qt_prefix}/examples
[1079]74%define qt_datadir %{_datadir}/%{name}
[1041]75%define qt_docdir %{qt_datadir}/doc
76%define qt_translationdir %{qt_datadir}/translations
77%define qt_sysconfdir %{_sysconfdir}/xdg
78
[1075]79# disable lxlite compression (Qt EXEs and DLLs are already compressed)
80%define __os_install_post %{nil}
81
[1041]82#------------------------------------------------------------------------------
83# main package
84#------------------------------------------------------------------------------
85
[1083]86Summary: Qt 4 (dummy package)
[1041]87Group: System Environment/Libraries
88
[1062]89%description
[1041]90%{descr_brief}
91
[1083]92This package is not actually generated (due to the missing %files section).
93It is present only because RPM requires Summary: and %description sections for
94the main package to exist.
95
96#------------------------------------------------------------------------------
97%package -n lib%{name}
98#------------------------------------------------------------------------------
99
100Summary: Qt 4 runtime libraries
101Group: System Environment/Libraries
102
103%description -n lib%{name}
104%{descr_brief}
105
[1041]106This package contains runtime Qt libraries for console applications, including
107core, network and XML modules.
108
[1083]109%files -n lib%{name}
[1041]110%defattr(-,root,root,-)
[1082]111%dir %{pkg_docdir}/
[1078]112%docdir %{pkg_docdir}/
[1080]113%{pkg_docdir}/*
[1078]114%if "%{qt_prefix}" != "%{_prefix}"
115%dir %{qt_prefix}/
116%endif
117%if "%{qt_libdir}" != "%{_libdir}"
118%dir %{qt_libdir}/
119%endif
120%if "%{qt_bindir}" != "%{_bindir}"
121%dir %{qt_bindir}/
122%endif
123%dir %{qt_plugindir}
124%{qt_plugindir}/bearer/
125%{qt_plugindir}/codecs/
126%dir %{qt_plugindir}/sqldrivers/
127%{qt_plugindir}/sqldrivers/*
[1081]128%exclude %{qt_plugindir}/sqldrivers/qmysql%{ver_major}.dll
129%exclude %{qt_plugindir}/sqldrivers/qpsql%{ver_major}.dll
[1078]130%dir %{qt_datadir}/
131%dir %{qt_docdir}/
132%dir %{qt_docdir}/qch/
133%dir %{qt_translationdir}/
134%{qt_translationdir}/qt_??.qm
135%{qt_translationdir}/qt_??_??.qm
136%if "%{qt_sysconfdir}" != "%{_sysconfdir}" && "%{qt_sysconfdir}" != "%{_sysconfdir}/xdg"
137%dir %{qt_sysconfdir}/
138%endif
[1068]139%{qt_libdir}/QtCore%{ver_major}.dll
[1078]140%{qt_libdir}/QtNet%{ver_major}.dll
141%{qt_libdir}/QtScri%{ver_major}.dll
142%{qt_libdir}/QtSql%{ver_major}.dll
143%{qt_libdir}/QtTest%{ver_major}.dll
144%{qt_libdir}/QtXml%{ver_major}.dll
145%{qt_libdir}/QtXmlP%{ver_major}.dll
[1041]146
[1083]147%pre -n lib%{name}
[1068]148%warpin_conflicts_begin
149netlabs.org\Qt4\Runtime
150%warpin_conflicts_end
[1041]151
[1083]152%post -n lib%{name}
[1080]153# clean up the plugin/font cache to remove old entries (@todo other users?)
154rm -f "$HOME/.config/Trolltech.ini"
155
[1041]156#------------------------------------------------------------------------------
[1083]157%package -n lib%{name}-sql-mysql
[1081]158#------------------------------------------------------------------------------
159
160Summary: Qt 4 MySQL database driver
161Group: System Environment/Libraries
162
[1083]163Requires: lib%{name} = %{version}-%{release}
[1081]164
[1083]165%description -n lib%{name}-sql-mysql
[1081]166%{descr_brief}
167
168This package contains the MySQL plugin for Qt 4.
169
[1083]170%files -n lib%{name}-sql-mysql
[1081]171%defattr(-,root,root,-)
172%{qt_plugindir}/sqldrivers/qmysql%{ver_major}.dll
173
174#------------------------------------------------------------------------------
[1083]175%package -n lib%{name}-sql-psql
[1081]176#------------------------------------------------------------------------------
177
178Summary: Qt 4 PostgreSQL database driver
179Group: System Environment/Libraries
180
[1083]181Requires: lib%{name} = %{version}-%{release}
[1081]182
[1083]183%description -n lib%{name}-sql-psql
[1081]184%{descr_brief}
185
186This package contains the PostgreSQL plugin for Qt 4.
187
[1083]188%files -n lib%{name}-sql-psql
[1081]189%defattr(-,root,root,-)
190%{qt_plugindir}/sqldrivers/qpsql%{ver_major}.dll
191
192#------------------------------------------------------------------------------
[1083]193%package -n lib%{name}-gui
[1041]194#------------------------------------------------------------------------------
195
[1083]196Summary: Qt 4 GUI runtime libraries
[1041]197Group: System Environment/Libraries
198
[1083]199Requires: lib%{name} = %{version}-%{release}
[1041]200
[1083]201%description -n lib%{name}-gui
[1041]202%{descr_brief}
203
204This package contains runtime Qt libraries for Presentation Manager GUI
205applications.
206
[1083]207%files -n lib%{name}-gui
[1041]208%defattr(-,root,root,-)
[1078]209%dir %{qt_plugindir}/designer
210%{qt_plugindir}/designer/qdeclv.dll
211%{qt_plugindir}/accessible/
212%{qt_plugindir}/graphicssystems/
213%{qt_plugindir}/iconengines/
214%{qt_plugindir}/imageformats/
215%{qt_plugindir}/qmltooling/
216%{qt_translationdir}/qt_help_??.qm
217%{qt_translationdir}/qt_help_??_??.qm
218%dir %{qt_importdir}/
219%{qt_importdir}/Qt/
220%{qt_libdir}/QtCLuc%{ver_major}.dll
221%{qt_libdir}/QtDecl%{ver_major}.dll
[1068]222%{qt_libdir}/QtGui%{ver_major}.dll
[1078]223%{qt_libdir}/QtHelp%{ver_major}.dll
224%{qt_libdir}/QtScTl%{ver_major}.dll
225%{qt_libdir}/QtSvg%{ver_major}.dll
[1041]226
227#------------------------------------------------------------------------------
[1083]228%package -n lib%{name}-webkit
[1041]229#------------------------------------------------------------------------------
[1078]230
[1083]231Summary: Qt 4 WebKit runtime libraries
[1078]232Group: System Environment/Libraries
233
[1083]234Requires: lib%{name}-gui = %{version}-%{release}
[1078]235
[1083]236%description -n lib%{name}-webkit
[1078]237%{descr_brief}
238
239This package contains runtime Qt libraries for applications based on the WebKit
240technology.
241
[1083]242%files -n lib%{name}-webkit
[1078]243%defattr(-,root,root,-)
244%{qt_plugindir}/designer/qwebv.dll
245%{qt_importdir}/QtWebKit/
246%{qt_libdir}/QtWebK%{ver_major}.dll
247
248#------------------------------------------------------------------------------
[1083]249%package -n lib%{name}-designer
250#------------------------------------------------------------------------------
251
252Summary: Qt 4 Designer runtime libraries
253Group: System Environment/Libraries
254
255Requires: lib%{name}-gui = %{version}-%{release}
256
257%description -n lib%{name}-designer
258%{descr_brief}
259
260This package contains runtime Qt libraries for Designer components.
261
262%files -n lib%{name}-designer
263%defattr(-,root,root,-)
264%{qt_libdir}/QtDsgC%{ver_major}.dll
265%{qt_libdir}/QtDsgn%{ver_major}.dll
266
267#------------------------------------------------------------------------------
[1078]268%package demos
269#------------------------------------------------------------------------------
[1079]270Summary: Qt 4 demos and examples
[1041]271Group: Documentation
272
[1083]273Requires: lib%{name}-gui = %{version}-%{release}
274Requires: lib%{name}-designer = %{version}-%{release}
275Requires: lib%{name}-webkit = %{version}-%{release}
[1080]276Requires: %{name}-doc = %{version}-%{release}
[1041]277
[1078]278%description demos
[1041]279%{descr_brief}
280
[1062]281This package contains the demo and example Qt applications and their
282source code. These applications demonstrate the possibilities of the
283Qt toolkit.
[1041]284
[1078]285%files demos
[1041]286%defattr(-,root,root,-)
[1078]287%{qt_plugindir}/designer/
288%exclude %{qt_plugindir}/designer/qdeclv.dll
289%exclude %{qt_plugindir}/designer/qwebv.dll
[1041]290%{qt_bindir}/qtdemo.exe
[1078]291%{qt_examplesdir}
292%{qt_demosdir}
[1041]293
[1078]294%post demos
295%wps_object_create_begin -n %{name}-demos
296%{pkg_wps_folder_create}
297%{pkg_wps_base}_DEMO:WPProgram|Examples and Demos|%{pkg_wps_folder_id}|EXENAME=((%{qt_bindir}/qtdemo.exe))
298%wps_object_create_end
[1062]299
[1080]300# clean up the qtdemo doc cache, otherwise the demo descriptions may not show up
301# if the old cache contains links to non-existent doc files (@todo other users?)
302rm -f "$HOME/.local/share/data/Trolltech/Assistant/qtdemo_%{ver_major}.%{ver_minor}.%{ver_patch}.qhc"
303
[1078]304%postun demos
305%wps_object_delete_all -n %{name}-demos
306
307#------------------------------------------------------------------------------
308%package qmlviewer
309#------------------------------------------------------------------------------
[1079]310Summary: Qt 4 QML Viewer tool
[1078]311Group: Development/Tools
312
[1083]313Requires: lib%{name}-gui = %{version}-%{release}
[1078]314
315%description qmlviewer
316%{descr_brief}
317
318This package contains the Qt QML Viewer tool that allows to view QML files.
319
320%files qmlviewer
321%defattr(-,root,root,-)
322%{qt_bindir}/qmlviewer.exe
323
324%post qmlviewer
325%wps_object_create_begin -n %{name}-qmlviewer
326%{pkg_wps_folder_create}
[1081]327%{pkg_wps_base}_QMLVIEWER:WPProgram|QML Viewer|%{pkg_wps_folder_id}|EXENAME=((%{qt_bindir}/qmlviewer.exe))
[1041]328%wps_object_create_end
329
[1078]330%postun qmlviewer
331%wps_object_delete_all -n %{name}-qmlviewer
[1041]332
333#------------------------------------------------------------------------------
334%package linguist
335#------------------------------------------------------------------------------
[1079]336Summary: Qt 4 Linguist tool
[1041]337Group: Development/Tools
338
[1083]339Requires: lib%{name}-gui = %{version}-%{release}
[1041]340
341%description linguist
342%{descr_brief}
343
344This package contains the Qt Linguist tool used to edit the translation files
345for Qt applications.
346
347%files linguist
348%defattr(-,root,root,-)
[1078]349%{qt_translationdir}/linguist_??.qm
350%{qt_translationdir}/linguist_??_??.qm
351%dir %{qt_datadir}/phrasebooks/
352%{qt_datadir}/phrasebooks/*
[1041]353%{qt_bindir}/linguist.exe
354
355%post linguist
356%wps_object_create_begin -n %{name}-linguist
[1080]357%{pkg_wps_folder_create}
[1078]358%{pkg_wps_base}_LINGUIST:WPProgram|Linguist|%{pkg_wps_folder_id}|EXENAME=((%{qt_bindir}/linguist.exe))
[1041]359%wps_object_create_end
360
361%postun linguist
362%wps_object_delete_all -n %{name}-linguist
363
364#------------------------------------------------------------------------------
365%package assistant
366#------------------------------------------------------------------------------
[1079]367Summary: Qt 4 Assistant tool
[1041]368Group: Development/Tools
369
[1083]370Requires: lib%{name}-gui = %{version}-%{release}
[1041]371
372%description assistant
373%{descr_brief}
374
375This package contains the Qt Assistant tool used to read and search the Qt
376Toolkit reference documentation.
377
378%files assistant
379%defattr(-,root,root,-)
[1078]380%{qt_translationdir}/assistant_??.qm
381%{qt_translationdir}/assistant_??_??.qm
[1041]382%{qt_bindir}/assistant.exe
383
[1078]384%post assistant
385%wps_object_create_begin -n %{name}-assistant
[1080]386%{pkg_wps_folder_create}
[1078]387%{pkg_wps_base}_ASSISTANT:WPProgram|Assistant|%{pkg_wps_folder_id}|EXENAME=((%{qt_bindir}/assistant.exe))
388%wps_object_create_end
389
[1080]390# clean up the assistant cache & search index (@todo other users?)
391rm -f "$HOME/.local/share/data/Trolltech/Assistant/assistant.qch.%{ver_major}.%{ver_minor}"
392rm -f "$HOME/.local/share/data/Trolltech/Assistant/qthelpcollection_%{ver_major}.%{ver_minor}.%{ver_patch}.qhc"
393rm -rf "$HOME/.local/share/data/Trolltech/Assistant/.qthelpcollection_%{ver_major}.%{ver_minor}.%{ver_patch}"
394
[1078]395%postun assistant
396%wps_object_delete_all -n %{name}-assistant
397
[1041]398#------------------------------------------------------------------------------
[1068]399%package designer
400#------------------------------------------------------------------------------
[1079]401Summary: Qt 4 Designer tool
[1068]402Group: Development/Tools
403
[1083]404Requires: lib%{name}-gui = %{version}-%{release}
405Requires: lib%{name}-designer = %{version}-%{release}
[1068]406
407%description designer
408%{descr_brief}
409
410This package contains the Qt Designer tool used to for designing and building
411graphical user interfaces from Qt components.
412
413%files designer
414%defattr(-,root,root,-)
[1078]415%{qt_translationdir}/designer_??.qm
416%{qt_translationdir}/designer_??_??.qm
[1068]417%{qt_bindir}/designer.exe
418
[1078]419%post designer
420%wps_object_create_begin -n %{name}-designer
[1080]421%{pkg_wps_folder_create}
[1078]422%{pkg_wps_base}_DESIGNER:WPProgram|Designer|%{pkg_wps_folder_id}|EXENAME=((%{qt_bindir}/designer.exe))
423%wps_object_create_end
424
425%postun designer
426%wps_object_delete_all -n %{name}-designer
427
[1068]428#------------------------------------------------------------------------------
429%package devel-tools
430#------------------------------------------------------------------------------
[1079]431Summary: Qt 4 development tools
[1068]432Group: Development/Tools
433
[1083]434Requires: lib%{name}-gui = %{version}-%{release}
[1068]435
436%description devel-tools
437%{descr_brief}
438
439This package contains tools used to assist in Qt development, including
[1078]440PixelTool, Help Converter and other applications.
[1068]441
442%files devel-tools
443%defattr(-,root,root,-)
[1078]444%{qt_bindir}/lconvert.exe
[1068]445%{qt_bindir}/pixeltool.exe
[1078]446%{qt_bindir}/qcollectiongenerator.exe
447%{qt_bindir}/qdoc3.exe
448%{qt_bindir}/qhelpconverter.exe
449%{qt_bindir}/qhelpgenerator.exe
450%{qt_bindir}/qt3to4.exe
451%{qt_bindir}/qttracereplay.exe
452%{qt_bindir}/xmlpatterns.exe
453%{qt_bindir}/xmlpatternsvalidator.exe
[1068]454
[1080]455%post devel-tools
456%wps_object_create_begin -n %{name}-devel-tools
457%{pkg_wps_folder_create}
458%{pkg_wps_base}_PIXELTOOL:WPProgram|Pixel Tool|%{pkg_wps_folder_id}|EXENAME=((%{qt_bindir}/pixeltool.exe))
459%{pkg_wps_base}_HELPCONVERTER:WPProgram|Help Converter|%{pkg_wps_folder_id}|EXENAME=((%{qt_bindir}/qhelpconverter.exe))
460%wps_object_create_end
461
462%postun devel-tools
463%wps_object_delete_all -n %{name}-devel-tools
464
[1068]465#------------------------------------------------------------------------------
[1041]466%package doc
467#------------------------------------------------------------------------------
[1079]468Summary: Qt 4 API documentation
[1041]469Group: Documentation
470BuildArch: noarch
471
[1068]472Requires: %{name}-assistant = %{version}-%{release}
[1041]473
474%description doc
475%{descr_brief}
476
477This package contains the Qt Toolkit reference documentation that provides the
478detailed description of all Qt classes and tools.
479
480%files doc
481%defattr(-,root,root,-)
482%{qt_docdir}/qch/*.qch
483
[1080]484%post doc
485%wps_object_create_begin -n %{name}-doc
486%{pkg_wps_folder_create}
487%{pkg_wps_base}_README_FOLDER:WPFolder|Readme Files|%{pkg_wps_folder_id}
488%{pkg_wps_base}_README:WPShadow|README|<%{pkg_wps_base}_README_FOLDER>|SHADOWID=((%{pkg_docdir}/README))
489%{pkg_wps_base}_CHANGES:WPShadow|CHANGES|<%{pkg_wps_base}_README_FOLDER>|SHADOWID=((%{pkg_docdir}/changes-4.7.3))
490%{pkg_wps_base}_README_OS2:WPShadow|README.OS2|<%{pkg_wps_base}_README_FOLDER>|SHADOWID=((%{pkg_docdir}/README.OS2))
491%{pkg_wps_base}_CHANGES_OS2:WPShadow|CHANGES.OS2|<%{pkg_wps_base}_README_FOLDER>|SHADOWID=((%{pkg_docdir}/CHANGES.OS2))
492%wps_object_create_end
493
494%postun doc
495%wps_object_delete_all -n %{name}-doc
496
[1041]497#------------------------------------------------------------------------------
[1083]498%package -n lib%{name}-devel
[1041]499#------------------------------------------------------------------------------
[1079]500Summary: Qt 4 development files
[1041]501Group: Development/Libraries
502
[1083]503Requires: lib%{name}-gui = %{version}-%{release}
[1041]504
[1083]505%description -n lib%{name}-devel
[1041]506%{descr_brief}
507
508This package contains the headers, libraries and tools necessary to develop
[1068]509applications using the Qt toolkit.
[1041]510
[1083]511%files -n lib%{name}-devel
[1041]512%defattr(-,root,root,-)
[1078]513%if "%{qt_headerdir}" != "%{_includedir}"
514%dir %{qt_headerdir}/
515%endif
516%{qt_headerdir}/*
517%exclude %{qt_headerdir}/Qt/QtWebKit
518%exclude %{qt_headerdir}/Qt/qgraphicswebview.h
519%exclude %{qt_headerdir}/Qt/qweb*.h
520%exclude %{qt_headerdir}/QtWebKit/
521%{qt_libdir}/*.lib
522%{qt_libdir}/*.prl
523%exclude %{qt_libdir}/QtWebKit%{ver_major}.lib
524%exclude %{qt_libdir}/QtWebKit.prl
525%dir %{qt_datadir}/mkspecs/
526%{qt_datadir}/mkspecs/*
527%exclude %{qt_datadir}/mkspecs/modules/qt_webkit_version.pri
528%{qt_datadir}/q3porting.xml
529%{qt_bindir}/lrelease.exe
530%{qt_bindir}/lupdate.exe
[1068]531%{qt_bindir}/moc.exe
[1078]532%if "%{qt_bindir}" != "%{_bindir}"
533%{_bindir}/qmake.exe
534%endif
535%{qt_bindir}/qmake.exe
536%{qt_bindir}/rcc.exe
537%{qt_bindir}/uic.exe
[1041]538
539#------------------------------------------------------------------------------
[1083]540%package -n lib%{name}-webkit-devel
[1078]541#------------------------------------------------------------------------------
[1079]542Summary: Qt 4 WebKit development files
[1078]543Group: Development/Libraries
544
[1083]545Requires: lib%{name}-webkit = %{version}-%{release}
546Requires: lib%{name}-devel = %{version}-%{release}
[1078]547
[1083]548%description -n lib%{name}-webkit-devel
[1078]549%{descr_brief}
550
551This package contains the headers, libraries and tools necessary to
552develop applications using the Qt WebKit technology.
553
[1083]554%files -n lib%{name}-webkit-devel
[1078]555%defattr(-,root,root,-)
556%{qt_headerdir}/Qt/QtWebKit
557%{qt_headerdir}/Qt/qgraphicswebview.h
558%{qt_headerdir}/Qt/qweb*.h
559%{qt_headerdir}/QtWebKit/
560%{qt_libdir}/QtWebKit%{ver_major}.lib
561%{qt_libdir}/QtWebKit.prl
562%{qt_datadir}/mkspecs/modules/qt_webkit_version.pri
563
564#------------------------------------------------------------------------------
[1083]565%package devel-kit
[1068]566#------------------------------------------------------------------------------
[1079]567Summary: Qt 4 development kit
[1068]568Group: Development/Libraries
569
[1078]570Requires: %{name}-demos = %{version}-%{release}
571Requires: %{name}-qmlviewer = %{version}-%{release}
[1068]572Requires: %{name}-linguist = %{version}-%{release}
573Requires: %{name}-assistant = %{version}-%{release}
574Requires: %{name}-designer = %{version}-%{release}
575Requires: %{name}-devel-tools = %{version}-%{release}
576Requires: %{name}-doc = %{version}-%{release}
[1083]577Requires: lib%{name}-devel = %{version}-%{release}
578Requires: lib%{name}-webkit-devel = %{version}-%{release}
[1068]579
[1083]580%description devel-kit
[1068]581%{descr_brief}
582
583This meta package installs all individual packages containing various Qt
584development components, including the Qt headers and libraries, the Linguist,
[1079]585Assistant and Designer applications, development tools, example
[1068]586Qt applications and the API documentation.
587
[1083]588%files devel-kit
[1080]589
[1068]590#------------------------------------------------------------------------------
[1041]591%prep
592#------------------------------------------------------------------------------
593
[1068]594%if !0%{?skip_prep}
595
[1091]596%if 0%{?master_mode}
[1068]597%if !0%{?skip_prep_export}
[1091]598# get clean source tree from SVN (both for building and for SRPM)
[1068]599%setup -n "%{name}-%{version}" -Tc
[1091]600svn export %{svn_url} . --force
601rm -f "%{_sourcedir}/%{name}-%{version}.zip"
602(cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}.zip" "%{name}-%{version}")
[1041]603%else
[1091]604# use source tree in %{QT_SOURCE_TREE} (e.g. shadow build)
[1075]605%setup -n "%{name}-%{version}" -Tc%{?skip_prep_clean:D}
[1041]606%endif
[1068]607%else
608# use source zip
609%setup -q
610%endif
[1041]611
[1068]612%endif # if !0%{?skip_prep}
613
[1041]614#------------------------------------------------------------------------------
615%build
616#------------------------------------------------------------------------------
617
[1068]618%if !0%{?skip_build}
[1041]619
[1062]620die() { echo "ERROR: $@"; exit 1; }
621check_var() { eval "[ -n \"\$$1\" ] || die \"$1 variable is not set.\""; }
622
[1091]623%if "%{?svn_revision}" == ""
624QT_BUILD_ID=$(svn info %{svn_url} | sed -nre 's/^Last Changed Rev: ([0-9]+)$/\1/p')
625[ -z "$QT_BUILD_ID" ] && die "Cannot determine SVN revision."
626%else
627QT_BUILD_ID=%{svn_revision}
628%endif
629
[1068]630# Qt source tree (DOS format)
[1062]631QT_SOURCE_TREE_D=$(echo "%{QT_SOURCE_TREE}" | tr '/' '\\')
632
633# Sanity checks (laking these would turn off features that must be ON)
[1068]634check_var "CUPS_INCLUDEPATH"
[1062]635check_var "MYSQL_INCLUDEPATH"
636check_var "MYSQL_LIBS"
637check_var "PSQL_INCLUDEPATH"
638check_var "PSQL_LIBS"
639
[1091]640# Non-root UNIXROOT is not currently supported because of make install
641# that will install to a subtree in such case (which is not expected
642# by %install below). @todo One solution is to move everything from that
643# subtree right to %{buildroot}/@unixroot after make install.
644[ -z "$(echo "$UNIXROOT" | sed -re 's/^[a-bA-b]:$//')" ] || \
645 die "UNIXROOT must be the root directory"
646
[1075]647[ -z "$MAKE_JOBS" ] && MAKE_JOBS=1
648
[1068]649# Qt links to some OS/2 DLLs directly (w/o import libs)
650export LIBRARY_PATH=%{os2_boot_drive}/OS2/DLL\;%{os2_boot_drive}/MPTN/DLL\;$LIBRARY_PATH
651
[1062]652# CMD.EXE is required by the build process for now
653export MAKESHELL=%{os2_boot_drive}\\OS2\\CMD.EXE
654
655# Qt doesn't understand /@unixroot in library paths, replace it with $(UNIXROOT)
656library_paths=$(echo \
[1091]657 --official-build-quiet $QT_BUILD_ID \
[1062]658 -prefix "%{qt_prefix}" \
659 -datadir "%{qt_datadir}" \
660 -libdir "%{qt_libdir}" \
661 -headerdir "%{qt_headerdir}" \
662 -bindir "%{qt_bindir}" \
663 -plugindir "%{qt_plugindir}" \
664 -importdir "%{qt_importdir}" \
665 -demosdir "%{qt_demosdir}" \
666 -examplesdir "%{qt_examplesdir}" \
667 -docdir "%{qt_docdir}" \
668 -translationdir "%{qt_translationdir}" \
669 -sysconfdir "%{qt_sysconfdir}" \
670| sed -re 's,/@unixroot,$(UNIXROOT),g')
671
[1071]672BUILDDIR_D=$(echo "%{_builddir}/%{buildsubdir}" | sed -re 's,/,\\,g')
673
674# make sure the right DLLs are used by the build (and in particular by qdoc
[1075]675# in make docs) in case if there is another Qt version installed
[1071]676export PATH="$BUILDDIR_D\\bin\;$PATH"
677export BEGINLIBPATH="$BUILDDIR_D\\bin\;$BEGINLIBPATH"
678
[1062]679cmd /c $QT_SOURCE_TREE_D\\configure.cmd $library_paths
680
[1075]681make -j$MAKE_JOBS
682
683%if !0%{?skip_build_docs}
[1071]684# qdoc needs the qsqlite plugin but nothing is installed to target locations
685# yet, so generate qt.conf to override paths
686echo \
687"[Paths]
688Prefix = ..
689Settings = \$(ETC)/xdg
690Examples = examples
691Demos = demos" \
692> "%{_builddir}/%{buildsubdir}/bin/qt.conf"
[1068]693make docs -j$MAKE_JOBS
[1075]694rm -f "%{_builddir}/%{buildsubdir}/bin/qt.conf"
[1068]695%endif
696
697%endif # if !0%{?skip_build}
698
[1041]699#------------------------------------------------------------------------------
700%install
701#------------------------------------------------------------------------------
702
[1068]703%if !0%{?skip_install}
704
[1041]705rm -rf %{buildroot}
706
[1075]707# Qt links to some OS/2 DLLs directly (w/o import libs)
708export LIBRARY_PATH=%{os2_boot_drive}/OS2/DLL\;%{os2_boot_drive}/MPTN/DLL\;$LIBRARY_PATH
[1041]709
[1075]710# CMD.EXE is required by the build process for now
711export MAKESHELL=%{os2_boot_drive}\\OS2\\CMD.EXE
712
713# exclude install_htmldocs from install targets
714make install_subtargets install_qchdocs install_qmake install_mkspecs \
715 INSTALL_ROOT=$(echo "%{buildroot}/@unixroot" | sed -re 's,/,\\,g')
716
[1068]717# copy READMEs (make install doesn't do that)
[1078]718mkdir -p "%{buildroot}/%{pkg_docdir}/"
[1075]719cp -dp \
[1078]720 "%{QT_SOURCE_TREE}/LICENSE.*" \
721 "%{QT_SOURCE_TREE}/LGPL_EXCEPTION.txt" \
722 "%{QT_SOURCE_TREE}/README" \
723 "%{QT_SOURCE_TREE}/changes-%{ver_major}.%{ver_minor}.%{ver_patch}" \
724 "%{QT_SOURCE_TREE}/README.OS2" \
725 "%{QT_SOURCE_TREE}/CHANGES.OS2" \
726 "%{buildroot}/%{pkg_docdir}/"
[1041]727
[1078]728# remove *.dll from bin (they will live in %{qt_libdir})
729rm -f "%{buildroot}/%{qt_bindir}/*.dll" "%{buildroot}/%{qt_bindir}/*.sym"
730
731# remove translations we don't need
732rm -f "%{buildroot}/%{qt_translationdir}/qtconfig_??.qm" \
733 "%{buildroot}/%{qt_translationdir}/qtconfig_??_??.qm"
734rm -f "%{buildroot}/%{qt_translationdir}/qvfb_??.qm" \
735 "%{buildroot}/%{qt_translationdir}/qvfb_??_??.qm"
736
737# move qmake.exe to %{_bindir} (to have it in PATH) and symlink back to qt4/bin
738%if "%{qt_bindir}" != "%{_bindir}"
739mkdir -p "%{buildroot}/%{_bindir}/"
740mv "%{buildroot}/%{qt_bindir}/qmake.exe" "%{buildroot}/%{_bindir}/"
741ln -s "%{_bindir}/qmake.exe" "%{buildroot}/%{qt_bindir}/qmake.exe"
742%endif
743
744# @todo temporarily delete .sym files (until we generate -debuginfo packages)
745find "%{buildroot}/" -type f -name "*.sym" -exec rm -f "{}" \;
746
[1068]747%endif # if !0%{?skip_install}
748
[1041]749#------------------------------------------------------------------------------
750%clean
751#------------------------------------------------------------------------------
752
[1091]753%if !0%{?skip_clean}
[1041]754
[1091]755%if 0%{?master_mode}
756%if "%{?create_zips_script}" != ""
757%{create_zips_script} %{buildroot}
758%endif
759%endif
760
761rm -rf %{buildroot}
762
763%endif # if !0%{?skip_clean}
764
[1041]765#------------------------------------------------------------------------------
766%changelog
[1091]767* Thu Sep 15 2011 Dmitriy Kuminov <dmik/coding.org> 4.7.3-1
768- New release 4.7.3. See %{pkg_docdir}/changes-4.7.3 and
769 %{pkg_docdir}/CHANGES.OS2 for more information.
Note: See TracBrowser for help on using the repository browser.