qt/qt.spec

Sat, 21 May 2011 22:05:42 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 21 May 2011 22:05:42 +0200
changeset 340
870131689a5c
parent 289
1ff6f25dc4d9
child 341
24888fe4de94
permissions
-rw-r--r--

Correct diverse buildconf of upstream release and reconcile packaging somewhat.
These changes stem from the obvious changes in the latest vendor release, but
from discussions with trolls Daniel and Oswald as well regarding build config.

This commital follows conclusion of buildconf adjustments to allow the new
vendor version to build on Linux AMD64, but is incomplete as many packaging
comments show. The next series of changes focus on Solaris IA32 and reduction
of buildconf adjustments testing old problems comprehensively in anticipation
of discussion at the upcoming Nokia Contributor Summit in Berlin.

     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. Using Qt, you can develop applications and user
    86     interfaces once, and deploy them across many desktop and embedded
    87     operating systems without rewriting the source code. This package
    88     distribution builds all modules of the Qt/X11 Open Source Edition.
    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 (4,5 Go)"
   101       echo "  qt-everywhere-opensource-src-%{version} (5,5 Go)"
   102       echo "  qt-%{version}-<date>.<arch>-<os>-<tag>.rpm (2 Go)"
   103       echo "Building with no options takes 2,0 hours on a dual core"
   104       echo "2 GHz CPU, or 5 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 # MSvB Aktualisierung: The uiclibs line is probably an error, remove... 
   209 # MSvB In R/D:    uiclibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig lcms`
   210 # MSvB In R/D:    %{l_shtool} subst \
   211 # MSvB In R/D:        -e 's;LIBS .*= -lpq$;LIBS += -lpq -lssl -lcrypto;' \
   212 # MSvB In R/D:        -e "s;LIBS .*= \$\$QT_LFLAGS_MYSQL;LIBS += $mysqllibs;" \
   213 # MSvB In R/D:        src/sql/drivers/drivers.pri
   214 # MSvB In R/D:    %{l_shtool} subst \
   215 # 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" \
   216 # MSvB In R/D:        src/corelib/kernel/kernel.pri \
   217 # MSvB In R/D:        src/gui/kernel/kernel.pri
   218 # MSvB In R/D:    %{l_shtool} subst \
   219 # 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" \
   220 # 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" \
   221 # 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" \
   222 # MSvB In R/D:        -e 's;!static:\(!isEmpty(QT_LFLAGS_PSQL)\);\1;' \
   223 # MSvB In R/D:        -e 's;!static:\(LIBS \*= \$\$QT_LFLAGS_PSQL\);\1;' \
   224 # MSvB In R/D:        src/plugins/sqldrivers/mysql/mysql.pro \
   225 # MSvB In R/D:        src/plugins/sqldrivers/psql/psql.pro \
   226 # MSvB In R/D:        src/plugins/sqldrivers/sqlite/sqlite.pro \
   227 # MSvB In R/D:        src/sql/drivers/drivers.pri
   228     #   Trolltech Bug:
   229     #   In file included from qdbusconnectioninterface.cpp:52:0:
   230     #   qdbus_symbols_p.h:58:23: fatal error: dbus/dbus.h: No such file or directoryIn
   231     #       file included from qdbusconnection_p.h:70:0, from qdbusconnection.cpp:51:
   232     %{l_shtool} subst \
   233         -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" \
   234         src/dbus/dbus.pro
   235     #   Trolltech Bug:
   236     #   All the OpenGL functionality tests failed!
   237     #   You might need to modify the include and library search paths by
   238     #   editing QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in
   239     #   /home/mschloh/opwrk/tmp/qt-everywhere-opensource-src-4.7.3/mkspecs/linux-g++-64.
   240     %{l_shtool} subst \
   241         -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \
   242         -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1;' \
   243         -e 's;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;' \
   244         -e 's;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2;' \
   245         -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \
   246         mkspecs/qws/*/qmake.conf \
   247         mkspecs/*/*.conf
   248 # MSvB In R/D:    %{l_shtool} subst \
   249 # MSvB In R/D:        -e 's;^\(QMAKE_LIBS +=.*\);\1 -liconv;' \
   250 # MSvB In R/D:        src/corelib/corelib.pro
   251     #   Trolltech Bug:
   252     #   In file included from ../JavaScriptCore/runtime/RegExp.h:29:0,
   253     #   ../JavaScriptCore/yarr/RegexJIT.h: In destructor 'JSC::Yarr::RegexCodeBlock::~RegexCodeBlock()':
   254     #   ../JavaScriptCore/yarr/RegexJIT.h:63:36: error: 'jsRegExpFree' was not declared in this scope
   255     %{l_shtool} subst \
   256         -e 's;\(DESTDIR *=\) *\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;' \
   257         src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro
   258     #   Trolltech Bug:
   259     #   In file included from ../JavaScriptCore/runtime/RegExp.h:29:0,
   260     #   ../JavaScriptCore/yarr/RegexJIT.h: In destructor 'JSC::Yarr::RegexCodeBlock::~RegexCodeBlock()':
   261     #   ../JavaScriptCore/yarr/RegexJIT.h:63:36: error: 'jsRegExpFree' was not declared in this scope
   262     %{l_shtool} subst \
   263         -e 's;\(pathToJavaScriptCoreOutput *=\) *\$\$ARGS/\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;g' \
   264         src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
   265 # MSvB In R/D:    %{l_shtool} subst \
   266 # MSvB In R/D:        -e "s;^\(QMAKE_INCDIR_X11[^=]*=\).*;\1 %{l_prefix}/include $x11_incdir;" \
   267 # MSvB In R/D:        -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\).*;\1 %{l_prefix}/lib $x11_libdir;" \
   268 # MSvB In R/D:        mkspecs/qws/solaris*/qmake.conf \
   269 # MSvB In R/D:        mkspecs/solaris*/qmake.conf
   270 # MSvB In R/D:    echo "QMAKE_LIBDIR += %{l_prefix}/lib/qt/dynamic" \
   271 # MSvB In R/D:        >>mkspecs/features/shared.prf
   272 # MSvB In R/D:    %{l_shtool} subst \
   273 # MSvB In R/D:        -e 's; *\.\./3rdparty/freetype/.*;;g' \
   274 # MSvB In R/D:        -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \
   275 # MSvB In R/D:        src/gui/text/text.pri
   276     #   Trolltech Bug:
   277     #   image/qtiffhandler.cpp:48:20: fatal error: tiffio.h: No such file or directory
   278     #   compilation terminated.
   279     #   make[1]: *** [.obj/release-static/qtiffhandler.o] Error 1
   280     %{l_shtool} subst \
   281         -e 's;\(#include  *"\)\(tiffio.h"\);\1tiff/\2;' \
   282         src/gui/image/qtiffhandler.cpp
   283 # MSvB In R/D:    %{l_shtool} subst \
   284 # MSvB In R/D:        -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \
   285 # MSvB In R/D:        tools/qtconfig/qtconfig.pro
   286 # MSvB In R/D:    %{l_shtool} subst \
   287 # MSvB In R/D:        -e 's;webkit;web-broken-kit;g' \
   288 # MSvB In R/D:        tools/assistant/tools/assistant/assistant.pro
   289 # MSvB In R/D:    echo "DEFINES += QT_NO_WEBKIT" \
   290 # MSvB In R/D:        >>tools/assistant/tools/assistant/assistant.pro
   291 # MSvB In R/D:    %{l_shtool} subst \
   292 # MSvB In R/D:        -e "s;Qt.s Classes;All Classes;" \
   293 # MSvB In R/D:        tools/assistant/tools/assistant/doc/assistant.qdoc \
   294 # MSvB In R/D:        tools/qdoc3/doc/qdoc-manual.qdoc \
   295 # MSvB In R/D:        tools/qdoc3/doc/files/qt.qdocconf \
   296 # MSvB In R/D:        tools/qdoc3/test/qt-build-docs.qdocconf \
   297 # MSvB In R/D:        tools/qdoc3/test/qt.qdocconf
   299 %build
   300     #   protect against sloppy code inclusion of all unused subprojects
   301 # MSvB In R/D: ce-compat  clucene  des  easing  harfbuzz  javascriptcore md4   md5  s60  sha1  webkit  xorg  zlib_dependency.pri
   302     (cd src/3rdparty && rm -rf [^cdehjmswxz]* sql* win* zlib zlib.pri) || exit $?
   304     #   detect which platform for which to build
   305     case "%{l_platform -t}" in
   306         sun4[uv]-sunos* | amd64-sunos*  ) platcomp="solaris-g++-64" ;;
   307         i?86-sunos*                     ) platcomp="solaris-g++"    ;;
   308         amd64-linux*                    ) platcomp="linux-g++-64"   ;;
   309         i?86-linux*                     ) platcomp="linux-g++"      ;;
   310         amd64-freebsd* | i?86-freebsd*  ) platcomp="freebsd-g++"    ;;
   311         *-aix*                          ) platcomp="aix-g++"        ;;
   312         *-darwin*                       ) platcomp="macx-g++"       ;;
   313         *-hpux*                         ) platcomp="hpux-g++"       ;;
   314         *-irix*                         ) platcomp="irix-g++"       ;;
   315         *                               ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;;
   316     esac
   318     #   detect which architecture extensions are available
   319     archflags=''
   320     case "%{l_platform -t}" in
   321         amd64-* )
   322             break
   323             ;;
   324         * )
   325             archflags='-no-sse2 -no-3dnow'
   326             ;;
   327     esac
   329 %if "%{with_shared}" == "yes"
   330     #   optional shared build (precedes mandatory static build)
   331     echo 'yes' | ./configure \
   332         $archflags \
   333         -opensource \
   334         -prefix %{l_prefix} \
   335         -bindir %{l_prefix}/bin \
   336         -libdir %{l_prefix}/lib/qt/dynamic \
   337         -docdir %{l_prefix}/share/qt/doc \
   338         -headerdir %{l_prefix}/include \
   339         -plugindir %{l_prefix}/lib/qt/plugins \
   340         -datadir %{l_prefix}/share/qt \
   341         -translationdir %{l_prefix}/share/qt/translations \
   342         -sysconfdir %{l_prefix}/etc/qt \
   343         -examplesdir %{l_prefix}/share/qt/examples \
   344         -demosdir %{l_prefix}/share/qt/demos \
   345 %if 0
   346     #   Build time Qt definitions should predominate,
   347     #   otherwise foreign definitions cause errors like:
   348     #
   349     #   g++ -c -I/foreign/include [...] animation/qguivariantanimation.cpp
   350     #   .moc/release-shared/moc_qnamespace.cpp:426:16: error: 'WA_LockPortraitOrientation' is not a member of 'Qt'
   351     #   .moc/release-shared/moc_qnamespace.cpp:427:16: error: 'WA_LockLandscapeOrientation' is not a member of 'Qt'
   352     #   .moc/release-shared/moc_qnamespace.cpp:428:16: error: 'WA_AutoOrientation' is not a member of 'Qt'
   353     #   .moc/release-shared/moc_qnamespace.cpp:440:16: error: 'AA_S60DisablePartialScreenInputMode' is not a member of 'Qt'
   354     #
   355     #   Other problems include flawed definitions polluting (C|CXX)FLAGS
   356     #   and overriding the correct definitions in CPPFLAGS. Variables
   357     #   like QMAKE_(C|CXX)FLAGS exhibit this problem as well.
   358     #
   359     #   The work around is to force a Qt dist include path in (C|CXX)FLAGS.
   360 %endif
   361         -I$RPM_BUILD_DIR/qt-everywhere-opensource-src-%{version}/include \
   362         -release \
   363         -shared \
   364         -platform $platcomp \
   365         -s60 \
   366         -qt-style-s60 \
   367         -no-sql-ibase \
   368 %if "%{with_glib}" == "yes"
   369         -glib \
   370 %else
   371         -no-glib \
   372 %endif
   373 %if "%{with_mysql}" == "yes"
   374         -qt-sql-mysql \
   375         -plugin-sql-mysql \
   376 %else
   377         -no-sql-mysql \
   378 %endif
   379 %if "%{with_pgsql}" == "yes"
   380         -qt-sql-psql \
   381         -plugin-sql-psql \
   382 %else
   383         -no-sql-psql \
   384 %endif
   385         -no-sql-odbc \
   386         -system-sqlite \
   387         -qt-sql-sqlite \
   388         -plugin-sql-sqlite \
   389         -no-sql-sqlite2 \
   390         -openssl-linked \
   391         -optimized-qmake \
   392         -xmlpatterns \
   393         -svg \
   394         -webkit \
   395         -system-zlib \
   396         -qt-gif \
   397         -system-libpng \
   398         -system-libmng \
   399         -system-libjpeg \
   400         -system-libtiff \
   401         -rpath \
   402         -no-cups \
   403         -iconv \
   404         -pch \
   405         -dbus-linked \
   406         -opengl \
   407         -xrender \
   408         -fontconfig \
   409         -freetype
   411     #   default options are implicitly used, for example...
   412     #-no-fast -exceptions -accessibility -stl -qt3support -nis
   413     #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
   415     #   carry out shared build procedure
   416     ( cd src
   417       %{l_make} %{l_mflags -O} \
   418           sub-moc sub-rcc sub-uic sub-uic3
   419     ) || exit $?
   420     %{l_make} %{l_mflags -O} \
   421         sub-corelib-make_default-ordered \
   422         sub-xml-make_default-ordered \
   423         sub-network-make_default-ordered \
   424         sub-sql-make_default-ordered \
   425         sub-testlib-make_default-ordered \
   426         sub-dbus-make_default-ordered \
   427         sub-gui-make_default-ordered \
   428         sub-qt3support-make_default-ordered \
   429         sub-opengl-make_default-ordered \
   430         sub-xmlpatterns-make_default-ordered \
   431         sub-multimedia-make_default-ordered \
   432         sub-svg-make_default-ordered \
   433         sub-script-make_default-ordered \
   434         sub-declarative-make_default-ordered \
   435         sub-javascriptcore-make_default-ordered \
   436         sub-webkit-make_default-ordered \
   437         sub-scripttools-make_default-ordered \
   438         sub-plugins-make_default-ordered \
   439         sub-imports-make_default-ordered \
   440         sub-webkitdeclarative-make_default-ordered \
   441         sub-translations-make_default-ordered
   443     #   arthur plugin requires libQtDesigner
   444     ( cd demos
   445       ( cd ../tools/designer/src/lib
   446         %{l_make} %{l_mflags -O}
   447       ) || exit $?
   448       %{l_make} %{l_mflags -O} sub-arthurplugin
   449     ) || exit $?
   451     #   cache shared libs and initialize the build configuration, which
   452     #   would otherwise still contain references to our shared libs build
   453     %{l_shtool} mkdir -f -p -m 755 sharbuild/dynamic
   454     mv lib/* sharbuild/dynamic/
   455     mv plugins sharbuild/
   456     %{l_make} %{l_mflags} confclean
   457 %endif
   459     #   mandatory static build (follows optional shared build)
   460     echo 'yes' | ./configure \
   461         $archflags \
   462         -opensource \
   463         -prefix %{l_prefix} \
   464         -bindir %{l_prefix}/bin \
   465         -libdir %{l_prefix}/lib \
   466         -docdir %{l_prefix}/share/qt/doc \
   467         -headerdir %{l_prefix}/include \
   468         -plugindir %{l_prefix}/lib/qt/plugins \
   469         -datadir %{l_prefix}/share/qt \
   470         -translationdir %{l_prefix}/share/qt/translations \
   471         -sysconfdir %{l_prefix}/etc/qt \
   472         -examplesdir %{l_prefix}/share/qt/examples \
   473         -demosdir %{l_prefix}/share/qt/demos \
   474 %if 0
   475     #   Build time Qt definitions should predominate,
   476     #   otherwise foreign definitions cause errors like:
   477     #
   478     #   g++ -c -I/foreign/include [...] animation/qguivariantanimation.cpp
   479     #   .moc/release-shared/moc_qnamespace.cpp:426:16: error: 'WA_LockPortraitOrientation' is not a member of 'Qt'
   480     #   .moc/release-shared/moc_qnamespace.cpp:427:16: error: 'WA_LockLandscapeOrientation' is not a member of 'Qt'
   481     #   .moc/release-shared/moc_qnamespace.cpp:428:16: error: 'WA_AutoOrientation' is not a member of 'Qt'
   482     #   .moc/release-shared/moc_qnamespace.cpp:440:16: error: 'AA_S60DisablePartialScreenInputMode' is not a member of 'Qt'
   483     #
   484     #   Other problems include flawed definitions polluting (C|CXX)FLAGS
   485     #   and overriding the correct definitions in CPPFLAGS. Variables
   486     #   like QMAKE_(C|CXX)FLAGS exhibit this problem as well.
   487     #
   488     #   The work around is to force a Qt dist include path in (C|CXX)FLAGS.
   489 %endif
   490         -I$RPM_BUILD_DIR/qt-everywhere-opensource-src-%{version}/include \
   491         -release \
   492         -static \
   493         -platform $platcomp \
   494         -s60 \
   495         -qt-style-s60 \
   496         -no-sql-ibase \
   497 %if "%{with_glib}" == "yes"
   498         -glib \
   499 %else
   500         -no-glib \
   501 %endif
   502 %if "%{with_mysql}" == "yes"
   503         -qt-sql-mysql \
   504 %else
   505         -no-sql-mysql \
   506 %endif
   507 %if "%{with_pgsql}" == "yes"
   508         -qt-sql-psql \
   509 %else
   510         -no-sql-psql \
   511 %endif
   512         -no-sql-odbc \
   513         -system-sqlite \
   514         -qt-sql-sqlite \
   515         -no-sql-sqlite2 \
   516         -openssl-linked \
   517         -optimized-qmake \
   518         -xmlpatterns \
   519         -svg \
   520         -webkit \
   521         -system-zlib \
   522         -qt-gif \
   523         -system-libpng \
   524         -system-libmng \
   525         -system-libjpeg \
   526         -system-libtiff \
   527         -rpath \
   528         -no-cups \
   529         -iconv \
   530         -pch \
   531         -dbus-linked \
   532         -opengl \
   533         -xrender \
   534         -fontconfig \
   535         -freetype
   537     #   default options are implicitly used, for example...
   538     #-no-fast -exceptions -accessibility -stl -qt3support -nis
   539     #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
   541     #   carry out static build procedure
   542     %{l_make} %{l_mflags -O} sub-src
   543 %if "%{with_tools}" == "yes"
   544     %{l_make} %{l_mflags -O} \
   545       sub-tools-make_default-ordered sub-translations-make_default-ordered
   546 %endif
   547 %if "%{with_examples}" == "yes"
   548     %{l_make} %{l_mflags -O} \
   549         sub-demos-make_default-ordered \
   550         sub-examples-make_default-ordered
   551 %endif
   552 %if "%{with_tools}" == "yes"
   553     %{l_make} %{l_mflags -O} docs
   554 %else
   555 %if "%{with_examples}" == "yes"
   556     %{l_make} %{l_mflags -O} docs
   557 %endif
   558 %endif
   560 %install
   561     rm -rf $RPM_BUILD_ROOT
   563     #   carry out installation procedure
   564     targets="sub-tools-bootstrap-install_subtargets-ordered \
   565             sub-moc-install_subtargets-ordered \
   566             sub-rcc-install_subtargets-ordered \
   567             sub-uic-install_subtargets-ordered \
   568             sub-corelib-install_subtargets-ordered \
   569             sub-xml-install_subtargets-ordered \
   570             sub-network-install_subtargets-ordered \
   571             sub-sql-install_subtargets-ordered \
   572             sub-testlib-install_subtargets-ordered \
   573             sub-dbus-install_subtargets-ordered \
   574             sub-gui-install_subtargets-ordered \
   575             sub-qt3support-install_subtargets-ordered \
   576             sub-uic3-install_subtargets-ordered \
   577             sub-opengl-install_subtargets-ordered \
   578             sub-xmlpatterns-install_subtargets-ordered \
   579             sub-multimedia-install_subtargets-ordered \
   580             sub-svg-install_subtargets-ordered \
   581             sub-script-install_subtargets-ordered \
   582             sub-declarative-install_subtargets-ordered \
   583             sub-scripttools-install_subtargets-ordered \
   584             sub-imports-install_subtargets-ordered \
   585             sub-translations-install_subtargets-ordered"
   587 %if "%{with_tools}" == "yes"
   588     targets="$targets sub-tools-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
   589 %endif
   590 %if "%{with_examples}" == "yes"
   591     targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
   592 %endif
   593     targets="$targets install_qmake install_mkspecs"
   594     %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT"
   595     %{l_shtool} install -c -m 644 \
   596         lib/libjscore.a lib/libjscore.prl \
   597         $RPM_BUILD_ROOT%{l_prefix}/lib/
   599     #   correct paths in pkg-config(1) configuration files
   600     %{l_shtool} subst \
   601         -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};g" \
   602         $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/*
   604     #   install static or shared plugins according to user choice
   605 %if "%{with_shared}" != "yes"
   606     %{l_make} %{l_mflags} sub-plugins-install_subtargets-ordered INSTALL_ROOT="$RPM_BUILD_ROOT"
   607 %else
   608     %{l_tar} cf - -C sharbuild plugins | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   609 %endif
   611 %if "%{with_shared}" == "yes"
   612     #   install shared libs and symlinks
   613     %{l_shtool} mkdir -f -p -m 755 \
   614         $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   615     %{l_tar} cf - -C sharbuild dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   617     #   offer limited support of pkg-config(1) for shared libs
   618     #   substitution unfortunately only handles paths with no whitespace
   619     %{l_shtool} subst \
   620         -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L%{l_prefix}/lib/qt/dynamic;g" \
   621         -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};g" \
   622         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/*
   624     #   explain nonstandard shared library placement
   625     ( echo "This OpenPKG Qt build is using the with_shared option."
   626       echo ""
   627       echo "The directory %{l_prefix}/lib/qt/dynamic contains the"
   628       echo "requested shared libraries. Although shared libraries"
   629       echo "have been optionally built (see the build time"
   630       echo "'with_shared yes' option), static libraries were"
   631       echo "built by default as usual, and installed in the"
   632       echo "standard library directory %{l_prefix}/lib."
   633       echo ""
   634       echo "To build applications using shared libraries instead,"
   635       echo "please direct pkg-config(1) to use the proper definitions"
   636       echo "by setting the environment variable PKG_CONFIG_PATH to "
   637       echo "%{l_prefix}/lib/qt/dynamic/pkgconfig."
   638       echo ""
   639       echo "Note: If building via qmake(1), please append"
   640       echo "      either 'static' or 'shared' to the line"
   641       echo "      'CONFIG +=' in the project file (name.pro)."
   642       echo "      Then execute %{l_prefix}/bin/qmake on this file."
   643     ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README
   644 %endif
   646     #   correct temporary runtime link paths (static libs)
   647     %{l_shtool} subst \
   648         -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \
   649         -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}\(/[^\t ][^\t ]*\);-L\1%{l_prefix}\2;g" \
   650         $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl \
   651         $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
   652 %if "%{with_shared}" == "yes"
   653     #   correct temporary runtime link paths (dynamic libs)
   654     %{l_shtool} subst \
   655         -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \
   656         -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L\1%{l_prefix}/lib/qt/dynamic;g" \
   657         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \
   658         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la
   659 %endif
   661 ## Doesn't work as expected, because RPM reads the --[in|ex]cludedocs
   662 ## argument only when installing binary packages, rather than building.
   663 #%define  _excludedocs 0
   664 #%define  _includedocs 1
   665 #    echo %{_excludedocs}
   666 #    echo %{_includedocs}
   667 #
   668 ## Doesn't work as expected, because it seems that OpenPKG too mercilessly
   669 ## removes RPM reading of the %docdir keyword in rpm.patch.feature.
   670 #    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   671 #        %{l_files_std} \
   672 #        '%docdir %{l_prefix}/share/pkg/doc'
   673 #
   674 ## Doesn't work as expected, because the rpmtool(1) marks
   675 ## only einzeln files as documents, skipping directories
   676 #    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   677 #        %{l_files_std} \
   678 #        '%doc %{l_prefix}/share/pkg/doc/doc.txt'
   679 #
   680     #   determine internal file listing
   681     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   682         %{l_files_std} \
   683         '%not %dir %{l_prefix}/lib/pkgconfig'
   685 %files -f files
   687 %clean
   688     rm -rf $RPM_BUILD_ROOT

mercurial