michael@1: ## michael@1: ## qt.spec -- OpenPKG RPM Specification michael@1: ## Copyright (c) 2008 Michael Schloh von Bennewitz michael@1: ## michael@1: ## Permission to use, copy, modify, and distribute this software for michael@1: ## any purpose with or without fee is hereby granted, provided that michael@1: ## the above copyright notice and this permission notice appear in all michael@1: ## copies. michael@1: ## michael@1: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@1: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@1: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@1: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@1: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@1: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@1: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@1: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@1: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@1: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@1: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@1: ## SUCH DAMAGE. michael@1: ## michael@1: michael@1: michael@1: # package information michael@1: Name: qt michael@1: Summary: Cross-platform Application Framework michael@1: URL: http://www.trolltech.com/products/qt/ michael@1: Vendor: Nokia Corporation michael@1: Packager: Michael Schloh von Bennewitz michael@1: Distribution: MSvB Recherche Production michael@1: Class: EVAL michael@1: Group: Development michael@1: License: GPL michael@1: Version: 4.4.3 michael@4: Release: 20081215 michael@1: michael@1: # build options michael@1: %option with_tools yes michael@1: %option with_shared no michael@1: %option with_examples no michael@1: michael@1: # list of sources michael@1: Source0: ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-%{version}.tar.gz michael@1: michael@1: # build information michael@1: Prefix: %{l_prefix} michael@1: BuildRoot: %{l_buildroot} michael@4: BuildPreReq: OpenPKG, openpkg >= 20050726, make, gcc, pkgconfig michael@1: PreReq: OpenPKG, openpkg >= 20050726 michael@1: BuildPreReq: X11, png, mng, jpeg, tiff, mesa, xrender michael@1: PreReq: X11, png, mng, jpeg, tiff, mesa, xrender michael@3: BuildPreReq: openssl, zlib, libiconv, sqlite, dbus michael@3: PreReq: openssl, zlib, libiconv, sqlite, dbus michael@1: BuildPreReq: fontconfig, freetype michael@1: PreReq: fontconfig, freetype michael@1: AutoReq: no michael@1: AutoReqProv: no michael@1: Provides: QTSDK michael@1: michael@1: %description michael@3: Qt is a comprehensive C++ framework for cross-platform application michael@3: development. Using Qt, you can develop applications and user michael@3: interfaces once, and deploy them across many desktop and embedded michael@3: operating systems without rewriting the source code. michael@1: michael@1: %track michael@1: prog qt = { michael@1: version = %{version} michael@1: url = ftp://ftp.trolltech.com/qt/source/ michael@1: regex = qt-x11-opensource-src-(__VER__)\.tar\.gz michael@1: } michael@1: michael@1: %prep michael@1: # announce exceptional build requirements michael@1: ( echo "This package has exceptional storage requirements:" michael@1: echo " qt-%{version}-root (2,5 Go)" michael@1: echo " qt-x11-opensource-src-%{version} (4,5 Go)" michael@1: echo " qt-%{version}-.--.rpm (1 Go)" michael@1: echo "Building with no options takes 0,5 hours on a dual core" michael@3: echo "2 GHz CPU, or 2 hours with all build options enabled." michael@1: ) | %{l_rpmtool} msg -b -t notice michael@1: michael@1: %setup -q -n qt-x11-opensource-src-%{version} michael@1: x11_incdir=`%{l_rc} --query x11_incdir` michael@1: x11_libdir=`%{l_rc} --query x11_libdir` michael@1: fontconf=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig` michael@1: loclibs='' michael@1: x11_supdir='' michael@1: case "%{l_platform -t}" in michael@1: *-sunos* ) michael@1: loclibs='-lsocket -lnsl' michael@1: [ -d /usr/X/sfw/lib ] && x11_supdir=/usr/X/sfw/lib michael@1: ;; michael@1: esac michael@1: ( cd mkspecs/qws michael@1: for plat in freebsd-generic-g++ macx-generic-g++ solaris-generic-g++; michael@1: do michael@1: ln -s $plat `echo $plat | %{l_shtool} subst -e 's;\(.*\)-generic-\(.*\);\1-x86-\2;'` michael@1: done michael@1: ) || exit $? michael@1: %{l_shtool} subst \ michael@1: -e 's;\(-z[ \t][ \t]*\)\([^ \t\"][^ \t\"]*\);\1"\2";g' \ michael@1: configure michael@1: %{l_shtool} subst \ michael@1: -e "s;\(QMAKE_LIBS_X11.*\)-lfreetype -lfontconfig;\1$fontconf;" \ michael@1: configure michael@1: %{l_shtool} subst \ michael@1: -e 's;-silent|;-rpath|-silent|;' \ michael@1: -e 's;\(RPATH_FLAGS="\)\\"\$QT_INSTALL_LIBS\\" \($RPATH_FLAGS"\);\1\2;' \ michael@1: -e "s;\(echo.*QMAKE_RPATHDIR +=\).*\$QT_INSTALL_LIBS\\\\\"\\\";\1 $x11_libdir\";" \ michael@1: configure michael@1: if [ ".$x11_supdir" != . -a -d "$x11_supdir" ]; then michael@1: %{l_shtool} subst \ michael@1: -e "s;\(echo.*QMAKE_RPATHDIR += \)\($x11_libdir\\\"\)\( >> \\\"\$QTCONFIG\.tmp\\\"\);\1\2\3 \&\& \1$x11_supdir\"\3;" \ michael@1: configure michael@1: fi michael@1: %{l_shtool} subst \ michael@1: -e 's;\(TRY_INCLUDEPATHS = \).*\(\$\$INCLUDEPATH\);\1\2;' \ michael@1: -e 's;/freetype2;/freetype;' \ michael@1: config.tests/unix/freetype/freetype.pri michael@1: %{l_shtool} subst \ michael@1: -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconf;" \ michael@1: config.tests/x11/fontconfig/fontconfig.pro michael@1: %{l_shtool} subst \ michael@1: -e "s;\(LIBS += -lpq\);\1 -lssl -lcrypto $loclibs;" \ michael@1: config.tests/unix/psql/psql.pro michael@1: %{l_shtool} subst \ michael@1: -e 's;^mac:\(LIBS\);\1;' \ michael@1: config.tests/unix/iconv/iconv.pro michael@1: %{l_shtool} subst \ michael@1: -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \ michael@1: -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/lib;' \ michael@1: -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \ michael@1: -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2 $x11_supdir;" \ michael@1: -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \ michael@1: mkspecs/qws/*/qmake.conf \ michael@1: mkspecs/*/*.conf michael@1: %{l_shtool} subst \ michael@3: -e 's;^\(QMAKE_LIBS +=.*\);\1 -liconv;' \ michael@3: src/corelib/corelib.pro michael@3: %{l_shtool} subst \ michael@1: -e "s;^\(QMAKE_INCDIR_X11[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \ michael@1: -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2 $x11_supdir;" \ michael@1: mkspecs/qws/solaris*/qmake.conf \ michael@1: mkspecs/solaris*/qmake.conf michael@1: %{l_shtool} subst \ michael@1: -e 's; *\.\./3rdparty/freetype/.*;;g' \ michael@1: -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \ michael@1: src/gui/text/text.pri michael@1: %{l_shtool} subst \ michael@1: -e 's;\(#include *"\)\(tiffio.h"\);\1tiff/\2;' \ michael@1: src/plugins/imageformats/tiff/qtiffhandler.cpp michael@1: # for projfile in `find examples/ -name '*.pro' -print`; do michael@1: # echo 'CONFIG += release' >>$projfile michael@1: # done michael@1: michael@1: %build michael@1: # protect against sloppy code inclusion of all unused subprojects michael@1: rm -rf src/3rdparty/[^cdhmsw]* src/3rdparty/sql* src/3rdparty/win* michael@1: michael@1: case "%{l_platform -t}" in michael@3: *-aix* ) platcomp="aix-g++" ;; michael@3: *-freebsd* ) platcomp="freebsd-g++" ;; michael@3: *-hpux* ) platcomp="hpux-g++" ;; michael@3: *-irix* ) platcomp="irix-g++" ;; michael@3: *64-linux* ) platcomp="linux-g++-64" ;; michael@3: *-linux* ) platcomp="linux-g++" ;; michael@3: *-darwin* ) platcomp="macx-g++" ;; michael@3: *-sunos* ) platcomp="solaris-g++" ;; michael@1: * ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;; michael@1: esac michael@1: michael@1: %if "%{with_shared}" == "yes" michael@1: # optional shared build (precedes mandatory static build) michael@1: echo 'yes' | ./configure \ michael@1: -prefix %{l_prefix} \ michael@1: -bindir %{l_prefix}/bin \ michael@1: -libdir %{l_prefix}/lib/qt \ michael@1: -docdir %{l_prefix}/share/qt/doc \ michael@1: -headerdir %{l_prefix}/include \ michael@1: -plugindir %{l_prefix}/share/qt/plugins \ michael@1: -datadir %{l_prefix}/share/qt \ michael@1: -translationdir %{l_prefix}/share/qt/translations \ michael@1: -sysconfdir %{l_prefix}/etc/qt \ michael@1: -examplesdir %{l_prefix}/share/qt/examples \ michael@1: -demosdir %{l_prefix}/share/qt/demos \ michael@1: -release \ michael@1: -shared \ michael@1: -platform $platcomp \ michael@1: -no-sql-ibase \ michael@3: -qt-sql-mysql \ michael@1: -no-sql-odbc \ michael@1: -no-sql-psql \ michael@1: -no-sql-sqlite2 \ michael@1: -qt-sql-sqlite \ michael@1: -system-sqlite \ michael@3: -openssl-linked \ michael@1: -xmlpatterns \ michael@1: -svg \ michael@1: -no-webkit \ michael@1: -system-zlib \ michael@1: -qt-gif \ michael@1: -system-libpng \ michael@1: -system-libmng \ michael@1: -system-libjpeg \ michael@1: -system-libtiff \ michael@1: -rpath \ michael@1: -no-cups \ michael@1: -iconv \ michael@1: -pch \ michael@1: -dbus-linked \ michael@1: -opengl \ michael@1: -xrender \ michael@1: -fontconfig \ michael@1: -freetype \ michael@3: -no-glib michael@1: michael@4: # sadly, the webkit is broken in Qt 4.4.3. michael@1: # default options are implicitly used, und zwar... michael@1: #-no-fast -exceptions -accessibility -stl -qt3support -nis michael@1: #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb michael@1: michael@1: # carry out shared build procedure michael@1: ( cd src michael@1: %{l_make} %{l_mflags -O} \ michael@1: sub-moc sub-rcc sub-uic michael@1: %{l_make} %{l_mflags -O} \ michael@1: sub-corelib sub-xml sub-network sub-gui sub-sql \ michael@1: sub-script sub-testlib sub-qt3support sub-dbus \ michael@1: sub-opengl sub-xmlpatterns sub-svg sub-plugins michael@1: ) || exit $? michael@1: michael@1: # cache shared libs and initialize the build configuration, which michael@1: # would otherwise still contain references to our shared libs build michael@1: %{l_shtool} mkdir -f -p -m 755 dynamic michael@1: mv lib/* dynamic/ michael@1: ( cd qmake michael@1: %{l_make} %{l_mflags} distclean michael@1: ) || exit $? michael@1: rm -f .qmake.cache michael@1: %endif michael@1: michael@1: # mandatory static build (follows optional shared build) michael@1: echo 'yes' | ./configure \ michael@1: -prefix %{l_prefix} \ michael@1: -bindir %{l_prefix}/bin \ michael@1: -libdir %{l_prefix}/lib \ michael@1: -docdir %{l_prefix}/share/qt/doc \ michael@1: -headerdir %{l_prefix}/include \ michael@1: -plugindir %{l_prefix}/share/qt/plugins \ michael@1: -datadir %{l_prefix}/share/qt \ michael@1: -translationdir %{l_prefix}/share/qt/translations \ michael@1: -sysconfdir %{l_prefix}/etc/qt \ michael@1: -examplesdir %{l_prefix}/share/qt/examples \ michael@1: -demosdir %{l_prefix}/share/qt/demos \ michael@1: -release \ michael@1: -static \ michael@1: -platform $platcomp \ michael@1: -no-sql-ibase \ michael@3: -qt-sql-mysql \ michael@1: -no-sql-odbc \ michael@1: -no-sql-psql \ michael@1: -no-sql-sqlite2 \ michael@1: -qt-sql-sqlite \ michael@1: -system-sqlite \ michael@3: -openssl-linked \ michael@1: -xmlpatterns \ michael@1: -svg \ michael@1: -no-webkit \ michael@1: -system-zlib \ michael@1: -qt-gif \ michael@1: -system-libpng \ michael@1: -system-libmng \ michael@1: -system-libjpeg \ michael@1: -system-libtiff \ michael@1: -rpath \ michael@1: -no-cups \ michael@1: -iconv \ michael@1: -pch \ michael@1: -dbus-linked \ michael@1: -opengl \ michael@1: -xrender \ michael@1: -fontconfig \ michael@1: -freetype \ michael@3: -no-glib michael@1: michael@1: # default options are implicitly used, und zwar... michael@1: #-no-fast -exceptions -accessibility -stl -qt3support -nis michael@1: #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb michael@1: michael@1: # carry out static build procedure michael@1: %{l_make} %{l_mflags -O} sub-src michael@1: %if "%{with_tools}" == "yes" michael@1: %{l_make} %{l_mflags -O} sub-tools michael@1: %endif michael@1: %if "%{with_examples}" == "yes" michael@1: %{l_make} %{l_mflags -O} \ michael@1: sub-demos-make_default-ordered \ michael@1: sub-examples-make_default-ordered michael@1: %endif michael@1: michael@1: %install michael@1: rm -rf $RPM_BUILD_ROOT michael@1: michael@1: # carry out installation procedure michael@1: targets="sub-moc-install_subtargets-ordered \ michael@1: sub-rcc-install_subtargets-ordered \ michael@1: sub-uic-install_subtargets-ordered \ michael@1: sub-corelib-install_subtargets-ordered \ michael@1: sub-xml-install_subtargets-ordered \ michael@1: sub-network-install_subtargets-ordered \ michael@1: sub-gui-install_subtargets-ordered \ michael@1: sub-sql-install_subtargets-ordered \ michael@1: sub-script-install_subtargets-ordered \ michael@1: sub-testlib-install_subtargets-ordered \ michael@1: sub-qt3support-install_subtargets-ordered \ michael@1: sub-dbus-install_subtargets-ordered \ michael@1: sub-uic3-install_subtargets-ordered \ michael@1: sub-opengl-install_subtargets-ordered \ michael@1: sub-xmlpatterns-install_subtargets-ordered \ michael@1: sub-svg-install_subtargets-ordered \ michael@1: sub-plugins-install_subtargets-ordered" michael@1: %if "%{with_tools}" == "yes" michael@1: targets="$targets sub-tools-install_subtargets-ordered" michael@1: %endif michael@1: %if "%{with_examples}" == "yes" michael@1: targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered" michael@1: %endif michael@3: targets="$targets install_htmldocs install_qchdocs install_docimages install_translations install_qmake install_mkspecs" michael@1: %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT" michael@1: michael@1: %if "%{with_shared}" == "yes" michael@1: # install shared libs and symlinks michael@1: %{l_shtool} mkdir -f -p -m 755 \ michael@1: $RPM_BUILD_ROOT%{l_prefix}/lib/qt michael@1: %{l_tar} cf - dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt michael@1: michael@1: # explain nonstandard shared library placement michael@1: ( echo "This directory contains optional shared libraries as" michael@1: echo "defined by the OpenPKG build specification. Although" michael@1: echo "shared libraries are only optionally built (see the" michael@1: echo "build time 'with_shared yes' option), static libraries" michael@1: echo "are built and installed in the parent 'lib' directory." michael@1: ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README michael@1: michael@1: # do not support pkg-config(1) with shared libs michael@1: rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/qt/pkgconfig michael@1: michael@1: # remove temporary dynamic link paths michael@1: %{l_shtool} subst \ michael@1: -e 's;\(QMAKE_PRL_BUILD_DIR[^=][^=]*=\).*\(qt-x11-opensource-src.*\);\1 /tmp/\2;' \ michael@1: $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl michael@1: %endif michael@1: michael@1: # determine internal file listing michael@1: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@1: %{l_files_std} \ michael@1: '%doc %{l_prefix}/share/qt/doc/*' \ michael@1: '%not %dir %{l_prefix}/lib/pkgconfig' michael@1: michael@1: %files -f files michael@1: michael@1: %clean michael@1: rm -rf $RPM_BUILD_ROOT michael@1: