qt/qt.spec

Sun, 29 May 2011 16:25:02 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sun, 29 May 2011 16:25:02 +0200
changeset 343
1bee42cde1f7
parent 342
90f1326e8f73
child 349
886b6dad933a
permissions
-rw-r--r--

Make small corrections and improve comments for upcoming package finishing.

     1 ##
     2 ##  qt.spec -- OpenPKG RPM Specification
     3 ##  Copyright (c) 2011 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 >= 20060823, make, gcc
    60 PreReq:       OpenPKG, openpkg >= 20060823
    61 BuildPreReq:  X11, png, mng, jpeg, tiff, mesa, xrender
    62 PreReq:       X11, png, mng, jpeg, tiff, mesa, xrender
    63 BuildPreReq:  pkgconfig, openssl, zlib, libiconv, sqlite, dbus
    64 PreReq:       pkgconfig, 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 5,0 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     #   Trolltech Bug:
   128     #   yes was specified for OpenVG but cannot be enabled due to functionality tests!
   129     %{l_shtool} subst \
   130         -e 's;lower_case_includes;lower_case_bug;g' \
   131         configure
   132     %{l_shtool} subst \
   133         -e 's;\(-z[\t ][\t ]*\)\([^\t \"][^\t \"]*\);\1"\2";g' \
   134         configure
   135     %{l_shtool} subst \
   136         -e 's;\(RPATH_FLAGS\)=.*\$QT_INSTALL_LIBS.*\(\$RPATH_FLAGS\)";\1="%{l_prefix}/lib/qt/dynamic \2";' \
   137         -e 's;\(QMAKE_RPATHDIR +=\) \\"\$QT_INSTALL_LIBS\\";\1 %{l_prefix}/lib/qt/dynamic;' \
   138         configure
   139     %{l_shtool} subst \
   140         -e "s;\(OPENSSL_LIBS *=\) *-lssl -lcrypto;\1 $openssllibs;" \
   141         configure
   142     %{l_shtool} subst \
   143         -e 's; *QMakeVar set QMAKE_CFLAGS_X11.*QT_CFLAGS_FONTCONFIG.*;;' \
   144         configure
   145     #   yes this is needed several times to catch nested occurences of '--libs'
   146     %{l_shtool} subst \
   147         -e 's;\(QT_LIBS_FONTCONFIG *=.*PKG_CONFIG.*\) --libs ;\1 --libs-only-L ;g' \
   148         -e 's;\(QT_LIBS_FONTCONFIG *=.*PKG_CONFIG.*\) --libs ;\1 --libs-only-L ;g' \
   149         configure
   150     #   yes this is needed several times to catch nested occurences of '--cflags'
   151     %{l_shtool} subst \
   152         -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \
   153         -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \
   154         configure
   155     #   Trolltech Bug:
   156     #   Glib support cannot be enabled due to functionality tests!
   157     #   Turn on verbose messaging (-v) to ./configure to see the final report.
   158     #   Trolltech Bug:
   159     #   In file included from ../../include/QtGui/private/qgtkstyle_p.h:1,
   160     #                    from kernel/qguiplatformplugin.cpp:63:
   161     #   ....../qgtkstyle_p.h:69:21: error: gtk/gtk.h: No such file or directory
   162     #   Workaround resolution:
   163     #   hack to get back the standard '--cflags' of just Qt_CFLAGS_GLIB
   164     #   Question: Is this needed? QT_LIBS_QGTKSTYLE=`$PKG_CONFIG --libs gobject-2.0 2>/dev/null`
   165     %{l_shtool} subst \
   166         -e 's;\(QT_CFLAGS_GLIB *=.*PKG_CONFIG.*\) --cflags-only-other ;\1 --cflags ;g' \
   167         -e 's;\(QT_CFLAGS_QGTKSTYLE *=.*PKG_CONFIG.*\) --cflags-only-other ;\1 --cflags ;g' \
   168         configure
   169 # MSvB In R/D:    %{l_shtool} subst \
   170 # MSvB In R/D:        -e 's;\(TRY_INCLUDEPATHS = \).*\(\$\$INCLUDEPATH\);\1\2;' \
   171 # MSvB In R/D:        -e 's;/freetype2;/freetype;' \
   172 # MSvB In R/D:        config.tests/unix/freetype/freetype.pri
   173     #   Trolltech Bug:
   174     #   /opdv/lib/libmng.a(libmng_cms.o): In function `mnglcms_initlibrary':
   175     #   libmng_cms.c:(.text+0xa): undefined reference to `cmsErrorAction'
   176     %{l_shtool} subst \
   177         -e "s;\(LIBS.*=.*-lmng\);\1 $lcmslibs;" \
   178         src/gui/image/qmnghandler.pri
   179     #   Trolltech Bug:
   180     #   lib/libQtGui.a(qapplication_x11.o): In function
   181     #   `qt_init(QApplicationPrivate*, int, _XDisplay*, unsigned long, unsigned long)':
   182     #   qapplication_x11.cpp:(.text+0xec8d): undefined reference to `FcInit'
   183     %{l_shtool} subst \
   184         -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconflibs;" \
   185         config.tests/x11/fontconfig/fontconfig.pro
   186     echo "LIBS += `%{l_prefix}/bin/pkg-config --libs-only-L fontconfig`" \
   187         >>tools/linguist/linguist/linguist.pro
   188     echo 'INCLUDEPATH += /usr/include/wacomcfg' \
   189         >>src/gui/kernel/x11.pri
   190     echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \
   191         >>src/gui/kernel/x11.pri
   192     echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \
   193         >>src/gui/text/text.pri
   194     #   Trolltech Bug:
   195     #   The QtDBus module cannot be enabled because libdbus-1 version 0.93 was not found.
   196     #   Turn on verbose messaging (-v) to ./configure to see the final report.
   197     echo "INCLUDEPATH = `%{l_prefix}/bin/pkg-config --cflags-only-I dbus-1 | %{l_shtool} subst -e 's;\-I;;g'`" \
   198         >>config.tests/unix/dbus/dbus.pro
   199     echo "LIBS = `%{l_prefix}/bin/pkg-config --libs-only-l --static dbus-1`" \
   200         >>config.tests/unix/dbus/dbus.pro
   201     #   Trolltech Bug:
   202     #   PostgreSQL support cannot be enabled due to functionality tests!
   203     #   Turn on verbose messaging (-v) to ./configure to see the final report.
   204     pgldflags=`%{l_prefix}/bin/pg_config --ldflags`
   205     pglibs=`%{l_prefix}/bin/pg_config --libs`
   206     %{l_shtool} subst \
   207         -e "s;\(LIBS.*= -lpq\);\1 $pgldflags $pglibs $loclibs -pthread;" \
   208         config.tests/unix/psql/psql.pro
   209     #   Trolltech Bug:
   210     #   make: *** [sub-examples-make_default-ordered] Error 2
   211     #   QMAKE_PRL_LIBS in libQtSql.prl is generated defective.
   212     %{l_shtool} subst \
   213         -e "s;\$\$*QT_LFLAGS_PSQL;$pgldflags;" \
   214         -e "s;-lpq;-lpq $pglibs $loclibs -pthread;" \
   215         src/sql/drivers/psql/qsql_psql.pri
   216     #   Trolltech Bug:
   217     #   Iconv support cannot be enabled due to functionality tests!
   218     #   Turn on verbose messaging (-v) to ./configure to see the final report.
   219     %{l_shtool} subst \
   220         -e 's;^mac[^:][^:]*:\(LIBS\);\1;' \
   221         config.tests/unix/iconv/iconv.pro
   222     #   Trolltech Bug:
   223     #   Missing libmng test! Parts (src/gui/image/qmnghandler.cpp) use
   224     #     such libmng methods as mng_create(3), mng_putchunk_term(3)...
   225     #     These are only optional parts of typical MNG implementations.
   226     #     Questions surround whether the MNG standard [1] requires these
   227     #     API methods in their expected form, or if this alone is excuse 
   228     #     enough for neglecting such build time configuration.
   229     #       [1] http://www.libpng.org/pub/mng/spec/
   230     #     A work around is to force integration of Qt 3rdparty embedded
   231     #     MNG logic, thus weakening the loosely coupled nature of Qt
   232     #     components and potentially affecting security.
   233 # MSvB In R/D:    uiclibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig lcms`
   234 # MSvB In R/D:    %{l_shtool} subst \
   235 # MSvB In R/D:        -e 's;LIBS .*= -lpq$;LIBS += -lpq -lssl -lcrypto;' \
   236 # MSvB In R/D:        -e "s;LIBS .*= \$\$QT_LFLAGS_MYSQL;LIBS += $mysqllibs;" \
   237 # MSvB In R/D:        src/sql/drivers/drivers.pri
   238 # MSvB In R/D:    %{l_shtool} subst \
   239 # 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" \
   240 # MSvB In R/D:        src/corelib/kernel/kernel.pri \
   241 # MSvB In R/D:        src/gui/kernel/kernel.pri
   242 # MSvB In R/D:    %{l_shtool} subst \
   243 # 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" \
   244 # 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" \
   245 # 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" \
   246 # MSvB In R/D:        -e 's;!static:\(!isEmpty(QT_LFLAGS_PSQL)\);\1;' \
   247 # MSvB In R/D:        -e 's;!static:\(LIBS \*= \$\$QT_LFLAGS_PSQL\);\1;' \
   248 # MSvB In R/D:        src/plugins/sqldrivers/mysql/mysql.pro \
   249 # MSvB In R/D:        src/plugins/sqldrivers/psql/psql.pro \
   250 # MSvB In R/D:        src/plugins/sqldrivers/sqlite/sqlite.pro \
   251 # MSvB In R/D:        src/sql/drivers/drivers.pri
   252     #   Trolltech Bug:
   253     #   In file included from qdbusconnectioninterface.cpp:52:0:
   254     #   qdbus_symbols_p.h:58:23: fatal error: dbus/dbus.h: No such file or directoryIn
   255     #       file included from qdbusconnection_p.h:70:0, from qdbusconnection.cpp:51:
   256     %{l_shtool} subst \
   257         -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" \
   258         src/dbus/dbus.pro
   259     #   Trolltech Bug:
   260     #   All the OpenGL functionality tests failed!
   261     #   You might need to modify the include and library search paths by
   262     #   editing QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in
   263     #   /home/mschloh/opwrk/tmp/qt-everywhere-opensource-src-4.7.3/mkspecs/linux-g++-64.
   264     %{l_shtool} subst \
   265         -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \
   266         -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/lib;' \
   267         -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\).*;\1 $x11_incdir;" \
   268         -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\).*;\1 $x11_libdir;" \
   269         -e "s;^\(QMAKE_INCDIR_OPENVG[^=]*=\).*;\1 $x11_incdir;" \
   270         -e "s;^\(QMAKE_LIBDIR_OPENVG[^=]*=\).*;\1 $x11_libdir;" \
   271         -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \
   272         mkspecs/qws/*/qmake.conf \
   273         mkspecs/*/*.conf
   274     #   Trolltech Bug:
   275     #   yes was specified for OpenVG but cannot be enabled due to functionality tests!
   276     %{l_shtool} subst \
   277         -e 's;\(\$\$*\)\(QMAKE_LIBS_OPENVG\);\1\2 \1QMAKE_LIBS_THREAD;' \
   278         config.tests/unix/openvg/openvg.pro
   279     %{l_shtool} subst \
   280         -e "s;^\(QMAKE_INCDIR_X11[^=]*=\).*;\1 $x11_incdir;" \
   281         -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\).*;\1 $x11_libdir;" \
   282         mkspecs/qws/*/qmake.conf \
   283         mkspecs/*/qmake.conf
   284 # MSvB In R/D:    %{l_shtool} subst \
   285 # MSvB In R/D:        -e 's;^\(QMAKE_LIBS +=.*\);\1 -liconv;' \
   286 # MSvB In R/D:        src/corelib/corelib.pro
   287     #   Trolltech Bug:
   288     #   In file included from ../JavaScriptCore/runtime/RegExp.h:29:0,
   289     #   ../JavaScriptCore/yarr/RegexJIT.h: In destructor 'JSC::Yarr::RegexCodeBlock::~RegexCodeBlock()':
   290     #   ../JavaScriptCore/yarr/RegexJIT.h:63:36: error: 'jsRegExpFree' was not declared in this scope
   291     %{l_shtool} subst \
   292         -e 's;\(DESTDIR *=\) *\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;' \
   293         src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro
   294     #   Trolltech Bug:
   295     #   In file included from ../JavaScriptCore/runtime/RegExp.h:29:0,
   296     #   ../JavaScriptCore/yarr/RegexJIT.h: In destructor 'JSC::Yarr::RegexCodeBlock::~RegexCodeBlock()':
   297     #   ../JavaScriptCore/yarr/RegexJIT.h:63:36: error: 'jsRegExpFree' was not declared in this scope
   298     %{l_shtool} subst \
   299         -e 's;\(pathToJavaScriptCoreOutput *=\) *\$\$ARGS/\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;g' \
   300         src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
   301 # MSvB In R/D:    echo "QMAKE_LIBDIR += %{l_prefix}/lib/qt/dynamic" \
   302 # MSvB In R/D:        >>mkspecs/features/shared.prf
   303 # MSvB In R/D:    %{l_shtool} subst \
   304 # MSvB In R/D:        -e 's; *\.\./3rdparty/freetype/.*;;g' \
   305 # MSvB In R/D:        -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \
   306 # MSvB In R/D:        src/gui/text/text.pri
   307     #   Trolltech Bug:
   308     #   image/qtiffhandler.cpp:48:20: fatal error: tiffio.h: No such file or directory
   309     #   compilation terminated.
   310     #   make[1]: *** [.obj/release-static/qtiffhandler.o] Error 1
   311     %{l_shtool} subst \
   312         -e 's;\(#include  *"\)\(tiffio.h"\);\1tiff/\2;' \
   313         src/gui/image/qtiffhandler.cpp
   314     #   Trolltech Bug:
   315     #   In file included from ../../../gui/image/qjpeghandler.cpp:42:0:
   316     #   ../../../gui/image/qjpeghandler_p.h:45:35: fatal error:
   317     #   QtGui/qimageiohandler.h: No such file or directory
   318     %{l_shtool} subst \
   319         -e 's;\(INCLUDEPATH *\*=\)\( *\);\1 $RPM_BUILD_DIR/qt-everywhere-opensource-src-%{version}/include\2;' \
   320         src/gui/image/qjpeghandler.pri
   321 # MSvB In R/D:    %{l_shtool} subst \
   322 # MSvB In R/D:        -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \
   323 # MSvB In R/D:        tools/qtconfig/qtconfig.pro
   324 # MSvB In R/D:    %{l_shtool} subst \
   325 # MSvB In R/D:        -e 's;webkit;web-broken-kit;g' \
   326 # MSvB In R/D:        tools/assistant/tools/assistant/assistant.pro
   327 # MSvB In R/D:    echo "DEFINES += QT_NO_WEBKIT" \
   328 # MSvB In R/D:        >>tools/assistant/tools/assistant/assistant.pro
   329 # MSvB In R/D:    %{l_shtool} subst \
   330 # MSvB In R/D:        -e 's;Qt.s Classes;All Classes;' \
   331 # MSvB In R/D:        tools/assistant/tools/assistant/doc/assistant.qdoc \
   332 # MSvB In R/D:        tools/qdoc3/doc/qdoc-manual.qdoc \
   333 # MSvB In R/D:        tools/qdoc3/doc/files/qt.qdocconf \
   334 # MSvB In R/D:        tools/qdoc3/test/qt-build-docs.qdocconf \
   335 # MSvB In R/D:        tools/qdoc3/test/qt.qdocconf
   336     #   Trolltech Bug:
   337     #   In file included from qpaintengine_vg.cpp:42:0:
   338     #   qpaintengine_vg_p.h:66:39: error: expected initializer before ':' token
   339     #   make[1]: *** [.obj/release-static/qpaintengine_vg.o] Error 1
   340     #   make: *** [sub-openvg-sub_src_target_ordered] Error 2
   341     %{l_shtool} subst \
   342         -e 's;Q_OPENVG_EXPORT;Q_DECL_EXPORT;g' \
   343         src/openvg/*
   345 %build
   346     #   protect against sloppy code inclusion of all unused subprojects
   347 # MSvB In R/D: ce-compat  clucene  des  easing  harfbuzz  javascriptcore md4   md5  s60  sha1  webkit  xorg  zlib_dependency.pri
   348     (cd src/3rdparty && rm -rf [^cdehjmswxz]* sql* win* zlib zlib.pri) || exit $?
   350     #   detect which platform for which to build
   351     case "%{l_platform -t}" in
   352         sun4[uv]-sunos* | amd64-sunos*  ) platcomp="solaris-g++-64" ;;
   353         i?86-sunos*                     ) platcomp="solaris-g++"    ;;
   354         amd64-linux*                    ) platcomp="linux-g++-64"   ;;
   355         i?86-linux*                     ) platcomp="linux-g++"      ;;
   356         amd64-freebsd* | i?86-freebsd*  ) platcomp="freebsd-g++"    ;;
   357         *-aix*                          ) platcomp="aix-g++"        ;;
   358         *-darwin*                       ) platcomp="macx-g++"       ;;
   359         *-hpux*                         ) platcomp="hpux-g++"       ;;
   360         *-irix*                         ) platcomp="irix-g++"       ;;
   361         *                               ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;;
   362     esac
   364     #   detect which architecture extensions are available
   365     archflags=''
   366     case "%{l_platform -t}" in
   367         amd64-* )
   368             break
   369             ;;
   370         * )
   371             archflags='-no-sse2 -no-3dnow'
   372             ;;
   373     esac
   375 %if "%{with_shared}" == "yes"
   376     #   optional shared build (precedes mandatory static build)
   377     echo 'yes' | ./configure \
   378         $archflags \
   379         -opensource \
   380         -prefix %{l_prefix} \
   381         -bindir %{l_prefix}/bin \
   382         -libdir %{l_prefix}/lib/qt/dynamic \
   383         -docdir %{l_prefix}/share/qt/doc \
   384         -headerdir %{l_prefix}/include \
   385         -plugindir %{l_prefix}/lib/qt/plugins \
   386         -datadir %{l_prefix}/share/qt \
   387         -translationdir %{l_prefix}/share/qt/translations \
   388         -sysconfdir %{l_prefix}/etc/qt \
   389         -examplesdir %{l_prefix}/share/qt/examples \
   390         -demosdir %{l_prefix}/share/qt/demos \
   391 %if 0
   392     #   Build time Qt definitions should predominate,
   393     #   otherwise foreign definitions cause errors like:
   394     #
   395     #   g++ -c -I/foreign/include [...] animation/qguivariantanimation.cpp
   396     #   .moc/release-shared/moc_qnamespace.cpp:426:16: error: 'WA_LockPortraitOrientation' is not a member of 'Qt'
   397     #   .moc/release-shared/moc_qnamespace.cpp:427:16: error: 'WA_LockLandscapeOrientation' is not a member of 'Qt'
   398     #   .moc/release-shared/moc_qnamespace.cpp:428:16: error: 'WA_AutoOrientation' is not a member of 'Qt'
   399     #   .moc/release-shared/moc_qnamespace.cpp:440:16: error: 'AA_S60DisablePartialScreenInputMode' is not a member of 'Qt'
   400     #
   401     #   Other problems include flawed definitions polluting (C|CXX)FLAGS
   402     #   and overriding the correct definitions in CPPFLAGS. Variables
   403     #   like QMAKE_(C|CXX)FLAGS exhibit this problem as well.
   404     #
   405     #   The work around is to force a Qt dist include path in (C|CXX)FLAGS.
   406 %endif
   407         -I$RPM_BUILD_DIR/qt-everywhere-opensource-src-%{version}/include \
   408         -release \
   409         -shared \
   410         -platform $platcomp \
   411         -s60 \
   412         -qt-style-s60 \
   413         -no-sql-ibase \
   414 %if "%{with_glib}" == "yes"
   415         -glib \
   416 %else
   417         -no-glib \
   418 %endif
   419 %if "%{with_mysql}" == "yes"
   420         -qt-sql-mysql \
   421         -plugin-sql-mysql \
   422 %else
   423         -no-sql-mysql \
   424 %endif
   425 %if "%{with_pgsql}" == "yes"
   426         -qt-sql-psql \
   427         -plugin-sql-psql \
   428 %else
   429         -no-sql-psql \
   430 %endif
   431         -no-sql-odbc \
   432         -system-sqlite \
   433         -qt-sql-sqlite \
   434         -plugin-sql-sqlite \
   435         -no-sql-sqlite2 \
   436         -openssl-linked \
   437         -optimized-qmake \
   438         -xmlpatterns \
   439         -svg \
   440         -webkit \
   441         -system-zlib \
   442         -qt-gif \
   443         -system-libpng \
   444         -system-libmng \
   445         -system-libjpeg \
   446         -system-libtiff \
   447         -rpath \
   448         -no-cups \
   449         -iconv \
   450         -pch \
   451         -dbus-linked \
   452         -opengl \
   453         -openvg \
   454         -xrender \
   455         -fontconfig \
   456         -freetype
   458     #   default options are implicitly used, for example...
   459     #-no-fast -exceptions -accessibility -stl -qt3support -nis
   460     #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
   462     #   carry out shared build procedure
   463     ( cd src
   464       %{l_make} %{l_mflags -O} \
   465           sub-moc sub-rcc sub-uic sub-uic3
   466     ) || exit $?
   467     %{l_make} %{l_mflags -O} \
   468         sub-corelib-make_default-ordered \
   469         sub-xml-make_default-ordered \
   470         sub-network-make_default-ordered \
   471         sub-sql-make_default-ordered \
   472         sub-testlib-make_default-ordered \
   473         sub-dbus-make_default-ordered \
   474         sub-gui-make_default-ordered \
   475         sub-qt3support-make_default-ordered \
   476         sub-opengl-make_default-ordered \
   477         sub-xmlpatterns-make_default-ordered \
   478         sub-multimedia-make_default-ordered \
   479         sub-svg-make_default-ordered \
   480         sub-script-make_default-ordered \
   481         sub-declarative-make_default-ordered \
   482         sub-javascriptcore-make_default-ordered \
   483         sub-webkit-make_default-ordered \
   484         sub-scripttools-make_default-ordered \
   485         sub-plugins-make_default-ordered \
   486         sub-imports-make_default-ordered \
   487         sub-webkitdeclarative-make_default-ordered \
   488         sub-translations-make_default-ordered
   490     #   arthur plugin requires libQtDesigner
   491     ( cd demos
   492       ( cd ../tools/designer/src/lib
   493         %{l_make} %{l_mflags -O}
   494       ) || exit $?
   495       %{l_make} %{l_mflags -O} sub-arthurplugin
   496     ) || exit $?
   498     #   cache shared libs and initialize the build configuration, which
   499     #   would otherwise still contain references to our shared libs build
   500     %{l_shtool} mkdir -f -p -m 755 sharbuild/dynamic
   501     mv lib/* sharbuild/dynamic/
   502     mv plugins sharbuild/
   503     %{l_make} %{l_mflags} confclean
   504 %endif
   506     #   mandatory static build (follows optional shared build)
   507     echo 'yes' | ./configure \
   508         $archflags \
   509         -opensource \
   510         -prefix %{l_prefix} \
   511         -bindir %{l_prefix}/bin \
   512         -libdir %{l_prefix}/lib \
   513         -docdir %{l_prefix}/share/qt/doc \
   514         -headerdir %{l_prefix}/include \
   515         -plugindir %{l_prefix}/lib/qt/plugins \
   516         -datadir %{l_prefix}/share/qt \
   517         -translationdir %{l_prefix}/share/qt/translations \
   518         -sysconfdir %{l_prefix}/etc/qt \
   519         -examplesdir %{l_prefix}/share/qt/examples \
   520         -demosdir %{l_prefix}/share/qt/demos \
   521 %if 0
   522     #   Build time Qt definitions should predominate,
   523     #   otherwise foreign definitions cause errors like:
   524     #
   525     #   g++ -c -I/foreign/include [...] animation/qguivariantanimation.cpp
   526     #   .moc/release-shared/moc_qnamespace.cpp:426:16: error: 'WA_LockPortraitOrientation' is not a member of 'Qt'
   527     #   .moc/release-shared/moc_qnamespace.cpp:427:16: error: 'WA_LockLandscapeOrientation' is not a member of 'Qt'
   528     #   .moc/release-shared/moc_qnamespace.cpp:428:16: error: 'WA_AutoOrientation' is not a member of 'Qt'
   529     #   .moc/release-shared/moc_qnamespace.cpp:440:16: error: 'AA_S60DisablePartialScreenInputMode' is not a member of 'Qt'
   530     #
   531     #   Other problems include flawed definitions polluting (C|CXX)FLAGS
   532     #   and overriding the correct definitions in CPPFLAGS. Variables
   533     #   like QMAKE_(C|CXX)FLAGS exhibit this problem as well.
   534     #
   535     #   The work around is to force a Qt dist include path in (C|CXX)FLAGS.
   536 %endif
   537         -I$RPM_BUILD_DIR/qt-everywhere-opensource-src-%{version}/include \
   538         -release \
   539         -static \
   540         -platform $platcomp \
   541         -s60 \
   542         -qt-style-s60 \
   543         -no-sql-ibase \
   544 %if "%{with_glib}" == "yes"
   545         -glib \
   546 %else
   547         -no-glib \
   548 %endif
   549 %if "%{with_mysql}" == "yes"
   550         -qt-sql-mysql \
   551 %else
   552         -no-sql-mysql \
   553 %endif
   554 %if "%{with_pgsql}" == "yes"
   555         -qt-sql-psql \
   556 %else
   557         -no-sql-psql \
   558 %endif
   559         -no-sql-odbc \
   560         -system-sqlite \
   561         -qt-sql-sqlite \
   562         -no-sql-sqlite2 \
   563         -openssl-linked \
   564         -optimized-qmake \
   565         -xmlpatterns \
   566         -svg \
   567         -webkit \
   568         -system-zlib \
   569         -qt-gif \
   570         -system-libpng \
   571         -system-libmng \
   572         -system-libjpeg \
   573         -system-libtiff \
   574         -rpath \
   575         -no-cups \
   576         -iconv \
   577         -pch \
   578         -dbus-linked \
   579         -opengl \
   580         -openvg \
   581         -xrender \
   582         -fontconfig \
   583         -freetype
   585     #   default options are implicitly used, for example...
   586     #-no-fast -exceptions -accessibility -stl -qt3support -nis
   587     #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
   589     #   carry out static build procedure
   590     #   Trolltech Bug:
   591     #   Problem with dependency order, causes compiling of qtreeview.cpp
   592     #     with dependency to moc_qtreeview.cpp before moc(1) has finished.
   593     #     The implemented work around is disabling parallel make, causing
   594     #     a nearly 100% build deceleration but allowing the build to procede.
   595     #   In file included from itemviews/qtreeview.cpp:3761:0:
   596     #   .moc/release-static/moc_qtreeview.cpp: In member function 'QPixmap QTreeViewPrivate::renderTreeToPixmapForAnimation(const QRect&) const':
   597     #   .moc/release-static/moc_qtreeview.cpp:209:1: internal compiler error: Segmentation fault
   598     %{l_make} %{l_mflags} sub-src
   599 %if "%{with_tools}" == "yes"
   600     %{l_make} %{l_mflags -O} \
   601       sub-tools-make_default-ordered sub-translations-make_default-ordered
   602 %endif
   603 %if "%{with_examples}" == "yes"
   604     %{l_make} %{l_mflags -O} \
   605         sub-demos-make_default-ordered \
   606         sub-examples-make_default-ordered
   607 %endif
   608 %if "%{with_tools}" == "yes"
   609     %{l_make} %{l_mflags -O} docs
   610 %else
   611 %if "%{with_examples}" == "yes"
   612     %{l_make} %{l_mflags -O} docs
   613 %endif
   614 %endif
   616 %install
   617     rm -rf $RPM_BUILD_ROOT
   619     #   carry out installation procedure
   620     targets="sub-tools-bootstrap-install_subtargets-ordered \
   621             sub-moc-install_subtargets-ordered \
   622             sub-rcc-install_subtargets-ordered \
   623             sub-uic-install_subtargets-ordered \
   624             sub-corelib-install_subtargets-ordered \
   625             sub-xml-install_subtargets-ordered \
   626             sub-network-install_subtargets-ordered \
   627             sub-sql-install_subtargets-ordered \
   628             sub-testlib-install_subtargets-ordered \
   629             sub-dbus-install_subtargets-ordered \
   630             sub-gui-install_subtargets-ordered \
   631             sub-qt3support-install_subtargets-ordered \
   632             sub-uic3-install_subtargets-ordered \
   633             sub-opengl-install_subtargets-ordered \
   634             sub-xmlpatterns-install_subtargets-ordered \
   635             sub-multimedia-install_subtargets-ordered \
   636             sub-svg-install_subtargets-ordered \
   637             sub-script-install_subtargets-ordered \
   638             sub-declarative-install_subtargets-ordered \
   639             sub-scripttools-install_subtargets-ordered \
   640             sub-imports-install_subtargets-ordered \
   641             sub-translations-install_subtargets-ordered"
   643 %if "%{with_tools}" == "yes"
   644     targets="$targets sub-tools-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
   645 %endif
   646 %if "%{with_examples}" == "yes"
   647     targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
   648 %endif
   649     targets="$targets install_qmake install_mkspecs"
   650     %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT"
   651     %{l_shtool} install -c -m 644 \
   652         lib/libjscore.a lib/libjscore.prl \
   653         $RPM_BUILD_ROOT%{l_prefix}/lib/
   655     #   correct paths in pkg-config(1) configuration files
   656     %{l_shtool} subst \
   657         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};' \
   658         -e 's;=\([\t ]*\)[^\t ]*qt-everywhere-opensource-src-%{version};=\1%{l_prefix};g' \
   659         $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/*
   660     #   keep library paths clean by removing redundant paths
   661     %{l_shtool} subst \
   662         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}[^\t ]*[\t ]*;;g' \
   663         $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/*
   665     #   install static or shared plugins according to user choice
   666 %if "%{with_shared}" != "yes"
   667     %{l_make} %{l_mflags} sub-plugins-install_subtargets-ordered INSTALL_ROOT="$RPM_BUILD_ROOT"
   668 %else
   669     %{l_tar} cf - -C sharbuild plugins | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   670 %endif
   672 %if "%{with_shared}" == "yes"
   673     #   install shared libs and symlinks
   674     %{l_shtool} mkdir -f -p -m 755 \
   675         $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   676     %{l_tar} cf - -C sharbuild dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   678     #   offer limited support of pkg-config(1) for shared libs
   679     #   substitution unfortunately only handles paths with no whitespace
   680     %{l_shtool} subst \
   681         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L%{l_prefix}/lib/qt/dynamic;' \
   682         -e 's;=\([\t ]*\)[^\t ]*qt-everywhere-opensource-src-%{version};=\1%{l_prefix};g' \
   683         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/*
   684     #   keep library paths clean by removing redundant paths
   685     %{l_shtool} subst \
   686         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}[^\t ]*[\t ]*;;g' \
   687         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/*
   689     #   explain nonstandard shared library placement
   690     ( echo "This OpenPKG Qt build is using the with_shared option."
   691       echo ""
   692       echo "The directory %{l_prefix}/lib/qt/dynamic contains the"
   693       echo "requested shared libraries. Although shared libraries"
   694       echo "have been optionally built (see the build time"
   695       echo "'with_shared yes' option), static libraries were"
   696       echo "built by default as usual, and installed in the"
   697       echo "standard library directory %{l_prefix}/lib."
   698       echo ""
   699       echo "To build applications using shared libraries instead,"
   700       echo "please direct pkg-config(1) to use the proper definitions"
   701       echo "by setting the environment variable PKG_CONFIG_PATH to "
   702       echo "%{l_prefix}/lib/qt/dynamic/pkgconfig."
   703       echo ""
   704       echo "Note: If building via qmake(1), please append"
   705       echo "      either 'static' or 'shared' to the line"
   706       echo "      'CONFIG +=' in the project file (name.pro)."
   707       echo "      Then execute %{l_prefix}/bin/qmake on this file."
   708     ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README
   709 %endif
   711     #   correct temporary runtime link paths (static libs)
   712     %{l_shtool} subst \
   713         -e 's;/./;/;g' \
   714         -e 's;\(QMAKE_PRL_BUILD_DIR[\t ]*=\).*\(qt-everywhere-opensource-src-%{version}.*\);\1 /.../\2;' \
   715         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};' \
   716         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/plugins/*/*.prl \
   717         $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl \
   718         $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
   719     #   clean install by removing redundant paths (static libs)
   720     %{l_shtool} subst \
   721         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}[^\t ]*[\t ]*;;g' \
   722         $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl \
   723         $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
   724 %if "%{with_shared}" == "yes"
   725     #   correct temporary runtime link paths (dynamic libs)
   726     %{l_shtool} subst \
   727         -e 's;/\./;/;g' \
   728         -e 's;\(QMAKE_PRL_BUILD_DIR[\t ]*=\).*\(qt-everywhere-opensource-src-%{version}.*\);\1 /.../\2;' \
   729         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L%{l_prefix}/lib/qt/dynamic;' \
   730         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \
   731         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la
   732     #   clean install by removing redundant paths (dynamic libs)
   733     %{l_shtool} subst \
   734         -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}[^\t ]*[\t ]*;;g' \
   735         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \
   736         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la
   737 %endif
   739 ## Doesn't work as expected, because RPM reads the --[in|ex]cludedocs
   740 ## argument only when installing binary packages, rather than building.
   741 #%define  _excludedocs 0
   742 #%define  _includedocs 1
   743 #    echo %{_excludedocs}
   744 #    echo %{_includedocs}
   745 #
   746 ## Doesn't work as expected, because it seems that OpenPKG too mercilessly
   747 ## removes RPM reading of the %docdir keyword in rpm.patch.feature.
   748 #    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   749 #        %{l_files_std} \
   750 #        '%docdir %{l_prefix}/share/pkg/doc'
   751 #
   752 ## Doesn't work as expected, because the rpmtool(1) marks
   753 ## only einzeln files as documents, skipping directories
   754 #    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   755 #        %{l_files_std} \
   756 #        '%doc %{l_prefix}/share/pkg/doc/doc.txt'
   757 #
   758     #   determine internal file listing
   759     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   760         %{l_files_std} \
   761         '%not %dir %{l_prefix}/lib/pkgconfig'
   763 %files -f files
   765 %clean
   766     rm -rf $RPM_BUILD_ROOT

mercurial