qt/qt.spec

changeset 1
52e8b53d33be
child 3
c2e6bf16b6f4
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/qt/qt.spec	Thu Nov 27 14:27:51 2008 +0100
     1.3 @@ -0,0 +1,359 @@
     1.4 +##
     1.5 +##  qt.spec -- OpenPKG RPM Specification
     1.6 +##  Copyright (c) 2008 Michael Schloh von Bennewitz <michael@schloh.com>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +
    1.28 +#   package information
    1.29 +Name:         qt
    1.30 +Summary:      Cross-platform Application Framework
    1.31 +URL:          http://www.trolltech.com/products/qt/
    1.32 +Vendor:       Nokia Corporation
    1.33 +Packager:     Michael Schloh von Bennewitz
    1.34 +Distribution: MSvB Recherche Production
    1.35 +Class:        EVAL
    1.36 +Group:        Development
    1.37 +License:      GPL
    1.38 +Version:      4.4.3
    1.39 +Release:      20081124
    1.40 +
    1.41 +#   build options
    1.42 +%option       with_tools     yes
    1.43 +%option       with_shared    no
    1.44 +%option       with_examples  no
    1.45 +
    1.46 +#   list of sources
    1.47 +Source0:      ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-%{version}.tar.gz
    1.48 +
    1.49 +#   build information
    1.50 +Prefix:       %{l_prefix}
    1.51 +BuildRoot:    %{l_buildroot}
    1.52 +BuildPreReq:  OpenPKG, openpkg >= 20050726, gcc, pkgconfig
    1.53 +PreReq:       OpenPKG, openpkg >= 20050726
    1.54 +BuildPreReq:  X11, png, mng, jpeg, tiff, mesa, xrender
    1.55 +PreReq:       X11, png, mng, jpeg, tiff, mesa, xrender
    1.56 +BuildPreReq:  zlib, libiconv, sqlite, dbus, glib2
    1.57 +PreReq:       zlib, libiconv, sqlite, dbus, glib2
    1.58 +BuildPreReq:  fontconfig, freetype
    1.59 +PreReq:       fontconfig, freetype
    1.60 +AutoReq:      no
    1.61 +AutoReqProv:  no
    1.62 +Provides:     QTSDK
    1.63 +
    1.64 +%description
    1.65 +    Qt is a cross-platform application framework. Using Qt, you can
    1.66 +    develop applications and user interfaces once, and deploy them
    1.67 +    across many desktop and embedded operating systems without
    1.68 +    rewriting the source code.
    1.69 +
    1.70 +%track
    1.71 +    prog qt = {
    1.72 +        version   = %{version}
    1.73 +        url       = ftp://ftp.trolltech.com/qt/source/
    1.74 +        regex     = qt-x11-opensource-src-(__VER__)\.tar\.gz
    1.75 +    }
    1.76 +
    1.77 +%prep
    1.78 +    #   announce exceptional build requirements
    1.79 +    ( echo "This package has exceptional storage requirements:"
    1.80 +      echo "  qt-%{version}-root (2,5 Go)"
    1.81 +      echo "  qt-x11-opensource-src-%{version} (4,5 Go)"
    1.82 +      echo "  qt-%{version}-<date>.<arch>-<os>-<tag>.rpm (1 Go)"
    1.83 +      echo "Building with no options takes 0,5 hours on a dual core"
    1.84 +      echo "2 GHz CPU, or 1,5 hours with all build options enabled."
    1.85 +    ) | %{l_rpmtool} msg -b -t notice
    1.86 +
    1.87 +    %setup -q -n qt-x11-opensource-src-%{version}
    1.88 +    x11_incdir=`%{l_rc} --query x11_incdir`
    1.89 +    x11_libdir=`%{l_rc} --query x11_libdir`
    1.90 +    fontconf=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig`
    1.91 +    loclibs=''
    1.92 +    x11_supdir=''
    1.93 +    case "%{l_platform -t}" in
    1.94 +        *-sunos* )
    1.95 +            loclibs='-lsocket -lnsl'
    1.96 +            [ -d /usr/X/sfw/lib ] && x11_supdir=/usr/X/sfw/lib
    1.97 +            ;;
    1.98 +    esac
    1.99 +    ( cd mkspecs/qws
   1.100 +      for plat in freebsd-generic-g++ macx-generic-g++ solaris-generic-g++;
   1.101 +      do 
   1.102 +          ln -s $plat `echo $plat | %{l_shtool} subst -e 's;\(.*\)-generic-\(.*\);\1-x86-\2;'`
   1.103 +      done
   1.104 +    ) || exit $?
   1.105 +    %{l_shtool} subst \
   1.106 +        -e 's;\(-z[ \t][ \t]*\)\([^ \t\"][^ \t\"]*\);\1"\2";g' \
   1.107 +        configure
   1.108 +    %{l_shtool} subst \
   1.109 +        -e "s;\(QMAKE_LIBS_X11.*\)-lfreetype -lfontconfig;\1$fontconf;" \
   1.110 +        configure
   1.111 +    %{l_shtool} subst \
   1.112 +        -e 's;-silent|;-rpath|-silent|;' \
   1.113 +        -e 's;\(RPATH_FLAGS="\)\\"\$QT_INSTALL_LIBS\\" \($RPATH_FLAGS"\);\1\2;' \
   1.114 +        -e "s;\(echo.*QMAKE_RPATHDIR +=\).*\$QT_INSTALL_LIBS\\\\\"\\\";\1 $x11_libdir\";" \
   1.115 +        configure
   1.116 +    if [ ".$x11_supdir" != . -a -d "$x11_supdir" ]; then
   1.117 +        %{l_shtool} subst \
   1.118 +            -e "s;\(echo.*QMAKE_RPATHDIR += \)\($x11_libdir\\\"\)\( >> \\\"\$QTCONFIG\.tmp\\\"\);\1\2\3 \&\& \1$x11_supdir\"\3;" \
   1.119 +            configure
   1.120 +    fi
   1.121 +    %{l_shtool} subst \
   1.122 +        -e 's;\(TRY_INCLUDEPATHS = \).*\(\$\$INCLUDEPATH\);\1\2;' \
   1.123 +        -e 's;/freetype2;/freetype;' \
   1.124 +        config.tests/unix/freetype/freetype.pri
   1.125 +    %{l_shtool} subst \
   1.126 +        -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconf;" \
   1.127 +        config.tests/x11/fontconfig/fontconfig.pro
   1.128 +    %{l_shtool} subst \
   1.129 +        -e "s;\(LIBS += -lpq\);\1 -lssl -lcrypto $loclibs;" \
   1.130 +        config.tests/unix/psql/psql.pro
   1.131 +    %{l_shtool} subst \
   1.132 +        -e 's;^mac:\(LIBS\);\1;' \
   1.133 +        config.tests/unix/iconv/iconv.pro
   1.134 +    %{l_shtool} subst \
   1.135 +        -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \
   1.136 +        -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/lib;' \
   1.137 +        -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \
   1.138 +        -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2 $x11_supdir;" \
   1.139 +        -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \
   1.140 +        mkspecs/qws/*/qmake.conf \
   1.141 +        mkspecs/*/*.conf
   1.142 +    %{l_shtool} subst \
   1.143 +        -e "s;^\(QMAKE_INCDIR_X11[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \
   1.144 +        -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2 $x11_supdir;" \
   1.145 +        mkspecs/qws/solaris*/qmake.conf \
   1.146 +        mkspecs/solaris*/qmake.conf
   1.147 +    %{l_shtool} subst \
   1.148 +        -e 's; *\.\./3rdparty/freetype/.*;;g' \
   1.149 +        -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \
   1.150 +        src/gui/text/text.pri
   1.151 +    %{l_shtool} subst \
   1.152 +        -e 's;\(#include  *"\)\(tiffio.h"\);\1tiff/\2;' \
   1.153 +        src/plugins/imageformats/tiff/qtiffhandler.cpp
   1.154 +#    for projfile in `find examples/ -name '*.pro' -print`; do
   1.155 +#        echo 'CONFIG += release' >>$projfile
   1.156 +#    done
   1.157 +
   1.158 +%build
   1.159 +    #   protect against sloppy code inclusion of all unused subprojects
   1.160 +    rm -rf src/3rdparty/[^cdhmsw]* src/3rdparty/sql* src/3rdparty/win*
   1.161 +
   1.162 +    case "%{l_platform -t}" in
   1.163 +        *-aix*     ) platcomp="aix-g++"     ;;
   1.164 +        *-freebsd* ) platcomp="freebsd-g++" ;;
   1.165 +        *-hpux*    ) platcomp="hpux-g++"    ;;
   1.166 +        *-irix*    ) platcomp="irix-g++"    ;;
   1.167 +        *-linux*   ) platcomp="linux-g++"   ;;
   1.168 +        *-darwin*  ) platcomp="macx-g++"    ;;
   1.169 +        *-sunos*   ) platcomp="solaris-g++" ;;
   1.170 +        *          ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;;
   1.171 +    esac
   1.172 +
   1.173 +%if "%{with_shared}" == "yes"
   1.174 +    #   optional shared build (precedes mandatory static build)
   1.175 +    echo 'yes' | ./configure \
   1.176 +        -prefix %{l_prefix} \
   1.177 +        -bindir %{l_prefix}/bin \
   1.178 +        -libdir %{l_prefix}/lib/qt \
   1.179 +        -docdir %{l_prefix}/share/qt/doc \
   1.180 +        -headerdir %{l_prefix}/include \
   1.181 +        -plugindir %{l_prefix}/share/qt/plugins \
   1.182 +        -datadir %{l_prefix}/share/qt \
   1.183 +        -translationdir %{l_prefix}/share/qt/translations \
   1.184 +        -sysconfdir %{l_prefix}/etc/qt \
   1.185 +        -examplesdir %{l_prefix}/share/qt/examples \
   1.186 +        -demosdir %{l_prefix}/share/qt/demos \
   1.187 +        -release \
   1.188 +        -shared \
   1.189 +        -platform $platcomp \
   1.190 +        -no-sql-ibase \
   1.191 +        -no-sql-mysql \
   1.192 +        -no-sql-odbc \
   1.193 +        -no-sql-psql \
   1.194 +        -no-sql-sqlite2 \
   1.195 +        -qt-sql-sqlite \
   1.196 +        -system-sqlite \
   1.197 +        -xmlpatterns \
   1.198 +        -svg \
   1.199 +        -no-webkit \
   1.200 +        -system-zlib \
   1.201 +        -qt-gif \
   1.202 +        -system-libpng \
   1.203 +        -system-libmng \
   1.204 +        -system-libjpeg \
   1.205 +        -system-libtiff \
   1.206 +        -rpath \
   1.207 +        -no-cups \
   1.208 +        -iconv \
   1.209 +        -pch \
   1.210 +        -dbus-linked \
   1.211 +        -opengl \
   1.212 +        -xrender \
   1.213 +        -fontconfig \
   1.214 +        -freetype \
   1.215 +        -glib
   1.216 +
   1.217 +    #   default options are implicitly used, und zwar...
   1.218 +    #-no-fast -exceptions -accessibility -stl -qt3support -nis
   1.219 +    #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
   1.220 +
   1.221 +    #   carry out shared build procedure
   1.222 +    ( cd src
   1.223 +      %{l_make} %{l_mflags -O} \
   1.224 +          sub-moc sub-rcc sub-uic
   1.225 +      %{l_make} %{l_mflags -O} \
   1.226 +          sub-corelib sub-xml sub-network sub-gui sub-sql \
   1.227 +          sub-script sub-testlib sub-qt3support sub-dbus \
   1.228 +          sub-opengl sub-xmlpatterns sub-svg sub-plugins
   1.229 +    ) || exit $?
   1.230 +
   1.231 +    #   cache shared libs and initialize the build configuration, which
   1.232 +    #   would otherwise still contain references to our shared libs build
   1.233 +    %{l_shtool} mkdir -f -p -m 755 dynamic
   1.234 +    mv lib/* dynamic/
   1.235 +    ( cd qmake
   1.236 +      %{l_make} %{l_mflags} distclean
   1.237 +    ) || exit $?
   1.238 +    rm -f .qmake.cache
   1.239 +%endif
   1.240 +
   1.241 +    #   mandatory static build (follows optional shared build)
   1.242 +    echo 'yes' | ./configure \
   1.243 +        -prefix %{l_prefix} \
   1.244 +        -bindir %{l_prefix}/bin \
   1.245 +        -libdir %{l_prefix}/lib \
   1.246 +        -docdir %{l_prefix}/share/qt/doc \
   1.247 +        -headerdir %{l_prefix}/include \
   1.248 +        -plugindir %{l_prefix}/share/qt/plugins \
   1.249 +        -datadir %{l_prefix}/share/qt \
   1.250 +        -translationdir %{l_prefix}/share/qt/translations \
   1.251 +        -sysconfdir %{l_prefix}/etc/qt \
   1.252 +        -examplesdir %{l_prefix}/share/qt/examples \
   1.253 +        -demosdir %{l_prefix}/share/qt/demos \
   1.254 +        -release \
   1.255 +        -static \
   1.256 +        -platform $platcomp \
   1.257 +        -no-sql-ibase \
   1.258 +        -no-sql-mysql \
   1.259 +        -no-sql-odbc \
   1.260 +        -no-sql-psql \
   1.261 +        -no-sql-sqlite2 \
   1.262 +        -qt-sql-sqlite \
   1.263 +        -system-sqlite \
   1.264 +        -xmlpatterns \
   1.265 +        -svg \
   1.266 +        -no-webkit \
   1.267 +        -system-zlib \
   1.268 +        -qt-gif \
   1.269 +        -system-libpng \
   1.270 +        -system-libmng \
   1.271 +        -system-libjpeg \
   1.272 +        -system-libtiff \
   1.273 +        -rpath \
   1.274 +        -no-cups \
   1.275 +        -iconv \
   1.276 +        -pch \
   1.277 +        -dbus-linked \
   1.278 +        -opengl \
   1.279 +        -xrender \
   1.280 +        -fontconfig \
   1.281 +        -freetype \
   1.282 +        -glib
   1.283 +
   1.284 +    #   default options are implicitly used, und zwar...
   1.285 +    #-no-fast -exceptions -accessibility -stl -qt3support -nis
   1.286 +    #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
   1.287 +
   1.288 +    #   carry out static build procedure
   1.289 +    %{l_make} %{l_mflags -O} sub-src
   1.290 +%if "%{with_tools}" == "yes"
   1.291 +    %{l_make} %{l_mflags -O} sub-tools
   1.292 +%endif
   1.293 +%if "%{with_examples}" == "yes"
   1.294 +    %{l_make} %{l_mflags -O} \
   1.295 +        sub-demos-make_default-ordered \
   1.296 +        sub-examples-make_default-ordered
   1.297 +%endif
   1.298 +
   1.299 +%install
   1.300 +    rm -rf $RPM_BUILD_ROOT
   1.301 +
   1.302 +    #   carry out installation procedure
   1.303 +    targets="sub-moc-install_subtargets-ordered \
   1.304 +            sub-rcc-install_subtargets-ordered \
   1.305 +            sub-uic-install_subtargets-ordered \
   1.306 +            sub-corelib-install_subtargets-ordered \
   1.307 +            sub-xml-install_subtargets-ordered \
   1.308 +            sub-network-install_subtargets-ordered \
   1.309 +            sub-gui-install_subtargets-ordered \
   1.310 +            sub-sql-install_subtargets-ordered \
   1.311 +            sub-script-install_subtargets-ordered \
   1.312 +            sub-testlib-install_subtargets-ordered \
   1.313 +            sub-qt3support-install_subtargets-ordered \
   1.314 +            sub-dbus-install_subtargets-ordered \
   1.315 +            sub-uic3-install_subtargets-ordered \
   1.316 +            sub-opengl-install_subtargets-ordered \
   1.317 +            sub-xmlpatterns-install_subtargets-ordered \
   1.318 +            sub-svg-install_subtargets-ordered \
   1.319 +            sub-plugins-install_subtargets-ordered"
   1.320 +%if "%{with_tools}" == "yes"
   1.321 +    targets="$targets sub-tools-install_subtargets-ordered"
   1.322 +%endif
   1.323 +%if "%{with_examples}" == "yes"
   1.324 +    targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered"
   1.325 +%endif
   1.326 +    targets="$targets install_htmldocs install_translations install_qmake install_mkspecs"
   1.327 +    %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT"
   1.328 +
   1.329 +%if "%{with_shared}" == "yes"
   1.330 +    #   install shared libs and symlinks
   1.331 +    %{l_shtool} mkdir -f -p -m 755 \
   1.332 +        $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   1.333 +    %{l_tar} cf - dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
   1.334 +
   1.335 +    #   explain nonstandard shared library placement
   1.336 +    ( echo "This directory contains optional shared libraries as"
   1.337 +      echo "defined by the OpenPKG build specification. Although"
   1.338 +      echo "shared libraries are only optionally built (see the"
   1.339 +      echo "build time 'with_shared yes' option), static libraries"
   1.340 +      echo "are built and installed in the parent 'lib' directory."
   1.341 +    ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README
   1.342 +
   1.343 +    #   do not support pkg-config(1) with shared libs
   1.344 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/qt/pkgconfig
   1.345 +
   1.346 +    #   remove temporary dynamic link paths
   1.347 +    %{l_shtool} subst \
   1.348 +        -e 's;\(QMAKE_PRL_BUILD_DIR[^=][^=]*=\).*\(qt-x11-opensource-src.*\);\1 /tmp/\2;' \
   1.349 +        $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl
   1.350 +%endif
   1.351 +
   1.352 +    #   determine internal file listing
   1.353 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   1.354 +        %{l_files_std} \
   1.355 +        '%doc %{l_prefix}/share/qt/doc/*' \
   1.356 +        '%not %dir %{l_prefix}/lib/pkgconfig'
   1.357 +
   1.358 +%files -f files
   1.359 +
   1.360 +%clean
   1.361 +    rm -rf $RPM_BUILD_ROOT
   1.362 +

mercurial