qt/qt.spec

Sun, 29 May 2011 12:16:43 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sun, 29 May 2011 12:16:43 +0200
changeset 341
24888fe4de94
parent 340
870131689a5c
child 342
90f1326e8f73
permissions
-rw-r--r--

Make a second cut at needed corrections for upgrade to version 4.7.3.

     1 ##
     2 ##  qt.spec -- OpenPKG RPM Specification
     3 ##  Copyright (c) 2010 Michael Schloh von Bennewitz <michael@schloh.com>
     4 ##
     5 ##  Permission to use, copy, modify, and distribute this software for
     6 ##  any purpose with or without fee is hereby granted, provided that
     7 ##  the above copyright notice and this permission notice appear in all
     8 ##  copies.
     9 ##
    10 ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    11 ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    12 ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    13 ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    14 ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    15 ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    16 ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    17 ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    18 ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    19 ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    20 ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    21 ##  SUCH DAMAGE.
    22 ##
    24 #   FIXME: MSvB: It appears that bugs in current versions of binutils
    25 #   FIXME: MSvB: fail to properly link Qt object code, resulting in
    26 #   FIXME: MSvB: 'ld: libQt*.so: pthread_mutex...: invalid version 6
    27 #   FIXME: MSvB: libQt*.so: could not read symbols: Bad value'
    28 #   FIXME: MSvB: The effects of these bugs are platform dependent.
    29 #   FIXME: MSvB: Solaris 11 IA-32 builds fail while Linux 2.6.25.18
    30 #   FIXME: MSvB: AMD64 builds succeed.
    32 #   package information
    33 Name:         qt
    34 Summary:      Cross Platform Application Framework
    35 URL:          http://www.trolltech.com/products/qt/
    36 Vendor:       Nokia Corporation
    37 Packager:     Michael Schloh von Bennewitz
    38 Distribution: MSvB Recherche Production
    39 Class:        EVAL
    40 Group:        Development
    41 License:      GPL
    42 Version:      4.7.3
    43 Release:      20110514
    45 #   build options
    46 %option       with_tools     yes
    47 %option       with_glib      no
    48 %option       with_mysql     no
    49 %option       with_pgsql     no
    50 %option       with_shared    no
    51 %option       with_examples  no
    53 #   list of sources
    54 Source0:      ftp://ftp.qt.nokia.com/qt/source/qt-everywhere-opensource-src-%{version}.tar.gz
    56 #   build information
    57 Prefix:       %{l_prefix}
    58 BuildRoot:    %{l_buildroot}
    59 BuildPreReq:  OpenPKG, openpkg >= 20050726, make, gcc, pkgconfig
    60 PreReq:       OpenPKG, openpkg >= 20050726
    61 BuildPreReq:  X11, png, mng, jpeg, tiff, mesa, xrender
    62 PreReq:       X11, png, mng, jpeg, tiff, mesa, xrender
    63 BuildPreReq:  openssl, zlib, libiconv, sqlite, dbus
    64 PreReq:       openssl, zlib, libiconv, sqlite, dbus
    65 BuildPreReq:  fontconfig, freetype
    66 PreReq:       fontconfig, freetype
    67 %if "%{with_glib}" == "yes"
    68 BuildPreReq:  glib2
    69 PreReq:       glib2
    70 %endif
    71 %if "%{with_mysql}" == "yes"
    72 BuildPreReq:  mysql
    73 PreReq:       mysql
    74 %endif
    75 %if "%{with_pgsql}" == "yes"
    76 BuildPreReq:  postgresql
    77 PreReq:       postgresql
    78 %endif
    79 AutoReq:      no
    80 AutoReqProv:  no
    81 Provides:     QTSDK
    83 %description
    84     Qt is a comprehensive C++ framework for cross-platform application
    85     development. It plays the role of a widget toolkit in facilitating
    86     the development of software with a graphical user interface, however
    87     Qt is useful for developing command line tools and consoles for
    88     servers as well.
    90 %track
    91     prog qt = {
    92         version   = %{version}
    93         url       = ftp://ftp.qt.nokia.com/qt/source/
    94         regex     = qt-everywhere-opensource-src-(__VER__)\.tar\.gz
    95     }
    97 %prep
    98     #   announce exceptional build requirements
    99     ( echo "This package has exceptional build requirements:"
   100       echo "  qt-%{version}-root (5 Go)"
   101       echo "  qt-everywhere-opensource-src-%{version} (6 Go)"
   102       echo "  qt-%{version}-<date>.<arch>-<os>-<tag>.rpm (2 Go)"
   103       echo "Building with no options takes 3,0 hours on a dual core"
   104       echo "2 GHz CPU, or 7 hours with all build options enabled."
   105     ) | %{l_rpmtool} msg -b -t notice
   107     %setup -q -n qt-everywhere-opensource-src-%{version}
   108     x11_incdir=`%{l_rc} --query x11_incdir`
   109     x11_libdir=`%{l_rc} --query x11_libdir`
   110     fontconflibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig`
   111     lcmslibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static lcms`
   112     openssllibs=`%{l_prefix}/bin/pkg-config --libs --static openssl`
   113     mysqllibs=`%{l_prefix}/bin/mysql_config --libs`
   115 # MSvB In R/D:    loclibs=''
   116 # MSvB In R/D:    case "%{l_platform -t}" in
   117 # MSvB In R/D:        *-sunos* )
   118 # MSvB In R/D:            loclibs='-lsocket -lnsl'
   119 # MSvB In R/D:            ;;
   120 # MSvB In R/D:    esac
   121     ( cd mkspecs/qws
   122       for plat in freebsd-generic-g++ macx-generic-g++ solaris-generic-g++;
   123       do
   124           ln -s $plat `echo $plat | %{l_shtool} subst -e 's;\(.*\)-generic-\(.*\);\1-x86-\2;'`
   125       done
   126     ) || exit $?
   127     %{l_shtool} subst \
   128         -e 's;\(-z[\t ][\t ]*\)\([^\t \"][^\t \"]*\);\1"\2";g' \
   129         configure
   130     %{l_shtool} subst \
   131         -e 's;\(RPATH_FLAGS\)=.*\$QT_INSTALL_LIBS.*\(\$RPATH_FLAGS\)";\1="%{l_prefix}/lib/qt/dynamic \2";' \
   132         -e 's;\(QMAKE_RPATHDIR +=\) \\"\$QT_INSTALL_LIBS\\";\1 %{l_prefix}/lib/qt/dynamic;' \
   133         configure
   134     %{l_shtool} subst \
   135         -e "s;\(OPENSSL_LIBS *=\) *-lssl -lcrypto;\1 $openssllibs;" \
   136         configure
   137     %{l_shtool} subst \
   138         -e 's; *QMakeVar set QMAKE_CFLAGS_X11.*QT_CFLAGS_FONTCONFIG.*;;' \
   139         configure
   140     #   yes this is needed several times to catch nested occurences of '--libs'
   141     %{l_shtool} subst \
   142         -e 's;\(QT_LIBS_FONTCONFIG *=.*PKG_CONFIG.*\) --libs ;\1 --libs-only-L ;g' \
   143         -e 's;\(QT_LIBS_FONTCONFIG *=.*PKG_CONFIG.*\) --libs ;\1 --libs-only-L ;g' \
   144         configure
   145     #   yes this is needed several times to catch nested occurences of '--cflags'
   146     %{l_shtool} subst \
   147         -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \
   148         -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \
   149         configure
   150     #   Trolltech Bug:
   151     #   Glib support cannot be enabled due to functionality tests!
   152     #   Turn on verbose messaging (-v) to ./configure to see the final report.
   153     #   Trolltech Bug:
   154     #   In file included from ../../include/QtGui/private/qgtkstyle_p.h:1,
   155     #                    from kernel/qguiplatformplugin.cpp:63:
   156     #   ....../qgtkstyle_p.h:69:21: error: gtk/gtk.h: No such file or directory
   157     #   Workaround resolution:
   158     #   hack to get back the standard '--cflags' of just Qt_CFLAGS_GLIB
   159     #   Question: Is this needed? QT_LIBS_QGTKSTYLE=`$PKG_CONFIG --libs gobject-2.0 2>/dev/null`
   160     %{l_shtool} subst \
   161         -e 's;\(QT_CFLAGS_GLIB *=.*PKG_CONFIG.*\) --cflags-only-other ;\1 --cflags ;g' \
   162         -e 's;\(QT_CFLAGS_QGTKSTYLE *=.*PKG_CONFIG.*\) --cflags-only-other ;\1 --cflags ;g' \
   163         configure
   164 # MSvB In R/D:    %{l_shtool} subst \
   165 # MSvB In R/D:        -e 's;\(TRY_INCLUDEPATHS = \).*\(\$\$INCLUDEPATH\);\1\2;' \
   166 # MSvB In R/D:        -e 's;/freetype2;/freetype;' \
   167 # MSvB In R/D:        config.tests/unix/freetype/freetype.pri
   168     #   Trolltech Bug:
   169     #   /opdv/lib/libmng.a(libmng_cms.o): In function `mnglcms_initlibrary':
   170     #   libmng_cms.c:(.text+0xa): undefined reference to `cmsErrorAction'
   171     %{l_shtool} subst \
   172         -e "s;\(LIBS.*=.*-lmng\);\1 $lcmslibs;" \
   173         src/gui/image/qmnghandler.pri
   174     #   Trolltech Bug:
   175     #   lib/libQtGui.a(qapplication_x11.o): In function
   176     #   `qt_init(QApplicationPrivate*, int, _XDisplay*, unsigned long, unsigned long)':
   177     #   qapplication_x11.cpp:(.text+0xec8d): undefined reference to `FcInit'
   178     %{l_shtool} subst \
   179         -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconflibs;" \
   180         config.tests/x11/fontconfig/fontconfig.pro
   181     echo "LIBS += `%{l_prefix}/bin/pkg-config --libs-only-L fontconfig`" \
   182         >>tools/linguist/linguist/linguist.pro
   183     echo 'INCLUDEPATH += /usr/include/wacomcfg' \
   184         >>src/gui/kernel/x11.pri
   185     echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \
   186         >>src/gui/kernel/x11.pri
   187     echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \
   188         >>src/gui/text/text.pri
   189     #   Trolltech Bug:
   190     #   The QtDBus module cannot be enabled because libdbus-1 version 0.93 was not found.
   191     #   Turn on verbose messaging (-v) to ./configure to see the final report.
   192     echo "INCLUDEPATH = `%{l_prefix}/bin/pkg-config --cflags-only-I dbus-1 | %{l_shtool} subst -e 's;\-I;;g'`" \
   193         >>config.tests/unix/dbus/dbus.pro
   194     echo "LIBS = `%{l_prefix}/bin/pkg-config --libs-only-l --static dbus-1`" \
   195         >>config.tests/unix/dbus/dbus.pro
   196     #   Trolltech Bug:
   197     #   PostgreSQL support cannot be enabled due to functionality tests!
   198     #   Turn on verbose messaging (-v) to ./configure to see the final report.
   199     %{l_shtool} subst \
   200         -e "s;\(LIBS.*= -lpq\);\1 `%{l_prefix}/bin/pg_config --libs` $loclibs;" \
   201         config.tests/unix/psql/psql.pro
   202     #   Trolltech Bug:
   203     #   Iconv support cannot be enabled due to functionality tests!
   204     #   Turn on verbose messaging (-v) to ./configure to see the final report.
   205     %{l_shtool} subst \
   206         -e 's;^mac[^:][^:]*:\(LIBS\);\1;' \
   207         config.tests/unix/iconv/iconv.pro
   208     #   Trolltech Bug:
   209     #   Missing libmng test! Parts (src/gui/image/qmnghandler.cpp) use
   210     #     such libmng methods as mng_create(3), mng_putchunk_term(3)...
   211     #     These are only optional parts of typical MNG implementations.
   212     #     Questions surround whether the MNG standard [1] requires these
   213     #     API methods in their expected form, or if this alone is excuse 
   214     #     enough for neglecting such build time configuration.
   215     #       [1] http://www.libpng.org/pub/mng/spec/
   216     #     A work around is to force integration of Qt 3rdparty embedded
   217     #     MNG logic, thus weakening the loosely coupled nature of Qt
   218     #     components and potentially affecting security.
   219 # MSvB In R/D:    uiclibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig lcms`
   220 # MSvB In R/D:    %{l_shtool} subst \
   221 # MSvB In R/D:        -e 's;LIBS .*= -lpq$;LIBS += -lpq -lssl -lcrypto;' \
   222 # MSvB In R/D:        -e "s;LIBS .*= \$\$QT_LFLAGS_MYSQL;LIBS += $mysqllibs;" \
   223 # MSvB In R/D:        src/sql/drivers/drivers.pri
   224 # MSvB In R/D:    %{l_shtool} subst \
   225 # MSvB In R/D:        -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" \
   226 # MSvB In R/D:        src/corelib/kernel/kernel.pri \
   227 # MSvB In R/D:        src/gui/kernel/kernel.pri
   228 # MSvB In R/D:    %{l_shtool} subst \
   229 # MSvB In R/D:        -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_PSQL;INCPATH += `pg_config --includedir 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \
   230 # MSvB In R/D:        -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_MYSQL;INCPATH += `mysql_config --include 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \
   231 # MSvB In R/D:        -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" \
   232 # MSvB In R/D:        -e 's;!static:\(!isEmpty(QT_LFLAGS_PSQL)\);\1;' \
   233 # MSvB In R/D:        -e 's;!static:\(LIBS \*= \$\$QT_LFLAGS_PSQL\);\1;' \
   234 # MSvB In R/D:        src/plugins/sqldrivers/mysql/mysql.pro \
   235 # MSvB In R/D:        src/plugins/sqldrivers/psql/psql.pro \
   236 # MSvB In R/D:        src/plugins/sqldrivers/sqlite/sqlite.pro \
   237 # MSvB In R/D:        src/sql/drivers/drivers.pri
   238     #   Trolltech Bug:
   239     #   In file included from qdbusconnectioninterface.cpp:52:0:
   240     #   qdbus_symbols_p.h:58:23: fatal error: dbus/dbus.h: No such file or directoryIn
   241     #       file included from qdbusconnection_p.h:70:0, from qdbusconnection.cpp:51:
   242     %{l_shtool} subst \
   243         -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" \
   244         src/dbus/dbus.pro
   245     #   Trolltech Bug:
   246     #   All the OpenGL functionality tests failed!
   247     #   You might need to modify the include and library search paths by
   248     #   editing QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in
   249     #   /home/mschloh/opwrk/tmp/qt-everywhere-opensource-src-4.7.3/mkspecs/linux-g++-64.
   250     %{l_shtool} subst \
   251         -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \
   252         -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1;' \
   253         -e 's;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;' \
   254         -e 's;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2;' \
   255         -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \
   256         mkspecs/qws/*/qmake.conf \
   257         mkspecs/*/*.conf
   258 # MSvB In R/D:    %{l_shtool} subst \
   259 # MSvB In R/D:        -e 's;^\(QMAKE_LIBS +=.*\);\1 -liconv;' \
   260 # MSvB In R/D:        src/corelib/corelib.pro
   261     #   Trolltech Bug:
   262     #   In file included from ../JavaScriptCore/runtime/RegExp.h:29:0,
   263     #   ../JavaScriptCore/yarr/RegexJIT.h: In destructor 'JSC::Yarr::RegexCodeBlock::~RegexCodeBlock()':
   264     #   ../JavaScriptCore/yarr/RegexJIT.h:63:36: error: 'jsRegExpFree' was not declared in this scope
   265     %{l_shtool} subst \
   266         -e 's;\(DESTDIR *=\) *\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;' \
   267         src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro
   268     #   Trolltech Bug:
   269     #   In file included from ../JavaScriptCore/runtime/RegExp.h:29:0,
   270     #   ../JavaScriptCore/yarr/RegexJIT.h: In destructor 'JSC::Yarr::RegexCodeBlock::~RegexCodeBlock()':
   271     #   ../JavaScriptCore/yarr/RegexJIT.h:63:36: error: 'jsRegExpFree' was not declared in this scope
   272     %{l_shtool} subst \
   273         -e 's;\(pathToJavaScriptCoreOutput *=\) *\$\$ARGS/\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;g' \
   274         src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
   275 # MSvB In R/D:    %{l_shtool} subst \
   276 # MSvB In R/D:        -e "s;^\(QMAKE_INCDIR_X11[^=]*=\).*;\1 %{l_prefix}/include $x11_incdir;" \
   277 # MSvB In R/D:        -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\).*;\1 %{l_prefix}/lib $x11_libdir;" \
   278 # MSvB In R/D:        mkspecs/qws/solaris*/qmake.conf \
   279 # MSvB In R/D:        mkspecs/solaris*/qmake.conf
   280 # MSvB In R/D:    echo "QMAKE_LIBDIR += %{l_prefix}/lib/qt/dynamic" \
   281 # MSvB In R/D:        >>mkspecs/features/shared.prf
   282 # MSvB In R/D:    %{l_shtool} subst \
   283 # MSvB In R/D:        -e 's; *\.\./3rdparty/freetype/.*;;g' \
   284 # MSvB In R/D:        -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \
   285 # MSvB In R/D:        src/gui/text/text.pri
   286     #   Trolltech Bug:
   287     #   image/qtiffhandler.cpp:48:20: fatal error: tiffio.h: No such file or directory
   288     #   compilation terminated.
   289     #   make[1]: *** [.obj/release-static/qtiffhandler.o] Error 1
   290     %{l_shtool} subst \
   291         -e 's;\(#include  *"\)\(tiffio.h"\);\1tiff/\2;' \
   292         src/gui/image/qtiffhandler.cpp
   293 # MSvB In R/D:    %{l_shtool} subst \
   294 # MSvB In R/D:        -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \
   295 # MSvB In R/D:        tools/qtconfig/qtconfig.pro
   296 # MSvB In R/D:    %{l_shtool} subst \
   297 # MSvB In R/D:        -e 's;webkit;web-broken-kit;g' \
   298 # MSvB In R/D:        tools/assistant/tools/assistant/assistant.pro
   299 # MSvB In R/D:    echo "DEFINES += QT_NO_WEBKIT" \
   300 # MSvB In R/D:        >>tools/assistant/tools/assistant/assistant.pro
   301 # MSvB In R/D:    %{l_shtool} subst \
   302 # MSvB In R/D:        -e 's;Qt.s Classes;All Classes;' \
   303 # MSvB In R/D:        tools/assistant/tools/assistant/doc/assistant.qdoc \
   304 # MSvB In R/D:        tools/qdoc3/doc/qdoc-manual.qdoc \
   305 # MSvB In R/D:        tools/qdoc3/doc/files/qt.qdocconf \
   306 # MSvB In R/D:        tools/qdoc3/test/qt-build-docs.qdocconf \
   307 # MSvB In R/D:        tools/qdoc3/test/qt.qdocconf
   309 %build
   310     #   protect against sloppy code inclusion of all unused subprojects
   311 # MSvB In R/D: ce-compat  clucene  des  easing  harfbuzz  javascriptcore md4   md5  s60  sha1  webkit  xorg  zlib_dependency.pri
   312     (cd src/3rdparty && rm -rf [^cdehjmswxz]* sql* win* zlib zlib.pri) || exit $?
   314     #   detect which platform for which to build
   315     case "%{l_platform -t}" in
   316         sun4[uv]-sunos* | amd64-sunos*  ) platcomp="solaris-g++-64" ;;
   317         i?86-sunos*                     ) platcomp="solaris-g++"    ;;
   318         amd64-linux*                    ) platcomp="linux-g++-64"   ;;
   319         i?86-linux*                     ) platcomp="linux-g++"      ;;
   320         amd64-freebsd* | i?86-freebsd*  ) platcomp="freebsd-g++"    ;;
   321         *-aix*                          ) platcomp="aix-g++"        ;;
   322         *-darwin*                       ) platcomp="macx-g++"       ;;
   323         *-hpux*                         ) platcomp="hpux-g++"       ;;
   324         *-irix*                         ) platcomp="irix-g++"       ;;
   325         *                               ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;;
   326     esac
   328     #   detect which architecture extensions are available
   329     archflags=''
   330     case "%{l_platform -t}" in
   331         amd64-* )
   332             break
   333             ;;
   334         * )
   335             archflags='-no-sse2 -no-3dnow'
   336             ;;
   337     esac
   339 %if "%{with_shared}" == "yes"
   340     #   optional shared build (precedes mandatory static build)
   341     echo 'yes' | ./configure \
   342         $archflags \
   343         -opensource \
   344         -prefix %{l_prefix} \
   345         -bindir %{l_prefix}/bin \
   346         -libdir %{l_prefix}/lib/qt/dynamic \
   347         -docdir %{l_prefix}/share/qt/doc \
   348         -headerdir %{l_prefix}/include \
   349         -plugindir %{l_prefix}/lib/qt/plugins \
   350         -datadir %{l_prefix}/share/qt \
   351         -translationdir %{l_prefix}/share/qt/translations \
   352         -sysconfdir %{l_prefix}/etc/qt \
   353         -examplesdir %{l_prefix}/share/qt/examples \
   354         -demosdir %{l_prefix}/share/qt/demos \
   355 %if 0
   356     #   Build time Qt definitions should predominate,
   357     #   otherwise foreign definitions cause errors like:
   358     #
   359     #   g++ -c -I/foreign/include [...] animation/qguivariantanimation.cpp
   360     #   .moc/release-shared/moc_qnamespace.cpp:426:16: error: 'WA_LockPortraitOrientation' is not a member of 'Qt'
   361     #   .moc/release-shared/moc_qnamespace.cpp:427:16: error: 'WA_LockLandscapeOrientation' is not a member of 'Qt'
   362     #   .moc/release-shared/moc_qnamespace.cpp:428:16: error: 'WA_AutoOrientation' is not a member of 'Qt'
   363     #   .moc/release-shared/moc_qnamespace.cpp:440:16: error: 'AA_S60DisablePartialScreenInputMode' is not a member of 'Qt'
   364     #
   365     #   Other problems include flawed definitions polluting (C|CXX)FLAGS
   366     #   and overriding the correct definitions in CPPFLAGS. Variables
   367     #   like QMAKE_(C|CXX)FLAGS exhibit this problem as well.
   368     #
   369     #   The work around is to force a Qt dist include path in (C|CXX)FLAGS.
   370 %endif
   371         -I$RPM_BUILD_DIR/qt-everywhere-opensource-src-%{version}/include \
   372         -release \
   373         -shared \
   374         -platform $platcomp \
   375         -s60 \
   376         -qt-style-s60 \
   377         -no-sql-ibase \
   378 %if "%{with_glib}" == "yes"
   379         -glib \
   380 %else
   381         -no-glib \
   382 %endif
   383 %if "%{with_mysql}" == "yes"
   384         -qt-sql-mysql \
   385         -plugin-sql-mysql \
   386 %else
   387         -no-sql-mysql \
   388 %endif
   389 %if "%{with_pgsql}" == "yes"
   390         -qt-sql-psql \
   391         -plugin-sql-psql \
   392 %else
   393         -no-sql-psql \
   394 %endif
   395         -no-sql-odbc \
   396         -system-sqlite \
   397         -qt-sql-sqlite \
   398         -plugin-sql-sqlite \
   399         -no-sql-sqlite2 \
   400         -openssl-linked \
   401         -optimized-qmake \
   402         -xmlpatterns \
   403         -svg \
   404         -webkit \
   405         -system-zlib \
   406         -qt-gif \
   407         -system-libpng \
   408         -system-libmng \
   409         -system-libjpeg \
   410         -system-libtiff \
   411         -rpath \
   412         -no-cups \
   413         -iconv \
   414         -pch \
   415         -dbus-linked \
   416         -opengl \
   417         -xrender \
   418         -fontconfig \
   419         -freetype
   421     #   default options are implicitly used, for example...
   422     #-no-fast -exceptions -accessibility -stl -qt3support -nis
   423     #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
   425     #   carry out shared build procedure
   426     ( cd src
   427       %{l_make} %{l_mflags -O} \
   428           sub-moc sub-rcc sub-uic sub-uic3
   429     ) || exit $?
   430     %{l_make} %{l_mflags -O} \
   431         sub-corelib-make_default-ordered \
   432         sub-xml-make_default-ordered \
   433         sub-network-make_default-ordered \
   434         sub-sql-make_default-ordered \
   435         sub-testlib-make_default-ordered \
   436         sub-dbus-make_default-ordered \
   437         sub-gui-make_default-ordered \
   438         sub-qt3support-make_default-ordered \
   439         sub-opengl-make_default-ordered \
   440         sub-xmlpatterns-make_default-ordered \
   441         sub-multimedia-make_default-ordered \
   442         sub-svg-make_default-ordered \
   443         sub-script-make_default-ordered \
   444         sub-declarative-make_default-ordered \
   445         sub-javascriptcore-make_default-ordered \
   446         sub-webkit-make_default-ordered \
   447         sub-scripttools-make_default-ordered \
   448         sub-plugins-make_default-ordered \
   449         sub-imports-make_default-ordered \
   450         sub-webkitdeclarative-make_default-ordered \
   451         sub-translations-make_default-ordered
   453     #   arthur plugin requires libQtDesigner
   454     ( cd demos
   455       ( cd ../tools/designer/src/lib
   456         %{l_make} %{l_mflags -O}
   457       ) || exit $?
   458       %{l_make} %{l_mflags -O} sub-arthurplugin
   459     ) || exit $?
   461     #   cache shared libs and initialize the build configuration, which
   462     #   would otherwise still contain references to our shared libs build
   463     %{l_shtool} mkdir -f -p -m 755 sharbuild/dynamic
   464     mv lib/* sharbuild/dynamic/
   465     mv plugins sharbuild/
   466     %{l_make} %{l_mflags} confclean
   467 %endif
   469     #   mandatory static build (follows optional shared build)
   470     echo 'yes' | ./configure \
   471         $archflags \
   472         -opensource \
   473         -prefix %{l_prefix} \
   474         -bindir %{l_prefix}/bin \
   475         -libdir %{l_prefix}/lib \
   476         -docdir %{l_prefix}/share/qt/doc \
   477         -headerdir %{l_prefix}/include \
   478         -plugindir %{l_prefix}/lib/qt/plugins \
   479         -datadir %{l_prefix}/share/qt \
   480         -translationdir %{l_prefix}/share/qt/translations \
   481         -sysconfdir %{l_prefix}/etc/qt \
   482         -examplesdir %{l_prefix}/share/qt/examples \
   483         -demosdir %{l_prefix}/share/qt/demos \
   484 %if 0
   485     #   Build time Qt definitions should predominate,
   486     #   otherwise foreign definitions cause errors like:
   487     #
   488     #   g++ -c -I/foreign/include [...] animation/qguivariantanimation.cpp
   489     #   .moc/release-shared/moc_qnamespace.cpp:426:16: error: 'WA_LockPortraitOrientation' is not a member of 'Qt'
   490     #   .moc/release-shared/moc_qnamespace.cpp:427:16: error: 'WA_LockLandscapeOrientation' is not a member of 'Qt'
   491     #   .moc/release-shared/moc_qnamespace.cpp:428:16: error: 'WA_AutoOrientation' is not a member of 'Qt'
   492     #   .moc/release-shared/moc_qnamespace.cpp:440:16: error: 'AA_S60DisablePartialScreenInputMode' is not a member of 'Qt'
   493     #
   494     #   Other problems include flawed definitions polluting (C|CXX)FLAGS
   495     #   and overriding the correct definitions in CPPFLAGS. Variables
   496     #   like QMAKE_(C|CXX)FLAGS exhibit this problem as well.
   497     #
   498     #   The work around is to force a Qt dist include path in (C|CXX)FLAGS.
   499 %endif
   500         -I$RPM_BUILD_DIR/qt-everywhere-opensource-src-%{version}/include \
   501         -release \
   502         -static \
   503         -platform $platcomp \
   504         -s60 \
   505         -qt-style-s60 \
   506         -no-sql-ibase \
   507 %if "%{with_glib}" == "yes"
   508         -glib \
   509 %else
   510         -no-glib \
   511 %endif
   512 %if "%{with_mysql}" == "yes"
   513         -qt-sql-mysql \
   514 %else
   515         -no-sql-mysql \
   516 %endif
   517 %if "%{with_pgsql}" == "yes"
   518         -qt-sql-psql \
   519 %else
   520         -no-sql-psql \
   521 %endif
   522         -no-sql-odbc \
   523         -system-sqlite \
   524         -qt-sql-sqlite \
   525         -no-sql-sqlite2 \
   526         -openssl-linked \
   527         -optimized-qmake \
   528         -xmlpatterns \
   529         -svg \
   530         -webkit \
   531         -system-zlib \
   532         -qt-gif \
   533         -system-libpng \
   534         -system-libmng \
   535         -system-libjpeg \
   536         -system-libtiff \
   537         -rpath \
   538         -no-cups \
   539         -iconv \
   540         -pch \
   541         -dbus-linked \
   542         -opengl \
   543         -xrender \
   544         -fontconfig \
   545         -freetype
   547     #   default options are implicitly used, for example...
   548     #-no-fast -exceptions -accessibility -stl -qt3support -nis
   549     #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
   551     #   carry out static build procedure
   552     #   Trolltech Bug:
   553     #   Problem with dependency order, causes compiling of qtreeview.cpp
   554     #     with dependency to moc_qtreeview.cpp before moc(1) has finished.
   555     #     The implemented work around is disabling parallel make, causing
   556     #     a nearly 100% build deceleration but allowing the build to procede.
   557     #   In file included from itemviews/qtreeview.cpp:3761:0:
   558     #   .moc/release-static/moc_qtreeview.cpp: In member function 'QPixmap QTreeViewPrivate::renderTreeToPixmapForAnimation(const QRect&) const':
   559     #   .moc/release-static/moc_qtreeview.cpp:209:1: internal compiler error: Segmentation fault
   560     %{l_make} %{l_mflags} sub-src
   561 %if "%{with_tools}" == "yes"
   562     %{l_make} %{l_mflags -O} \
   563       sub-tools-make_default-ordered sub-translations-make_default-ordered
   564 %endif
   565 %if "%{with_examples}" == "yes"
   566     %{l_make} %{l_mflags -O} \
   567         sub-demos-make_default-ordered \
   568         sub-examples-make_default-ordered
   569 %endif
   570 %if "%{with_tools}" == "yes"
   571     %{l_make} %{l_mflags -O} docs
   572 %else
   573 %if "%{with_examples}" == "yes"
   574     %{l_make} %{l_mflags -O} docs
   575 %endif
   576 %endif
   578 %install
   579     rm -rf $RPM_BUILD_ROOT
   581     #   carry out installation procedure
   582     targets="sub-tools-bootstrap-install_subtargets-ordered \
   583             sub-moc-install_subtargets-ordered \
   584             sub-rcc-install_subtargets-ordered \
   585             sub-uic-install_subtargets-ordered \
   586             sub-corelib-install_subtargets-ordered \
   587             sub-xml-install_subtargets-ordered \
   588             sub-network-install_subtargets-ordered \
   589             sub-sql-install_subtargets-ordered \
   590             sub-testlib-install_subtargets-ordered \
   591             sub-dbus-install_subtargets-ordered \
   592             sub-gui-install_subtargets-ordered \
   593             sub-qt3support-install_subtargets-ordered \
   594             sub-uic3-install_subtargets-ordered \
   595             sub-opengl-install_subtargets-ordered \
   596             sub-xmlpatterns-install_subtargets-ordered \
   597             sub-multimedia-install_subtargets-ordered \
   598             sub-svg-install_subtargets-ordered \
   599             sub-script-install_subtargets-ordered \
   600             sub-declarative-install_subtargets-ordered \
   601             sub-scripttools-install_subtargets-ordered \
   602             sub-imports-install_subtargets-ordered \
   603             sub-translations-install_subtargets-ordered"
   605 %if "%{with_tools}" == "yes"
   606     targets="$targets sub-tools-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
   607 %endif
   608 %if "%{with_examples}" == "yes"
   609     targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
   610 %endif
   611     targets="$targets install_qmake install_mkspecs"
   612     %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT"
   613     %{l_shtool} install -c -m 644 \
   614         lib/libjscore.a lib/libjscore.prl \
   615         $RPM_BUILD_ROOT%{l_prefix}/lib/
   617     #   correct paths in pkg-config(1) configuration files
   618     %{l_shtool} subst \
   619         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};' \
   620         -e 's;=\([\t ]*\)[^\t ]*qt-everywhere-opensource-src-%{version};=\1%{l_prefix};g' \
   621         $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/*
   622     #   keep library paths clean by removing redundant paths
   623     %{l_shtool} subst \
   624         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}[^\t ]*[\t ]*;;g' \
   625         $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/*
   627     #   install static or shared plugins according to user choice
   628 %if "%{with_shared}" != "yes"
   629     %{l_make} %{l_mflags} sub-plugins-install_subtargets-ordered INSTALL_ROOT="$RPM_BUILD_ROOT"
   630 %else
   631     %{l_tar} cf - -C sharbuild plugins | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   632 %endif
   634 %if "%{with_shared}" == "yes"
   635     #   install shared libs and symlinks
   636     %{l_shtool} mkdir -f -p -m 755 \
   637         $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   638     %{l_tar} cf - -C sharbuild dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   640     #   offer limited support of pkg-config(1) for shared libs
   641     #   substitution unfortunately only handles paths with no whitespace
   642     %{l_shtool} subst \
   643         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L%{l_prefix}/lib/qt/dynamic;' \
   644         -e 's;=\([\t ]*\)[^\t ]*qt-everywhere-opensource-src-%{version};=\1%{l_prefix};g' \
   645         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/*
   646     #   keep library paths clean by removing redundant paths
   647     %{l_shtool} subst \
   648         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}[^\t ]*[\t ]*;;g' \
   649         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/*
   651     #   explain nonstandard shared library placement
   652     ( echo "This OpenPKG Qt build is using the with_shared option."
   653       echo ""
   654       echo "The directory %{l_prefix}/lib/qt/dynamic contains the"
   655       echo "requested shared libraries. Although shared libraries"
   656       echo "have been optionally built (see the build time"
   657       echo "'with_shared yes' option), static libraries were"
   658       echo "built by default as usual, and installed in the"
   659       echo "standard library directory %{l_prefix}/lib."
   660       echo ""
   661       echo "To build applications using shared libraries instead,"
   662       echo "please direct pkg-config(1) to use the proper definitions"
   663       echo "by setting the environment variable PKG_CONFIG_PATH to "
   664       echo "%{l_prefix}/lib/qt/dynamic/pkgconfig."
   665       echo ""
   666       echo "Note: If building via qmake(1), please append"
   667       echo "      either 'static' or 'shared' to the line"
   668       echo "      'CONFIG +=' in the project file (name.pro)."
   669       echo "      Then execute %{l_prefix}/bin/qmake on this file."
   670     ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README
   671 %endif
   673     #   correct temporary runtime link paths (static libs)
   674     %{l_shtool} subst \
   675         -e 's;/./;/;g' \
   676         -e 's;\(QMAKE_PRL_BUILD_DIR[\t ]*=\).*\(qt-everywhere-opensource-src-%{version}.*\);\1 /.../\2;' \
   677         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};' \
   678         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/plugins/*/*.prl \
   679         $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl \
   680         $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
   681     #   keep library paths clean by removing redundant paths
   682     %{l_shtool} subst \
   683         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}[^\t ]*[\t ]*;;g' \
   684         $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl \
   685         $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
   686 %if "%{with_shared}" == "yes"
   687     #   correct temporary runtime link paths (dynamic libs)
   688     %{l_shtool} subst \
   689         -e 's;/./;/;g' \
   690         -e 's;\(QMAKE_PRL_BUILD_DIR[\t ]*=\).*\(qt-everywhere-opensource-src-%{version}.*\);\1 /.../\2;' \
   691         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L%{l_prefix}/lib/qt/dynamic;' \
   692         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \
   693         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la
   694     #   keep library paths clean by removing redundant paths
   695     %{l_shtool} subst \
   696         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}[^\t ]*[\t ]*;;g' \
   697         $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl \
   698         $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
   699 %endif
   701 ## Doesn't work as expected, because RPM reads the --[in|ex]cludedocs
   702 ## argument only when installing binary packages, rather than building.
   703 #%define  _excludedocs 0
   704 #%define  _includedocs 1
   705 #    echo %{_excludedocs}
   706 #    echo %{_includedocs}
   707 #
   708 ## Doesn't work as expected, because it seems that OpenPKG too mercilessly
   709 ## removes RPM reading of the %docdir keyword in rpm.patch.feature.
   710 #    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   711 #        %{l_files_std} \
   712 #        '%docdir %{l_prefix}/share/pkg/doc'
   713 #
   714 ## Doesn't work as expected, because the rpmtool(1) marks
   715 ## only einzeln files as documents, skipping directories
   716 #    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   717 #        %{l_files_std} \
   718 #        '%doc %{l_prefix}/share/pkg/doc/doc.txt'
   719 #
   720     #   determine internal file listing
   721     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   722         %{l_files_std} \
   723         '%not %dir %{l_prefix}/lib/pkgconfig'
   725 %files -f files
   727 %clean
   728     rm -rf $RPM_BUILD_ROOT

mercurial