qt/qt.spec

Sat, 23 Oct 2010 01:42:25 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 23 Oct 2010 01:42:25 +0200
changeset 289
1ff6f25dc4d9
parent 288
74a0826c1949
child 340
870131689a5c
permissions
-rw-r--r--

Remove unintended nonproduction comment text.

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

mercurial