qt/qt.spec

Tue, 22 Sep 2009 11:08:04 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 22 Sep 2009 11:08:04 +0200
changeset 213
117704011216
parent 206
3309487768d4
child 215
6f5a2a90bb46
permissions
-rw-r--r--

Correct XInput tablet build logic.

     1 ##
     2 ##  qt.spec -- OpenPKG RPM Specification
     3 ##  Copyright (c) 2009 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.
    31 #   FIXME: MSvB:
    32 #   FIXME: MSvB: GNU iconv integration is flawed in Qt 4.5.2, and
    33 #   FIXME: MSvB: has been disabled in this build until a new release
    34 #   FIXME: MSvB: corrects the problem.
    36 #   package information
    37 Name:         qt
    38 Summary:      Cross Platform Application Framework
    39 URL:          http://www.trolltech.com/products/qt/
    40 Vendor:       Nokia Corporation
    41 Packager:     Michael Schloh von Bennewitz
    42 Distribution: MSvB Recherche Production
    43 Class:        EVAL
    44 Group:        Development
    45 License:      GPL
    46 Version:      4.5.2
    47 Release:      20090718
    49 #   build options
    50 %option       with_tools     yes
    51 %option       with_mysql     no
    52 %option       with_pgsql     no
    53 %option       with_shared    no
    54 %option       with_examples  no
    56 #   list of sources
    57 Source0:      ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-%{version}.tar.gz
    59 #   build information
    60 Prefix:       %{l_prefix}
    61 BuildRoot:    %{l_buildroot}
    62 BuildPreReq:  OpenPKG, openpkg >= 20050726, make, gcc, pkgconfig
    63 PreReq:       OpenPKG, openpkg >= 20050726
    64 BuildPreReq:  X11, png, mng, jpeg, tiff, mesa, xrender
    65 PreReq:       X11, png, mng, jpeg, tiff, mesa, xrender
    66 BuildPreReq:  openssl, zlib, libiconv, sqlite, dbus
    67 PreReq:       openssl, zlib, libiconv, sqlite, dbus
    68 BuildPreReq:  fontconfig, freetype
    69 PreReq:       fontconfig, freetype
    70 %if "%{with_mysql}" == "yes"
    71 BuildPreReq:  mysql
    72 PreReq:       mysql
    73 %endif
    74 %if "%{with_pgsql}" == "yes"
    75 BuildPreReq:  postgresql
    76 PreReq:       postgresql
    77 %endif
    78 AutoReq:      no
    79 AutoReqProv:  no
    80 Provides:     QTSDK
    82 %description
    83     Qt is a comprehensive C++ framework for cross-platform application
    84     development. Using Qt, you can develop applications and user
    85     interfaces once, and deploy them across many desktop and embedded
    86     operating systems without rewriting the source code. This package
    87     distribution builds all modules of the Qt/X11 Open Source Edition.
    89 %track
    90     prog qt = {
    91         version   = %{version}
    92         url       = ftp://ftp.trolltech.com/qt/source/
    93         regex     = qt-x11-opensource-src-(__VER__)\.tar\.gz
    94     }
    96 %prep
    97     #   announce exceptional build requirements
    98     ( echo "This package has exceptional storage requirements:"
    99       echo "  qt-%{version}-root (2,5 Go)"
   100       echo "  qt-x11-opensource-src-%{version} (4,5 Go)"
   101       echo "  qt-%{version}-<date>.<arch>-<os>-<tag>.rpm (1 Go)"
   102       echo "Building with no options takes 0,5 hours on a dual core"
   103       echo "2 GHz CPU, or 2 hours with all build options enabled."
   104     ) | %{l_rpmtool} msg -b -t notice
   106     %setup -q -n qt-x11-opensource-src-%{version}
   107     x11_incdir=`%{l_rc} --query x11_incdir`
   108     x11_libdir=`%{l_rc} --query x11_libdir`
   109     fontconflibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig`
   110     openssllibs=`%{l_prefix}/bin/pkg-config --libs --static openssl`
   112     loclibs=''
   113     case "%{l_platform -t}" in
   114         *-sunos* )
   115             loclibs='-lsocket -lnsl'
   116             ;;
   117     esac
   118     ( cd mkspecs/qws
   119       for plat in freebsd-generic-g++ macx-generic-g++ solaris-generic-g++;
   120       do 
   121           ln -s $plat `echo $plat | %{l_shtool} subst -e 's;\(.*\)-generic-\(.*\);\1-x86-\2;'`
   122       done
   123     ) || exit $?
   124     %{l_shtool} subst \
   125         -e 's;\(-z[\t ][\t ]*\)\([^\t \"][^\t \"]*\);\1"\2";g' \
   126         configure
   127     %{l_shtool} subst \
   128         -e "s;\(QMAKE_LIBS_X11.*\)-lfreetype -lfontconfig;\1$fontconflibs;" \
   129         configure
   130     %{l_shtool} subst \
   131         -e "s;\(OPENSSL_LIBS *=\) *-lssl -lcrypto;\1 $openssllibs;" \
   132         configure
   133     %{l_shtool} subst \
   134         -e 's;-silent|;-rpath|-silent|;' \
   135         -e 's;\(RPATH_FLAGS="\)\\"\$QT_INSTALL_LIBS\\" \($RPATH_FLAGS"\);\1\2;' \
   136         -e "s;\(echo.*QMAKE_RPATHDIR +=\).*\$QT_INSTALL_LIBS\\\\\"\\\";\1 $x11_libdir\";" \
   137         configure
   138     %{l_shtool} subst \
   139         -e 's;\(TRY_INCLUDEPATHS = \).*\(\$\$INCLUDEPATH\);\1\2;' \
   140         -e 's;/freetype2;/freetype;' \
   141         config.tests/unix/freetype/freetype.pri
   142     %{l_shtool} subst \
   143         -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconflibs;" \
   144         config.tests/x11/fontconfig/fontconfig.pro
   145     echo 'INCLUDEPATH += /usr/include/wacomcfg' \
   146         >>src/gui/kernel/x11.pri
   147     %{l_shtool} subst \
   148         -e "s;\(LIBS += -lpq\);\1 `%{l_prefix}/bin/pg_config --libs` $loclibs;" \
   149         config.tests/unix/psql/psql.pro
   150     %{l_shtool} subst \
   151         -e 's;^mac:\(LIBS\);\1;' \
   152         config.tests/unix/iconv/iconv.pro
   153     %{l_shtool} subst \
   154         -e 's;LIBS .*= -lpq$;LIBS += -lpq -lssl -lcrypto;' \
   155         src/sql/drivers/drivers.pri
   156     %{l_shtool} subst \
   157         -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" \
   158         src/corelib/kernel/kernel.pri \
   159         src/gui/kernel/kernel.pri
   160     %{l_shtool} subst \
   161         -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_PSQL;INCPATH += `pg_config --includedir 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \
   162         -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_MYSQL;INCPATH += `mysql_config --include 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \
   163         -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" \
   164         src/plugins/sqldrivers/mysql/mysql.pro \
   165         src/plugins/sqldrivers/psql/psql.pro \
   166         src/plugins/sqldrivers/sqlite/sqlite.pro \
   167         src/sql/drivers/drivers.pri
   168     %{l_shtool} subst \
   169         -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" \
   170         src/dbus/dbus.pro
   171     %{l_shtool} subst \
   172         -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \
   173         -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/lib;' \
   174         -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \
   175         -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2;" \
   176         -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \
   177         mkspecs/qws/*/qmake.conf \
   178         mkspecs/*/*.conf
   179     %{l_shtool} subst \
   180         -e 's;^\(QMAKE_LIBS +=.*\);\1 -liconv;' \
   181         src/corelib/corelib.pro
   182     %{l_shtool} subst \
   183         -e "s;^\(QMAKE_INCDIR_X11[^=]*=\).*;\1 %{l_prefix}/include $x11_incdir;" \
   184         -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\).*;\1 %{l_prefix}/lib $x11_libdir;" \
   185         mkspecs/qws/solaris*/qmake.conf \
   186         mkspecs/solaris*/qmake.conf
   187     %{l_shtool} subst \
   188         -e 's; *\.\./3rdparty/freetype/.*;;g' \
   189         -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \
   190         src/gui/text/text.pri
   191     %{l_shtool} subst \
   192         -e 's;\(#include  *"\)\(tiffio.h"\);\1tiff/\2;' \
   193         src/plugins/imageformats/tiff/qtiffhandler.cpp
   194     %{l_shtool} subst \
   195         -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \
   196         tools/qtconfig/qtconfig.pro
   197 #    for projfile in `find examples/ -name '*.pro' -print`; do
   198 #        echo 'CONFIG += release' >>$projfile
   199 #    done
   201 %build
   202     #   protect against sloppy code inclusion of all unused subprojects
   203     rm -rf src/3rdparty/[^cdhmsw]* src/3rdparty/sql* src/3rdparty/win*
   205     #   detect which platform for which to build
   206     case "%{l_platform -t}" in
   207         sun4[uv]-sunos* | amd64-sunos*  ) platcomp="solaris-g++-64" ;;
   208         i?86-sunos*                     ) platcomp="solaris-g++"    ;;
   209         amd64-linux*                    ) platcomp="linux-g++-64"   ;;
   210         i?86-linux*                     ) platcomp="linux-g++"      ;;
   211         amd64-freebsd* | i?86-freebsd*  ) platcomp="freebsd-g++"    ;;
   212         *-aix*                          ) platcomp="aix-g++"        ;;
   213         *-darwin*                       ) platcomp="macx-g++"       ;;
   214         *-hpux*                         ) platcomp="hpux-g++"       ;;
   215         *-irix*                         ) platcomp="irix-g++"       ;;
   216         *                               ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;;
   217     esac
   219     #   detect which architecture extensions are available
   220     archflags=''
   221     case "%{l_platform -t}" in
   222         amd64-* )
   223             break
   224             ;;
   225         * )
   226             archflags='-no-sse2 -no-3dnow'
   227             ;;
   228     esac
   230 %if "%{with_shared}" == "yes"
   231     #   optional shared build (precedes mandatory static build)
   232     echo 'yes' | ./configure \
   233         $archflags \
   234         -opensource \
   235         -prefix %{l_prefix} \
   236         -bindir %{l_prefix}/bin \
   237         -libdir %{l_prefix}/lib/qt \
   238         -docdir %{l_prefix}/share/qt/doc \
   239         -headerdir %{l_prefix}/include \
   240         -plugindir %{l_prefix}/lib/qt/plugins \
   241         -datadir %{l_prefix}/share/qt \
   242         -translationdir %{l_prefix}/share/qt/translations \
   243         -sysconfdir %{l_prefix}/etc/qt \
   244         -examplesdir %{l_prefix}/share/qt/examples \
   245         -demosdir %{l_prefix}/share/qt/demos \
   246         -release \
   247         -shared \
   248         -platform $platcomp \
   249         -no-sql-ibase \
   250 %if "%{with_mysql}" == "yes"
   251         -qt-sql-mysql \
   252         -plugin-sql-mysql \
   253 %else
   254         -no-sql-mysql \
   255 %endif
   256 %if "%{with_pgsql}" == "yes"
   257         -qt-sql-psql \
   258         -plugin-sql-psql \
   259 %else
   260         -no-sql-psql \
   261 %endif
   262         -no-sql-odbc \
   263         -system-sqlite \
   264         -qt-sql-sqlite \
   265         -plugin-sql-sqlite \
   266         -no-sql-sqlite2 \
   267         -openssl-linked \
   268         -xmlpatterns \
   269         -svg \
   270         -system-zlib \
   271         -qt-gif \
   272         -system-libpng \
   273         -system-libmng \
   274         -system-libjpeg \
   275         -system-libtiff \
   276         -rpath \
   277         -no-cups \
   278         -no-iconv \
   279         -pch \
   280         -dbus-linked \
   281         -opengl \
   282         -xrender \
   283         -fontconfig \
   284         -freetype \
   285         -no-glib
   287     #   default options are implicitly used, for example...
   288     #-no-fast -exceptions -accessibility -stl -qt3support -nis
   289     #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
   291     #   carry out shared build procedure
   292     ( cd src
   293       %{l_make} %{l_mflags -O} \
   294           sub-moc sub-rcc sub-uic
   295       %{l_make} %{l_mflags -O} \
   296           sub-corelib sub-xml sub-network sub-gui sub-sql \
   297           sub-script sub-testlib sub-qt3support sub-dbus \
   298           sub-opengl sub-xmlpatterns sub-svg sub-plugins
   299     ) || exit $?
   301     #   arthur plugin requires libQtDesigner
   302     ( cd demos
   303       ( cd ../tools/designer/src/lib
   304         %{l_make} %{l_mflags -O} staticlib
   305       ) || exit $?
   306       %{l_make} %{l_mflags -O} sub-arthurplugin
   307       ( cd ../tools/designer/src/lib
   308         %{l_make} %{l_mflags -O} distclean
   309       ) || exit $?
   310     ) || exit $?
   312     #   cache shared libs and initialize the build configuration, which
   313     #   would otherwise still contain references to our shared libs build
   314     %{l_shtool} mkdir -f -p -m 755 dynamic
   315     mv lib/* dynamic/
   316     ( cd qmake
   317       %{l_make} %{l_mflags} distclean
   318     ) || exit $?
   319     rm -f .qmake.cache
   320 %endif
   322     #   mandatory static build (follows optional shared build)
   323     echo 'yes' | ./configure \
   324         $archflags \
   325         -opensource \
   326         -prefix %{l_prefix} \
   327         -bindir %{l_prefix}/bin \
   328         -libdir %{l_prefix}/lib \
   329         -docdir %{l_prefix}/share/qt/doc \
   330         -headerdir %{l_prefix}/include \
   331         -plugindir %{l_prefix}/lib/qt/plugins \
   332         -datadir %{l_prefix}/share/qt \
   333         -translationdir %{l_prefix}/share/qt/translations \
   334         -sysconfdir %{l_prefix}/etc/qt \
   335         -examplesdir %{l_prefix}/share/qt/examples \
   336         -demosdir %{l_prefix}/share/qt/demos \
   337         -release \
   338         -static \
   339         -platform $platcomp \
   340         -no-sql-ibase \
   341 %if "%{with_mysql}" == "yes"
   342         -qt-sql-mysql \
   343 %else
   344         -no-sql-mysql \
   345 %endif
   346 %if "%{with_pgsql}" == "yes"
   347         -qt-sql-psql \
   348 %else
   349         -no-sql-psql \
   350 %endif
   351         -no-sql-odbc \
   352         -system-sqlite \
   353         -qt-sql-sqlite \
   354         -no-sql-sqlite2 \
   355         -openssl-linked \
   356         -xmlpatterns \
   357         -svg \
   358         -system-zlib \
   359         -qt-gif \
   360         -system-libpng \
   361         -system-libmng \
   362         -system-libjpeg \
   363         -system-libtiff \
   364         -rpath \
   365         -no-cups \
   366         -no-iconv \
   367         -pch \
   368         -dbus-linked \
   369         -opengl \
   370         -xrender \
   371         -fontconfig \
   372         -freetype \
   373         -no-glib
   375     #   default options are implicitly used, for example...
   376     #-no-fast -exceptions -accessibility -stl -qt3support -nis
   377     #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
   379     #   carry out static build procedure
   380     %{l_make} %{l_mflags -O} sub-src
   381 %if "%{with_tools}" == "yes"
   382     %{l_make} %{l_mflags -O} sub-tools
   383 %endif
   384 %if "%{with_examples}" == "yes"
   385     %{l_make} %{l_mflags -O} \
   386         sub-demos-make_default-ordered \
   387         sub-examples-make_default-ordered
   388 %endif
   390 %install
   391     rm -rf $RPM_BUILD_ROOT
   393     #   carry out installation procedure
   394     targets="sub-moc-install_subtargets-ordered \
   395             sub-rcc-install_subtargets-ordered \
   396             sub-uic-install_subtargets-ordered \
   397             sub-corelib-install_subtargets-ordered \
   398             sub-xml-install_subtargets-ordered \
   399             sub-network-install_subtargets-ordered \
   400             sub-gui-install_subtargets-ordered \
   401             sub-sql-install_subtargets-ordered \
   402             sub-script-install_subtargets-ordered \
   403             sub-testlib-install_subtargets-ordered \
   404             sub-qt3support-install_subtargets-ordered \
   405             sub-dbus-install_subtargets-ordered \
   406             sub-uic3-install_subtargets-ordered \
   407             sub-opengl-install_subtargets-ordered \
   408             sub-xmlpatterns-install_subtargets-ordered \
   409             sub-svg-install_subtargets-ordered \
   410             sub-plugins-install_subtargets-ordered"
   411 %if "%{with_tools}" == "yes"
   412     targets="$targets sub-tools-install_subtargets-ordered"
   413 %endif
   414 %if "%{with_examples}" == "yes"
   415     targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered"
   416 %endif
   417     targets="$targets install_htmldocs install_qchdocs install_docimages install_translations install_qmake install_mkspecs"
   418     %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT"
   420 %if "%{with_shared}" == "yes"
   421     #   install shared libs and symlinks
   422     %{l_shtool} mkdir -f -p -m 755 \
   423         $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   424     %{l_tar} cf - dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   426     #   offer limited support of pkg-config(1) for shared libs
   427     #   substitution unfortunately only handles paths with no whitespace
   428     %{l_shtool} subst \
   429         -e "s;[^\t ][^\t ]*qt-x11-opensource-src-%{version};%{l_prefix};g" \
   430         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/*
   432     #   explain nonstandard shared library placement
   433     ( echo "This OpenPKG Qt build is using the with_shared option."
   434       echo ""
   435       echo "This directory contains optional shared libraries as"
   436       echo "defined by the OpenPKG build specification. Although"
   437       echo "shared libraries have been optionally built (see the"
   438       echo "build time 'with_shared yes' option), static libraries"
   439       echo "were built by default as usual, and installed in the"
   440       echo "standard library directory %{l_prefix}/lib."
   441       echo ""
   442       echo "To build applications using shared libraries instead,"
   443       echo "please direct pkg-config(1) to use the properdefinitions"
   444       echo "by setting the environment variable PKG_CONFIG_PATH to "
   445       echo "%{l_prefix}/lib/qt/dynamic/pkgconfig."
   446     ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README
   448     #   remove temporary dynamic link paths
   449     %{l_shtool} subst \
   450         -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-x11-opensource-src-%{version}\(/[^\t ][^\t ]*\);-L\1%{l_prefix}\2;g" \
   451         -e "s;\([\t ][\t ]*\)[^\t ][^\t ]*\(qt-x11-opensource-src-%{version}.*\);\1/tmp/\2;" \
   452         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \
   453         $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la
   454 %endif
   456     #   determine internal file listing
   457     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   458         %{l_files_std} \
   459         '%doc %{l_prefix}/share/qt/doc/*/*' \
   460         '%not %dir %{l_prefix}/lib/pkgconfig'
   462 %files -f files
   464 %clean
   465     rm -rf $RPM_BUILD_ROOT

mercurial