# # http://svn.netlabs.org/qt4 # # If you are a packager, please read HowToDistribute.txt for general # instructions. # Name: qt Vendor: netlabs.org License: LGPLv2 with exceptions or GPLv3 with exceptions Url: http://www.qtsoftware.com/ %define ver_major 4 %define ver_minor 7 %define ver_patch 3 %define os2_release 0 %define rpm_release 1 %define svn_revision 1070 %define descr_brief Qt is a software toolkit for developing applications. %define pkg_wps_base QT4 %define pkg_wps_folder_id <%{pkg_wps_base}_FOLDER> %define pkg_wps_folder_create %{pkg_wps_base}_FOLDER:WPFolder|Qt 4| %define pkg_wps_view_txt() EXENAME=e.exe;PROGTYPE=PROG_PM;PARAMETERS=((%*)) %define pkg_docdir %{_docdir}/%{name} %if 0%{?os2_release} Version: %{ver_major}.%{ver_minor}.%{ver_patch}.%{os2_release} %else Version: %{ver_major}.%{ver_minor}.%{ver_patch} %endif Release: %{rpm_release} Source: %{name}-%{version}.zip #BuildRequires: gnumake (when available) BuildRequires: libc-devel BuildRequires: gcc BuildRequires: gcc-wlink BuildRequires: gcc-wrc #BuildRequires: cups-devel (when available) BuildRequires: openssl-devel BuildRequires: pthread-devel #BuildRequires: mysql-devel (when available) #BuildRequires: psql-devel (when available) # @todo add wrc support to Qt! #------------------------------------------------------------------------------ # commons #------------------------------------------------------------------------------ # process command line arguments %if "%{?QT_SOURCE_TREE}" == "" %define QT_SOURCE_TREE . %endif # @todo temporary %define skip_prep_export 1 # installation paths %define qt_prefix %{_libdir}/%{qtM} %define qt_libdir %{_libdir} %define qt_headerdir %{_includedir}/qt4 %define qt_bindir %{qt_prefix}/bin %define qt_plugindir %{qt_prefix}/plugins %define qt_importdir %{qt_prefix}/imports %define qt_demosdir %{qt_prefix}/demos %define qt_examplesdir %{qt_prefix}/examples %define qt_datadir %{_datadir}/%{qtM} %define qt_docdir %{qt_datadir}/doc %define qt_translationdir %{qt_datadir}/translations %define qt_sysconfdir %{_sysconfdir}/xdg %define qtM %{name}%{ver_major} # disable lxlite compression (Qt EXEs and DLLs are already compressed) %define __os_install_post %{nil} #------------------------------------------------------------------------------ # main package #------------------------------------------------------------------------------ Summary: Qt runtime Group: System Environment/Libraries Provides: %{qtM} = %{version}-%{release} %description %{descr_brief} This package contains runtime Qt libraries for console applications, including core, network and XML modules. %files %defattr(-,root,root,-) %{qt_libdir}/QtCore%{ver_major}.dll %pre %warpin_conflicts_begin netlabs.org\Qt4\Runtime %warpin_conflicts_end #------------------------------------------------------------------------------ %package pm #------------------------------------------------------------------------------ Summary: Qt GUI runtime Group: System Environment/Libraries Requires: %{name} = %{version}-%{release} Provides: %{qtM}-pm = %{version}-%{release} %description pm %{descr_brief} This package contains runtime Qt libraries for Presentation Manager GUI applications. %files pm %defattr(-,root,root,-) %{qt_libdir}/QtGui%{ver_major}.dll #------------------------------------------------------------------------------ %package examples #------------------------------------------------------------------------------ Summary: Example applications for Qt Group: Documentation Requires: %{name}-pm = %{version}-%{release} Provides: %{qtM}-examples = %{version}-%{release} %description examples %{descr_brief} This package contains the demo and example Qt applications and their source code. These applications demonstrate the possibilities of the Qt toolkit. %files examples %defattr(-,root,root,-) %{qt_bindir}/qtdemo.exe # @todo put shortcuts to /usr/bin #%if "%{qt_bindir}" != "%{_bindir}" #%endif #%dir %{qt_examplesdir}/ #%dir %{qt_demosdir}/ %post examples %wps_object_create_begin -n %{name}-examples %pkg_wps_folder_create% %{pkg_wps_base}_DEMO:WPProgram|Examples and Demos||EXENAME=((%{qt_bindir}/qtdemo.exe)) #%{pkg_wps_base}_CHANGELOG:WPProgram|ChangeLog|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/ChangeLog} %wps_object_create_end %postun examples %wps_object_delete_all -n %{name}-examples #------------------------------------------------------------------------------ %package linguist #------------------------------------------------------------------------------ Summary: Qt Linguist tool Group: Development/Tools Requires: %{name}-pm = %{version}-%{release} Provides: %{qtM}-linguist = %{version}-%{release} %description linguist %{descr_brief} This package contains the Qt Linguist tool used to edit the translation files for Qt applications. %files linguist %defattr(-,root,root,-) %{qt_bindir}/linguist.exe %post linguist %wps_object_create_begin -n %{name}-linguist %{wps_qt4_folder} QT4_LINGUIST:WPProgram|Linguist||EXENAME=((%{qt_bindir}/linguist.exe)) %wps_object_create_end %postun linguist %wps_object_delete_all -n %{name}-linguist #------------------------------------------------------------------------------ %package assistant #------------------------------------------------------------------------------ Summary: Qt Assistant tool Group: Development/Tools Requires: %{name}-pm = %{version}-%{release} Provides: %{qtM}-assistant = %{version}-%{release} %description assistant %{descr_brief} This package contains the Qt Assistant tool used to read and search the Qt Toolkit reference documentation. %files assistant %defattr(-,root,root,-) %{qt_bindir}/assistant.exe #------------------------------------------------------------------------------ %package designer #------------------------------------------------------------------------------ Summary: Qt Designer tool Group: Development/Tools Requires: %{name}-pm = %{version}-%{release} Provides: %{qtM}-designer = %{version}-%{release} %description designer %{descr_brief} This package contains the Qt Designer tool used to for designing and building graphical user interfaces from Qt components. %files designer %defattr(-,root,root,-) %{qt_bindir}/designer.exe #------------------------------------------------------------------------------ %package devel-tools #------------------------------------------------------------------------------ Summary: Qt development tools Group: Development/Tools Requires: %{name}-pm = %{version}-%{release} Provides: %{qtM}-devel-tools = %{version}-%{release} %description devel-tools %{descr_brief} This package contains tools used to assist in Qt development, including PixelTool, QML Viewer, Help Converter and other applications. %files devel-tools %defattr(-,root,root,-) %{qt_bindir}/pixeltool.exe #------------------------------------------------------------------------------ %package doc #------------------------------------------------------------------------------ Summary: API documentation for Qt Group: Documentation BuildArch: noarch Requires: %{name}-assistant = %{version}-%{release} Provides: %{qtM}-doc = %{version}-%{release} %description doc %{descr_brief} This package contains the Qt Toolkit reference documentation that provides the detailed description of all Qt classes and tools. %files doc %defattr(-,root,root,-) %{qt_docdir}/qch/*.qch # @todo assistant.exe -remove-search-index #------------------------------------------------------------------------------ %package devel #------------------------------------------------------------------------------ Summary: Development files for Qt Group: Development/Libraries Requires: %{name}-pm = %{version}-%{release} Provides: %{qtM}-devel = %{version}-%{release} %description devel %{descr_brief} This package contains the headers, libraries and tools necessary to develop applications using the Qt toolkit. %files devel %defattr(-,root,root,-) %{qt_bindir}/moc.exe #------------------------------------------------------------------------------ %package devel-all #------------------------------------------------------------------------------ Summary: Qt development kit Group: Development/Libraries Requires: %{name}-examples = %{version}-%{release} Requires: %{name}-linguist = %{version}-%{release} Requires: %{name}-assistant = %{version}-%{release} Requires: %{name}-designer = %{version}-%{release} Requires: %{name}-devel-tools = %{version}-%{release} Requires: %{name}-doc = %{version}-%{release} Provides: %{qtM}-devel-all = %{version}-%{release} %description devel-all %{descr_brief} This meta package installs all individual packages containing various Qt development components, including the Qt headers and libraries, the Linguist, Assistant and designer Designer applications, development tools, example Qt applications and the API documentation. #------------------------------------------------------------------------------ %prep #------------------------------------------------------------------------------ %if !0%{?skip_prep} %if "%{?QT_SOURCE_TREE}" != "" %if !0%{?skip_prep_export} # get clean source tree from SVN %setup -n "%{name}-%{version}" -Tc svn export -r %{svn_revision} %{QT_SOURCE_TREE} . %else # use passed source tree as is (shadow build) %setup -n "%{name}-%{version}" -Tc%{?skip_prep_clean:D} %endif %else # use source zip %setup -q %endif %endif # if !0%{?skip_prep} #------------------------------------------------------------------------------ %build #------------------------------------------------------------------------------ %if !0%{?skip_build} die() { echo "ERROR: $@"; exit 1; } check_var() { eval "[ -n \"\$$1\" ] || die \"$1 variable is not set.\""; } # Qt source tree (DOS format) QT_SOURCE_TREE_D=$(echo "%{QT_SOURCE_TREE}" | tr '/' '\\') # Sanity checks (laking these would turn off features that must be ON) check_var "CUPS_INCLUDEPATH" check_var "MYSQL_INCLUDEPATH" check_var "MYSQL_LIBS" check_var "PSQL_INCLUDEPATH" check_var "PSQL_LIBS" [ -z "$MAKE_JOBS" ] && MAKE_JOBS=1 # Qt links to some OS/2 DLLs directly (w/o import libs) export LIBRARY_PATH=%{os2_boot_drive}/OS2/DLL\;%{os2_boot_drive}/MPTN/DLL\;$LIBRARY_PATH # CMD.EXE is required by the build process for now export MAKESHELL=%{os2_boot_drive}\\OS2\\CMD.EXE # Qt doesn't understand /@unixroot in library paths, replace it with $(UNIXROOT) library_paths=$(echo \ --official-build-quiet %{svn_revision} \ -prefix "%{qt_prefix}" \ -datadir "%{qt_datadir}" \ -libdir "%{qt_libdir}" \ -headerdir "%{qt_headerdir}" \ -bindir "%{qt_bindir}" \ -plugindir "%{qt_plugindir}" \ -importdir "%{qt_importdir}" \ -demosdir "%{qt_demosdir}" \ -examplesdir "%{qt_examplesdir}" \ -docdir "%{qt_docdir}" \ -translationdir "%{qt_translationdir}" \ -sysconfdir "%{qt_sysconfdir}" \ | sed -re 's,/@unixroot,$(UNIXROOT),g') BUILDDIR_D=$(echo "%{_builddir}/%{buildsubdir}" | sed -re 's,/,\\,g') # make sure the right DLLs are used by the build (and in particular by qdoc # in make docs) in case if there is another Qt version installed export PATH="$BUILDDIR_D\\bin\;$PATH" export BEGINLIBPATH="$BUILDDIR_D\\bin\;$BEGINLIBPATH" # temporarily reset UNIXROOT so that install targets will get only Qt prefixes # w/o the UNIXROOT directory chain (if it's not at root) UNIXROOT_OLD="$UNIXROOT" export UNIXROOT= cmd /c $QT_SOURCE_TREE_D\\configure.cmd $library_paths make -j$MAKE_JOBS # resture UNIXROOT export UNIXROOT="$UNIXROOT_OLD" %if !0%{?skip_build_docs} # qdoc needs the qsqlite plugin but nothing is installed to target locations # yet, so generate qt.conf to override paths echo \ "[Paths] Prefix = .. Settings = \$(ETC)/xdg Examples = examples Demos = demos" \ > "%{_builddir}/%{buildsubdir}/bin/qt.conf" make docs -j$MAKE_JOBS rm -f "%{_builddir}/%{buildsubdir}/bin/qt.conf" %endif %endif # if !0%{?skip_build} #------------------------------------------------------------------------------ %install #------------------------------------------------------------------------------ %if !0%{?skip_install} rm -rf %{buildroot} # Qt links to some OS/2 DLLs directly (w/o import libs) export LIBRARY_PATH=%{os2_boot_drive}/OS2/DLL\;%{os2_boot_drive}/MPTN/DLL\;$LIBRARY_PATH # CMD.EXE is required by the build process for now export MAKESHELL=%{os2_boot_drive}\\OS2\\CMD.EXE # exclude install_htmldocs from install targets make install_subtargets install_qchdocs install_qmake install_mkspecs \ INSTALL_ROOT=$(echo "%{buildroot}/@unixroot" | sed -re 's,/,\\,g') # copy READMEs (make install doesn't do that) mkdir -p %{buildroot}/%{pkg_docdir}/ cp -dp \ %{QT_SOURCE_TREE}/LICENSE.* \ %{QT_SOURCE_TREE}/LGPL_EXCEPTION.txt \ %{QT_SOURCE_TREE}/README \ %{QT_SOURCE_TREE}/changes-%{ver_major}.%{ver_minor}.%{ver_patch} \ %{QT_SOURCE_TREE}/README.OS2 \ %{QT_SOURCE_TREE}/CHANGES.OS2 \ %{buildroot}/%{pkg_docdir}/ %endif # if !0%{?skip_install} #------------------------------------------------------------------------------ %clean #------------------------------------------------------------------------------ #rm -rf %{buildroot} #------------------------------------------------------------------------------ %changelog