qt/qt.spec

Sat, 23 Oct 2010 01:34:51 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 23 Oct 2010 01:34:51 +0200
changeset 288
74a0826c1949
parent 266
00db87db5e04
child 289
1ff6f25dc4d9
permissions
-rw-r--r--

Correct javascript core and mysql with ssl buildconf, add glib option.

     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.0
    43 Release:      20101018
    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     loclibs=''
   116     case "%{l_platform -t}" in
   117         *-sunos* )
   118             loclibs='-lsocket -lnsl'
   119             ;;
   120     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     #     QT_CFLAGS_SQLITE
   147     #     QT_CFLAGS_DBUS
   148     #     QT_CFLAGS_GLIB ***Special case, see following substitution block
   149     #     QT_CFLAGS_GSTREAMER
   150     #     QT_CFLAGS_ICD
   151     #     QT_CFLAGS_QTNETWORK
   152     #     QT_CFLAGS_PULSEAUDIO
   153     #     QT_CFLAGS_FONTCONFIG
   154     #     QT_CFLAGS_QGTKSTYLE
   155     #     QT_CFLAGS_DIRECTFB
   156     %{l_shtool} subst \
   157         -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \
   158         -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \
   159         configure
   160     #   hack to get back the standard '--cflags' of just Qt_CFLAGS_GLIB
   161     %{l_shtool} subst \
   162         -e 's;\(QT_CFLAGS_GLIB *=.*PKG_CONFIG.*\) --cflags-only-other ;\1 --cflags ;g' \
   163         configure
   164     %{l_shtool} subst \
   165         -e 's;\(TRY_INCLUDEPATHS = \).*\(\$\$INCLUDEPATH\);\1\2;' \
   166         -e 's;/freetype2;/freetype;' \
   167         config.tests/unix/freetype/freetype.pri
   168     %{l_shtool} subst \
   169         -e "s;\(LIBS.*=.*-lmng\);\1 $lcmslibs;" \
   170         src/gui/image/qmnghandler.pri
   171     %{l_shtool} subst \
   172         -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconflibs;" \
   173         config.tests/x11/fontconfig/fontconfig.pro
   174     echo 'INCLUDEPATH += /usr/include/wacomcfg' \
   175         >>src/gui/kernel/x11.pri
   176     echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \
   177         >>src/gui/kernel/x11.pri
   178     echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \
   179         >>src/gui/text/text.pri
   180     echo "INCLUDEPATH = `%{l_prefix}/bin/pkg-config --cflags-only-I dbus-1 | %{l_shtool} subst -e 's;\-I;;g'`" \
   181         >>config.tests/unix/dbus/dbus.pro
   182     echo "LIBS = `%{l_prefix}/bin/pkg-config --libs-only-l --static dbus-1`" \
   183         >>config.tests/unix/dbus/dbus.pro
   184     %{l_shtool} subst \
   185         -e "s;\(LIBS.*= -lpq\);\1 `%{l_prefix}/bin/pg_config --libs` $loclibs;" \
   186         config.tests/unix/psql/psql.pro
   187     %{l_shtool} subst \
   188         -e 's;^mac[^:][^:]*:\(LIBS\);\1;' \
   189         config.tests/unix/iconv/iconv.pro
   190     uiclibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig lcms`
   191     %{l_shtool} subst \
   192         -e 's;LIBS .*= -lpq$;LIBS += -lpq -lssl -lcrypto;' \
   193         -e "s;LIBS .*= \$\$QT_LFLAGS_MYSQL;LIBS += $mysqllibs;" \
   194         src/sql/drivers/drivers.pri
   195     %{l_shtool} subst \
   196         -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" \
   197         src/corelib/kernel/kernel.pri \
   198         src/gui/kernel/kernel.pri
   199     %{l_shtool} subst \
   200         -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_PSQL;INCPATH += `pg_config --includedir 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \
   201         -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_MYSQL;INCPATH += `mysql_config --include 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \
   202         -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" \
   203         -e 's;!static:\(!isEmpty(QT_LFLAGS_PSQL)\);\1;' \
   204         -e 's;!static:\(LIBS \*= \$\$QT_LFLAGS_PSQL\);\1;' \
   205         src/plugins/sqldrivers/mysql/mysql.pro \
   206         src/plugins/sqldrivers/psql/psql.pro \
   207         src/plugins/sqldrivers/sqlite/sqlite.pro \
   208         src/sql/drivers/drivers.pri
   209     %{l_shtool} subst \
   210         -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" \
   211         src/dbus/dbus.pro
   212     %{l_shtool} subst \
   213         -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \
   214         -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1;' \
   215         -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \
   216         -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2;" \
   217         -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \
   218         mkspecs/qws/*/qmake.conf \
   219         mkspecs/*/*.conf
   220     %{l_shtool} subst \
   221         -e 's;^\(QMAKE_LIBS +=.*\);\1 -liconv;' \
   222         src/corelib/corelib.pro
   223     %{l_shtool} subst \
   224         -e 's;\(DESTDIR *=\) *\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;' \
   225         src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro
   226     %{l_shtool} subst \
   227         -e 's;\(pathToJavaScriptCoreOutput *=\) *\$\$ARGS/\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;g' \
   228         src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
   229     %{l_shtool} subst \
   230         -e "s;^\(QMAKE_INCDIR_X11[^=]*=\).*;\1 %{l_prefix}/include $x11_incdir;" \
   231         -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\).*;\1 %{l_prefix}/lib $x11_libdir;" \
   232         mkspecs/qws/solaris*/qmake.conf \
   233         mkspecs/solaris*/qmake.conf
   234     echo "QMAKE_LIBDIR += %{l_prefix}/lib/qt/dynamic" \
   235         >>mkspecs/features/shared.prf
   236     %{l_shtool} subst \
   237         -e 's; *\.\./3rdparty/freetype/.*;;g' \
   238         -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \
   239         src/gui/text/text.pri
   240     %{l_shtool} subst \
   241         -e 's;\(#include  *"\)\(tiffio.h"\);\1tiff/\2;' \
   242         src/gui/image/qtiffhandler.cpp
   243     %{l_shtool} subst \
   244         -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \
   245         tools/qtconfig/qtconfig.pro
   246     %{l_shtool} subst \
   247         -e 's;webkit;web-broken-kit;g' \
   248         tools/assistant/tools/assistant/assistant.pro
   249     echo "DEFINES += QT_NO_WEBKIT" \
   250         >>tools/assistant/tools/assistant/assistant.pro
   251     %{l_shtool} subst \
   252         -e "s;Qt.s Classes;All Classes;" \
   253         tools/assistant/tools/assistant/doc/assistant.qdoc \
   254         tools/qdoc3/doc/qdoc-manual.qdoc \
   255         tools/qdoc3/doc/files/qt.qdocconf \
   256         tools/qdoc3/test/qt-build-docs.qdocconf \
   257         tools/qdoc3/test/qt.qdocconf
   259 %build
   260     #   protect against sloppy code inclusion of all unused subprojects
   261     (cd src/3rdparty && rm -rf [^cdehjmswxz]* sql* win* zlib zlib.pri) || exit $?
   263     #   detect which platform for which to build
   264     case "%{l_platform -t}" in
   265         sun4[uv]-sunos* | amd64-sunos*  ) platcomp="solaris-g++-64" ;;
   266         i?86-sunos*                     ) platcomp="solaris-g++"    ;;
   267         amd64-linux*                    ) platcomp="linux-g++-64"   ;;
   268         i?86-linux*                     ) platcomp="linux-g++"      ;;
   269         amd64-freebsd* | i?86-freebsd*  ) platcomp="freebsd-g++"    ;;
   270         *-aix*                          ) platcomp="aix-g++"        ;;
   271         *-darwin*                       ) platcomp="macx-g++"       ;;
   272         *-hpux*                         ) platcomp="hpux-g++"       ;;
   273         *-irix*                         ) platcomp="irix-g++"       ;;
   274         *                               ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;;
   275     esac
   277     #   detect which architecture extensions are available
   278     archflags=''
   279     case "%{l_platform -t}" in
   280         amd64-* )
   281             break
   282             ;;
   283         * )
   284             archflags='-no-sse2 -no-3dnow'
   285             ;;
   286     esac
   288 %if "%{with_shared}" == "yes"
   289     #   optional shared build (precedes mandatory static build)
   290     echo 'yes' | ./configure \
   291         $archflags \
   292         -opensource \
   293         -prefix %{l_prefix} \
   294         -bindir %{l_prefix}/bin \
   295         -libdir %{l_prefix}/lib/qt/dynamic \
   296         -docdir %{l_prefix}/share/qt/doc \
   297         -headerdir %{l_prefix}/include \
   298         -plugindir %{l_prefix}/lib/qt/plugins \
   299         -datadir %{l_prefix}/share/qt \
   300         -translationdir %{l_prefix}/share/qt/translations \
   301         -sysconfdir %{l_prefix}/etc/qt \
   302         -examplesdir %{l_prefix}/share/qt/examples \
   303         -demosdir %{l_prefix}/share/qt/demos \
   304         -release \
   305         -shared \
   306         -platform $platcomp \
   307         -no-sql-ibase \
   308 %if "%{with_glib}" == "yes"
   309         -glib \
   310 %else
   311         -no-glib \
   312 %endif
   313 %if "%{with_mysql}" == "yes"
   314         -qt-sql-mysql \
   315         -plugin-sql-mysql \
   316 %else
   317         -no-sql-mysql \
   318 %endif
   319 %if "%{with_pgsql}" == "yes"
   320         -qt-sql-psql \
   321         -plugin-sql-psql \
   322 %else
   323         -no-sql-psql \
   324 %endif
   325         -no-sql-odbc \
   326         -system-sqlite \
   327         -qt-sql-sqlite \
   328         -plugin-sql-sqlite \
   329         -no-sql-sqlite2 \
   330         -openssl-linked \
   331         -optimized-qmake \
   332         -xmlpatterns \
   333         -svg \
   334         -webkit \
   335         -system-zlib \
   336         -qt-gif \
   337         -system-libpng \
   338         -system-libmng \
   339         -system-libjpeg \
   340         -system-libtiff \
   341         -rpath \
   342         -no-cups \
   343         -iconv \
   344         -pch \
   345         -dbus-linked \
   346         -opengl \
   347         -xrender \
   348         -fontconfig \
   349         -freetype
   351     #   default options are implicitly used, for example...
   352     #-no-fast -exceptions -accessibility -stl -qt3support -nis
   353     #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
   355     #   carry out shared build procedure
   356     ( cd src
   357       %{l_make} %{l_mflags -O} \
   358           sub-moc sub-rcc sub-uic sub-uic3
   359     ) || exit $?
   360     %{l_make} %{l_mflags -O} \
   361         sub-corelib-make_default-ordered \
   362         sub-xml-make_default-ordered \
   363         sub-network-make_default-ordered \
   364         sub-sql-make_default-ordered \
   365         sub-testlib-make_default-ordered \
   366         sub-dbus-make_default-ordered \
   367         sub-gui-make_default-ordered \
   368         sub-qt3support-make_default-ordered \
   369         sub-opengl-make_default-ordered \
   370         sub-xmlpatterns-make_default-ordered \
   371         sub-multimedia-make_default-ordered \
   372         sub-svg-make_default-ordered \
   373         sub-script-make_default-ordered \
   374         sub-declarative-make_default-ordered \
   375         sub-javascriptcore-make_default-ordered \
   376         sub-webkit-make_default-ordered \
   377         sub-scripttools-make_default-ordered \
   378         sub-plugins-make_default-ordered \
   379         sub-imports-make_default-ordered \
   380         sub-webkitdeclarative-make_default-ordered \
   381         sub-translations-make_default-ordered
   383     #   arthur plugin requires libQtDesigner
   384     ( cd demos
   385       ( cd ../tools/designer/src/lib
   386         %{l_make} %{l_mflags -O}
   387       ) || exit $?
   388       %{l_make} %{l_mflags -O} sub-arthurplugin
   389     ) || exit $?
   391     #   cache shared libs and initialize the build configuration, which
   392     #   would otherwise still contain references to our shared libs build
   393     %{l_shtool} mkdir -f -p -m 755 sharbuild/dynamic
   394     mv lib/* sharbuild/dynamic/
   395     mv plugins sharbuild/
   396     %{l_make} %{l_mflags} confclean
   397 %endif
   399     #   mandatory static build (follows optional shared build)
   400     echo 'yes' | ./configure \
   401         $archflags \
   402         -opensource \
   403         -prefix %{l_prefix} \
   404         -bindir %{l_prefix}/bin \
   405         -libdir %{l_prefix}/lib \
   406         -docdir %{l_prefix}/share/qt/doc \
   407         -headerdir %{l_prefix}/include \
   408         -plugindir %{l_prefix}/lib/qt/plugins \
   409         -datadir %{l_prefix}/share/qt \
   410         -translationdir %{l_prefix}/share/qt/translations \
   411         -sysconfdir %{l_prefix}/etc/qt \
   412         -examplesdir %{l_prefix}/share/qt/examples \
   413         -demosdir %{l_prefix}/share/qt/demos \
   414         -release \
   415         -static \
   416         -platform $platcomp \
   417         -no-sql-ibase \
   418 %if "%{with_glib}" == "yes"
   419         -glib \
   420 %else
   421         -no-glib \
   422 %endif
   423 %if "%{with_mysql}" == "yes"
   424         -qt-sql-mysql \
   425 %else
   426         -no-sql-mysql \
   427 %endif
   428 %if "%{with_pgsql}" == "yes"
   429         -qt-sql-psql \
   430 %else
   431         -no-sql-psql \
   432 %endif
   433         -no-sql-odbc \
   434         -system-sqlite \
   435         -qt-sql-sqlite \
   436         -no-sql-sqlite2 \
   437         -openssl-linked \
   438         -optimized-qmake \
   439         -xmlpatterns \
   440         -svg \
   441         -webkit \
   442         -system-zlib \
   443         -qt-gif \
   444         -system-libpng \
   445         -system-libmng \
   446         -system-libjpeg \
   447         -system-libtiff \
   448         -rpath \
   449         -no-cups \
   450         -iconv \
   451         -pch \
   452         -dbus-linked \
   453         -opengl \
   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 static build procedure
   463     %{l_make} %{l_mflags -O} sub-src
   464 %if "%{with_tools}" == "yes"
   465     %{l_make} %{l_mflags -O} \
   466       sub-tools-make_default-ordered sub-translations-make_default-ordered
   467 %endif
   468 %if "%{with_examples}" == "yes"
   469     %{l_make} %{l_mflags -O} \
   470         sub-demos-make_default-ordered \
   471         sub-examples-make_default-ordered
   472 %endif
   473 %if "%{with_tools}" == "yes"
   474     %{l_make} %{l_mflags -O} docs
   475 %else
   476 %if "%{with_examples}" == "yes"
   477     %{l_make} %{l_mflags -O} docs
   478 %endif
   479 %endif
   481 %install
   482     rm -rf $RPM_BUILD_ROOT
   484     #   carry out installation procedure
   485     targets="sub-tools-bootstrap-install_subtargets-ordered \
   486             sub-moc-install_subtargets-ordered \
   487             sub-rcc-install_subtargets-ordered \
   488             sub-uic-install_subtargets-ordered \
   489             sub-corelib-install_subtargets-ordered \
   490             sub-xml-install_subtargets-ordered \
   491             sub-network-install_subtargets-ordered \
   492             sub-sql-install_subtargets-ordered \
   493             sub-testlib-install_subtargets-ordered \
   494             sub-dbus-install_subtargets-ordered \
   495             sub-gui-install_subtargets-ordered \
   496             sub-qt3support-install_subtargets-ordered \
   497             sub-uic3-install_subtargets-ordered \
   498             sub-opengl-install_subtargets-ordered \
   499             sub-xmlpatterns-install_subtargets-ordered \
   500             sub-multimedia-install_subtargets-ordered \
   501             sub-svg-install_subtargets-ordered \
   502             sub-script-install_subtargets-ordered \
   503             sub-declarative-install_subtargets-ordered \
   504             sub-scripttools-install_subtargets-ordered \
   505             sub-imports-install_subtargets-ordered \
   506             sub-translations-install_subtargets-ordered"
   508 %if "%{with_tools}" == "yes"
   509     targets="$targets sub-tools-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
   510 %endif
   511 %if "%{with_examples}" == "yes"
   512     targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
   513 %endif
   514     targets="$targets install_qmake install_mkspecs"
   515     %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT"
   516     %{l_shtool} install -c -m 644 \
   517         lib/libjscore.a lib/libjscore.prl \
   518         $RPM_BUILD_ROOT%{l_prefix}/lib/
   520     #   correct paths in pkg-config(1) configuration files
   521     %{l_shtool} subst \
   522         -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};g" \
   523         $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/*
   525     #   install static or shared plugins according to user choice
   526 %if "%{with_shared}" != "yes"
   527     %{l_make} %{l_mflags} sub-plugins-install_subtargets-ordered INSTALL_ROOT="$RPM_BUILD_ROOT"
   528 %else
   529     %{l_tar} cf - -C sharbuild plugins | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   530 %endif
   532 %if "%{with_shared}" == "yes"
   533     #   install shared libs and symlinks
   534     %{l_shtool} mkdir -f -p -m 755 \
   535         $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   536     %{l_tar} cf - -C sharbuild dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   538     #   offer limited support of pkg-config(1) for shared libs
   539     #   substitution unfortunately only handles paths with no whitespace
   540     %{l_shtool} subst \
   541         -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L%{l_prefix}/lib/qt/dynamic;g" \
   542         -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};g" \
   543         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/*
   545     #   explain nonstandard shared library placement
   546     ( echo "This OpenPKG Qt build is using the with_shared option."
   547       echo ""
   548       echo "The directory %{l_prefix}/lib/qt/dynamic contains the"
   549       echo "requested shared libraries. Although shared libraries"
   550       echo "have been optionally built (see the build time"
   551       echo "'with_shared yes' option), static libraries were"
   552       echo "built by default as usual, and installed in the"
   553       echo "standard library directory %{l_prefix}/lib."
   554       echo ""
   555       echo "To build applications using shared libraries instead,"
   556       echo "please direct pkg-config(1) to use the proper definitions"
   557       echo "by setting the environment variable PKG_CONFIG_PATH to "
   558       echo "%{l_prefix}/lib/qt/dynamic/pkgconfig."
   559       echo ""
   560       echo "Note: If building via qmake(1), please append"
   561       echo "      either 'static' or 'shared' to the line"
   562       echo "      'CONFIG +=' in the project file (name.pro)."
   563       echo "      Then execute %{l_prefix}/bin/qmake on this file."
   564     ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README
   565 %endif
   567     #   correct temporary runtime link paths (static libs)
   568     %{l_shtool} subst \
   569         -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \
   570         -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}\(/[^\t ][^\t ]*\);-L\1%{l_prefix}\2;g" \
   571         $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl \
   572         $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
   573 %if "%{with_shared}" == "yes"
   574     #   correct temporary runtime link paths (dynamic libs)
   575     %{l_shtool} subst \
   576         -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \
   577         -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L\1%{l_prefix}/lib/qt/dynamic;g" \
   578         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \
   579         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la
   580 %endif
   582 ## Doesn't work as expected, because RPM reads the --[in|ex]cludedocs
   583 ## argument only when installing binary packages, rather than building.
   584 #%define  _excludedocs 0
   585 #%define  _includedocs 1
   586 #    echo %{_excludedocs}
   587 #    echo %{_includedocs}
   588 #
   589 ## Doesn't work as expected, because it seems that OpenPKG too mercilessly
   590 ## removes RPM readi1ng of the %docdir keyword in rpm.patch.feature.
   591 #    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   592 #        %{l_files_std} \
   593 #        '%docdir %{l_prefix}/share/pkg/doc'
   594 #
   595 ## Doesn't work as expected, because the rpmtool(1) marks
   596 ## only einzeln files as documents, skipping directories
   597 #    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   598 #        %{l_files_std} \
   599 #        '%doc %{l_prefix}/share/pkg/doc/doc.txt'
   600 #
   601     #   determine internal file listing
   602     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   603         %{l_files_std} \
   604         '%not %dir %{l_prefix}/lib/pkgconfig'
   606 %files -f files
   608 %clean
   609     rm -rf $RPM_BUILD_ROOT

mercurial