michael@1: ## michael@1: ## qt.spec -- OpenPKG RPM Specification michael@257: ## Copyright (c) 2010 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@86: # FIXME: MSvB: It appears that bugs in current versions of binutils michael@86: # FIXME: MSvB: fail to properly link Qt object code, resulting in michael@86: # FIXME: MSvB: 'ld: libQt*.so: pthread_mutex...: invalid version 6 michael@86: # FIXME: MSvB: libQt*.so: could not read symbols: Bad value' michael@86: # FIXME: MSvB: The effects of these bugs are platform dependent. michael@86: # FIXME: MSvB: Solaris 11 IA-32 builds fail while Linux 2.6.25.18 michael@86: # FIXME: MSvB: AMD64 builds succeed. michael@1: michael@1: # package information michael@1: Name: qt michael@213: 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@257: Version: 4.7.0 michael@265: Release: 20101015 michael@1: michael@1: # build options michael@1: %option with_tools yes michael@65: %option with_mysql no michael@65: %option with_pgsql no michael@1: %option with_shared no michael@1: %option with_examples no michael@1: michael@1: # list of sources michael@257: Source0: ftp://ftp.qt.nokia.com/qt/source/qt-everywhere-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@65: %if "%{with_mysql}" == "yes" michael@65: BuildPreReq: mysql michael@65: PreReq: mysql michael@65: %endif michael@65: %if "%{with_pgsql}" == "yes" michael@65: BuildPreReq: postgresql michael@65: PreReq: postgresql michael@65: %endif 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@86: operating systems without rewriting the source code. This package michael@86: distribution builds all modules of the Qt/X11 Open Source Edition. michael@1: michael@1: %track michael@1: prog qt = { michael@1: version = %{version} michael@263: url = ftp://ftp.qt.nokia.com/qt/source/ michael@257: regex = qt-everywhere-opensource-src-(__VER__)\.tar\.gz michael@1: } michael@1: michael@1: %prep michael@1: # announce exceptional build requirements michael@257: ( echo "This package has exceptional build requirements:" michael@264: echo " qt-%{version}-root (4,5 Go)" michael@263: echo " qt-everywhere-opensource-src-%{version} (5,5 Go)" michael@263: echo " qt-%{version}-.--.rpm (2 Go)" michael@263: echo "Building with no options takes 2,0 hours on a dual core" michael@264: echo "2 GHz CPU, or 5 hours with all build options enabled." michael@1: ) | %{l_rpmtool} msg -b -t notice michael@1: michael@257: %setup -q -n qt-everywhere-opensource-src-%{version} michael@1: x11_incdir=`%{l_rc} --query x11_incdir` michael@1: x11_libdir=`%{l_rc} --query x11_libdir` michael@92: fontconflibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig` michael@257: lcmslibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static lcms` michael@92: openssllibs=`%{l_prefix}/bin/pkg-config --libs --static openssl` michael@92: michael@1: loclibs='' michael@1: case "%{l_platform -t}" in michael@1: *-sunos* ) michael@1: loclibs='-lsocket -lnsl' 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@266: 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@92: -e 's;\(-z[\t ][\t ]*\)\([^\t \"][^\t \"]*\);\1"\2";g' \ michael@1: configure michael@1: %{l_shtool} subst \ michael@263: -e 's;\(RPATH_FLAGS\)=.*\$QT_INSTALL_LIBS.*\(\$RPATH_FLAGS\)";\1="%{l_prefix}/lib/qt/dynamic \2";' \ michael@264: -e 's;\(QMAKE_RPATHDIR +=\) \\"\$QT_INSTALL_LIBS\\";\1 %{l_prefix}/lib/qt/dynamic;' \ michael@263: configure michael@263: %{l_shtool} subst \ michael@257: -e 's; *QMakeVar set QMAKE_CFLAGS_X11.*QT_CFLAGS_FONTCONFIG.*;;' \ michael@257: -e 's; *QMakeVar set QMAKE_LIBS_X11.*QT_LIBS_FONTCONFIG.*;;' \ michael@92: configure michael@92: %{l_shtool} subst \ michael@92: -e "s;\(OPENSSL_LIBS *=\) *-lssl -lcrypto;\1 $openssllibs;" \ michael@1: configure michael@257: # yes this is needed several times to catch nested occurences of '--cflags' michael@257: %{l_shtool} subst \ michael@257: -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \ michael@257: -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \ michael@257: configure 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@257: -e "s;\(LIBS.*=.*-lmng\);\1 $lcmslibs;" \ michael@257: src/gui/image/qmnghandler.pri michael@257: %{l_shtool} subst \ michael@92: -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconflibs;" \ michael@1: config.tests/x11/fontconfig/fontconfig.pro michael@213: echo 'INCLUDEPATH += /usr/include/wacomcfg' \ michael@213: >>src/gui/kernel/x11.pri michael@257: echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \ michael@257: >>src/gui/kernel/x11.pri michael@257: echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \ michael@257: >>src/gui/text/text.pri michael@257: echo "INCLUDEPATH = `%{l_prefix}/bin/pkg-config --cflags-only-I dbus-1 | %{l_shtool} subst -e 's;\-I;;g'`" \ michael@257: >>config.tests/unix/dbus/dbus.pro michael@257: echo "LIBS = `%{l_prefix}/bin/pkg-config --libs-only-l --static dbus-1`" \ michael@257: >>config.tests/unix/dbus/dbus.pro michael@1: %{l_shtool} subst \ michael@257: -e "s;\(LIBS.*= -lpq\);\1 `%{l_prefix}/bin/pg_config --libs` $loclibs;" \ michael@1: config.tests/unix/psql/psql.pro michael@1: %{l_shtool} subst \ michael@257: -e 's;^mac[^:][^:]*:\(LIBS\);\1;' \ michael@1: config.tests/unix/iconv/iconv.pro michael@257: uiclibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig lcms` michael@1: %{l_shtool} subst \ michael@65: -e 's;LIBS .*= -lpq$;LIBS += -lpq -lssl -lcrypto;' \ michael@65: src/sql/drivers/drivers.pri michael@65: %{l_shtool} subst \ michael@86: -e "s;QMAKE_CXXFLAGS += \$\$QT_CFLAGS_GLIB;INCPATH += `pkg-config --cflags-only-I glib-2.0 gthread-2.0 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \ michael@86: src/corelib/kernel/kernel.pri \ michael@86: src/gui/kernel/kernel.pri michael@86: %{l_shtool} subst \ michael@86: -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_PSQL;INCPATH += `pg_config --includedir 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \ michael@86: -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_MYSQL;INCPATH += `mysql_config --include 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \ michael@86: -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_SQLITE;INCPATH += `pkg-config --cflags-only-I sqlite3 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \ michael@257: -e 's;!static:\(!isEmpty(QT_LFLAGS_PSQL)\);\1;' \ michael@257: -e 's;!static:\(LIBS \*= \$\$QT_LFLAGS_PSQL\);\1;' \ michael@92: src/plugins/sqldrivers/mysql/mysql.pro \ michael@92: src/plugins/sqldrivers/psql/psql.pro \ michael@92: src/plugins/sqldrivers/sqlite/sqlite.pro \ michael@86: src/sql/drivers/drivers.pri michael@86: %{l_shtool} subst \ michael@86: -e "s;QMAKE_CXXFLAGS += \$\$QT_CFLAGS_DBUS;INCPATH += `pkg-config --cflags-only-I dbus-1 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \ michael@86: src/dbus/dbus.pro michael@86: %{l_shtool} subst \ michael@1: -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \ michael@263: -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1;' \ michael@1: -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \ michael@86: -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2;" \ 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@266: -e 's;\(DESTDIR *=\) *\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;' \ michael@266: src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro michael@266: %{l_shtool} subst \ michael@266: -e 's;\(POST_TARGETDEPS *+\?=\) *\$\${pathToJavaScriptCoreOutput};\1 $$QMAKE_LIBDIR_QT;g' \ michael@266: -e 's;\(pathToJavaScriptCoreOutput *=\) *\$\$ARGS/\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;g' \ michael@266: src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri michael@266: %{l_shtool} subst \ michael@86: -e "s;^\(QMAKE_INCDIR_X11[^=]*=\).*;\1 %{l_prefix}/include $x11_incdir;" \ michael@86: -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\).*;\1 %{l_prefix}/lib $x11_libdir;" \ michael@1: mkspecs/qws/solaris*/qmake.conf \ michael@1: mkspecs/solaris*/qmake.conf michael@263: echo "QMAKE_LIBDIR += %{l_prefix}/lib/qt/dynamic" \ michael@263: >>mkspecs/features/shared.prf 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@257: src/gui/image/qtiffhandler.cpp michael@92: %{l_shtool} subst \ michael@92: -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \ michael@92: tools/qtconfig/qtconfig.pro michael@265: %{l_shtool} subst \ michael@265: -e 's;webkit;web-broken-kit;g' \ michael@265: tools/assistant/tools/assistant/assistant.pro michael@265: echo "DEFINES += QT_NO_WEBKIT" \ michael@265: >>tools/assistant/tools/assistant/assistant.pro michael@263: %{l_shtool} subst \ michael@264: -e "s;Qt.s Classes;All Classes;" \ michael@263: tools/assistant/tools/assistant/doc/assistant.qdoc \ michael@263: tools/qdoc3/doc/qdoc-manual.qdoc \ michael@263: tools/qdoc3/doc/files/qt.qdocconf \ michael@263: tools/qdoc3/test/qt-build-docs.qdocconf \ michael@263: tools/qdoc3/test/qt.qdocconf michael@1: michael@1: %build michael@1: # protect against sloppy code inclusion of all unused subprojects michael@257: (cd src/3rdparty && rm -rf [^cdehjmswxz]* sql* win* zlib zlib.pri) || exit $? michael@1: michael@92: # detect which platform for which to build michael@1: case "%{l_platform -t}" in michael@86: sun4[uv]-sunos* | amd64-sunos* ) platcomp="solaris-g++-64" ;; michael@86: i?86-sunos* ) platcomp="solaris-g++" ;; michael@86: amd64-linux* ) platcomp="linux-g++-64" ;; michael@86: i?86-linux* ) platcomp="linux-g++" ;; michael@86: amd64-freebsd* | i?86-freebsd* ) platcomp="freebsd-g++" ;; michael@86: *-aix* ) platcomp="aix-g++" ;; michael@86: *-darwin* ) platcomp="macx-g++" ;; michael@86: *-hpux* ) platcomp="hpux-g++" ;; michael@86: *-irix* ) platcomp="irix-g++" ;; michael@86: * ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;; michael@1: esac michael@1: michael@92: # detect which architecture extensions are available michael@92: archflags='' michael@92: case "%{l_platform -t}" in michael@92: amd64-* ) michael@92: break michael@92: ;; michael@92: * ) michael@92: archflags='-no-sse2 -no-3dnow' michael@92: ;; michael@92: esac michael@92: michael@1: %if "%{with_shared}" == "yes" michael@1: # optional shared build (precedes mandatory static build) michael@1: echo 'yes' | ./configure \ michael@92: $archflags \ michael@205: -opensource \ michael@1: -prefix %{l_prefix} \ michael@1: -bindir %{l_prefix}/bin \ michael@263: -libdir %{l_prefix}/lib/qt/dynamic \ michael@1: -docdir %{l_prefix}/share/qt/doc \ michael@1: -headerdir %{l_prefix}/include \ michael@86: -plugindir %{l_prefix}/lib/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@65: %if "%{with_mysql}" == "yes" michael@3: -qt-sql-mysql \ michael@86: -plugin-sql-mysql \ michael@65: %else michael@65: -no-sql-mysql \ michael@65: %endif michael@65: %if "%{with_pgsql}" == "yes" michael@65: -qt-sql-psql \ michael@86: -plugin-sql-psql \ michael@65: %else michael@65: -no-sql-psql \ michael@65: %endif michael@1: -no-sql-odbc \ michael@65: -system-sqlite \ michael@65: -qt-sql-sqlite \ michael@86: -plugin-sql-sqlite \ michael@1: -no-sql-sqlite2 \ michael@3: -openssl-linked \ michael@1: -xmlpatterns \ michael@1: -svg \ michael@215: -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@257: -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@86: # default options are implicitly used, for example... 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@215: sub-moc sub-rcc sub-uic sub-uic3 michael@1: ) || exit $? michael@257: %{l_make} %{l_mflags -O} \ michael@257: sub-corelib-make_default-ordered \ michael@257: sub-xml-make_default-ordered \ michael@257: sub-network-make_default-ordered \ michael@257: sub-sql-make_default-ordered \ michael@257: sub-testlib-make_default-ordered \ michael@257: sub-dbus-make_default-ordered \ michael@257: sub-gui-make_default-ordered \ michael@257: sub-qt3support-make_default-ordered \ michael@257: sub-opengl-make_default-ordered \ michael@257: sub-xmlpatterns-make_default-ordered \ michael@257: sub-multimedia-make_default-ordered \ michael@257: sub-svg-make_default-ordered \ michael@257: sub-script-make_default-ordered \ michael@257: sub-declarative-make_default-ordered \ michael@257: sub-javascriptcore-make_default-ordered \ michael@257: sub-webkit-make_default-ordered \ michael@257: sub-scripttools-make_default-ordered \ michael@257: sub-plugins-make_default-ordered \ michael@257: sub-imports-make_default-ordered \ michael@257: sub-webkitdeclarative-make_default-ordered \ michael@257: sub-translations-make_default-ordered michael@205: michael@205: # arthur plugin requires libQtDesigner michael@92: ( cd demos michael@205: ( cd ../tools/designer/src/lib michael@263: %{l_make} %{l_mflags -O} michael@205: ) || exit $? michael@92: %{l_make} %{l_mflags -O} sub-arthurplugin michael@92: ) || 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@263: %{l_shtool} mkdir -f -p -m 755 sharbuild/dynamic michael@263: mv lib/* sharbuild/dynamic/ michael@263: mv plugins sharbuild/ michael@257: %{l_make} %{l_mflags} confclean michael@1: %endif michael@1: michael@1: # mandatory static build (follows optional shared build) michael@1: echo 'yes' | ./configure \ michael@92: $archflags \ michael@205: -opensource \ 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@86: -plugindir %{l_prefix}/lib/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@65: %if "%{with_mysql}" == "yes" michael@3: -qt-sql-mysql \ michael@65: %else michael@65: -no-sql-mysql \ michael@65: %endif michael@65: %if "%{with_pgsql}" == "yes" michael@65: -qt-sql-psql \ michael@65: %else michael@65: -no-sql-psql \ michael@65: %endif michael@1: -no-sql-odbc \ michael@65: -system-sqlite \ michael@65: -qt-sql-sqlite \ michael@1: -no-sql-sqlite2 \ michael@3: -openssl-linked \ michael@1: -xmlpatterns \ michael@1: -svg \ michael@265: -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@257: -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@86: # default options are implicitly used, for example... 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@258: %{l_make} %{l_mflags -O} sub-src michael@1: %if "%{with_tools}" == "yes" michael@258: %{l_make} %{l_mflags -O} \ michael@258: sub-tools-make_default-ordered sub-translations-make_default-ordered 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@258: %if "%{with_tools}" == "yes" michael@258: %{l_make} %{l_mflags -O} docs michael@258: %else michael@258: %if "%{with_examples}" == "yes" michael@258: %{l_make} %{l_mflags -O} docs michael@258: %endif michael@258: %endif michael@1: michael@1: %install michael@1: rm -rf $RPM_BUILD_ROOT michael@1: michael@1: # carry out installation procedure michael@215: targets="sub-tools-bootstrap-install_subtargets-ordered \ michael@215: 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@257: sub-sql-install_subtargets-ordered \ michael@257: sub-testlib-install_subtargets-ordered \ michael@257: sub-dbus-install_subtargets-ordered \ michael@1: sub-gui-install_subtargets-ordered \ michael@1: sub-qt3support-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@257: sub-multimedia-install_subtargets-ordered \ michael@1: sub-svg-install_subtargets-ordered \ michael@257: sub-script-install_subtargets-ordered \ michael@257: sub-declarative-install_subtargets-ordered \ michael@257: sub-scripttools-install_subtargets-ordered \ michael@257: sub-imports-install_subtargets-ordered \ michael@257: sub-translations-install_subtargets-ordered" michael@257: michael@1: %if "%{with_tools}" == "yes" michael@258: targets="$targets sub-tools-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages" michael@1: %endif michael@1: %if "%{with_examples}" == "yes" michael@258: targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages" michael@1: %endif michael@258: targets="$targets install_qmake install_mkspecs" michael@1: %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT" michael@266: %{l_shtool} install -c -m 644 \ michael@266: lib/libjscore.a lib/libjscore.prl \ michael@266: $RPM_BUILD_ROOT%{l_prefix}/lib/ michael@1: michael@266: # correct paths in pkg-config(1) configuration files michael@266: %{l_shtool} subst \ michael@266: -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};g" \ michael@266: $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/* michael@266: michael@266: # install static or shared plugins according to user choice michael@263: %if "%{with_shared}" != "yes" michael@263: %{l_make} %{l_mflags} sub-plugins-install_subtargets-ordered INSTALL_ROOT="$RPM_BUILD_ROOT" michael@263: %else michael@264: %{l_tar} cf - -C sharbuild plugins | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt michael@263: %endif michael@266: 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@264: %{l_tar} cf - -C sharbuild dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt michael@1: michael@86: # offer limited support of pkg-config(1) for shared libs michael@87: # substitution unfortunately only handles paths with no whitespace michael@86: %{l_shtool} subst \ michael@266: -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L%{l_prefix}/lib/qt/dynamic;g" \ michael@257: -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};g" \ michael@87: $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/* michael@86: michael@1: # explain nonstandard shared library placement michael@86: ( echo "This OpenPKG Qt build is using the with_shared option." michael@86: echo "" michael@263: echo "The directory %{l_prefix}/lib/qt/dynamic contains the" michael@263: echo "requested shared libraries. Although shared libraries" michael@263: echo "have been optionally built (see the build time" michael@263: echo "'with_shared yes' option), static libraries were" michael@263: echo "built by default as usual, and installed in the" michael@86: echo "standard library directory %{l_prefix}/lib." michael@86: echo "" michael@86: echo "To build applications using shared libraries instead," michael@262: echo "please direct pkg-config(1) to use the proper definitions" michael@86: echo "by setting the environment variable PKG_CONFIG_PATH to " michael@86: echo "%{l_prefix}/lib/qt/dynamic/pkgconfig." michael@263: echo "" michael@263: echo "Note: If building via qmake(1), please append" michael@263: echo " either 'static' or 'shared' to the line" michael@263: echo " 'CONFIG +=' in the project file (name.pro)." michael@263: echo " Then execute %{l_prefix}/bin/qmake on this file." michael@1: ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README michael@263: %endif michael@1: michael@263: # correct temporary runtime link paths (static libs) michael@1: %{l_shtool} subst \ michael@263: -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \ michael@257: -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}\(/[^\t ][^\t ]*\);-L\1%{l_prefix}\2;g" \ michael@263: $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl \ michael@263: $RPM_BUILD_ROOT%{l_prefix}/lib/*.la michael@263: %if "%{with_shared}" == "yes" michael@263: # correct temporary runtime link paths (dynamic libs) michael@263: %{l_shtool} subst \ michael@263: -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \ michael@263: -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L\1%{l_prefix}/lib/qt/dynamic;g" \ michael@92: $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \ michael@92: $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la michael@1: %endif michael@1: michael@259: ## Doesn't work as expected, because RPM reads the --[in|ex]cludedocs michael@259: ## argument only when installing binary packages, rather than building. michael@259: #%define _excludedocs 0 michael@259: #%define _includedocs 1 michael@259: # echo %{_excludedocs} michael@259: # echo %{_includedocs} michael@259: # michael@259: ## Doesn't work as expected, because it seems that OpenPKG too mercilessly michael@259: ## removes RPM readi1ng of the %docdir keyword in rpm.patch.feature. michael@259: # %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@259: # %{l_files_std} \ michael@259: # '%docdir %{l_prefix}/share/pkg/doc' michael@259: # michael@259: ## Doesn't work as expected, because the rpmtool(1) marks michael@259: ## only einzeln files as documents, skipping directories michael@259: # %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@259: # %{l_files_std} \ michael@259: # '%doc %{l_prefix}/share/pkg/doc/doc.txt' michael@259: # michael@1: # determine internal file listing michael@1: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@1: %{l_files_std} \ 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: