qt/qt.spec

Thu, 08 Jan 2009 18:28:40 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 08 Jan 2009 18:28:40 +0100
changeset 45
d2954f86e9e6
parent 4
7118aa4adf88
child 65
caa04e02b103
permissions
-rw-r--r--

Depend on sed, grep, and binutils, because libtool hard codes values.
This unfortunate dependency change is necessary because the main
program script calls helper tools from hard coded paths. Please
see /pfx/bin/libtool:77 for the example SED="/pfx/bin/sed".

michael@1 1 ##
michael@1 2 ## qt.spec -- OpenPKG RPM Specification
michael@29 3 ## Copyright (c) 2009 Michael Schloh von Bennewitz <michael@schloh.com>
michael@1 4 ##
michael@1 5 ## Permission to use, copy, modify, and distribute this software for
michael@1 6 ## any purpose with or without fee is hereby granted, provided that
michael@1 7 ## the above copyright notice and this permission notice appear in all
michael@1 8 ## copies.
michael@1 9 ##
michael@1 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@1 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@1 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@1 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@1 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@1 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@1 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@1 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@1 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@1 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@1 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@1 21 ## SUCH DAMAGE.
michael@1 22 ##
michael@1 23
michael@1 24
michael@1 25 # package information
michael@1 26 Name: qt
michael@1 27 Summary: Cross-platform Application Framework
michael@1 28 URL: http://www.trolltech.com/products/qt/
michael@1 29 Vendor: Nokia Corporation
michael@1 30 Packager: Michael Schloh von Bennewitz
michael@1 31 Distribution: MSvB Recherche Production
michael@1 32 Class: EVAL
michael@1 33 Group: Development
michael@1 34 License: GPL
michael@1 35 Version: 4.4.3
michael@4 36 Release: 20081215
michael@1 37
michael@1 38 # build options
michael@1 39 %option with_tools yes
michael@1 40 %option with_shared no
michael@1 41 %option with_examples no
michael@1 42
michael@1 43 # list of sources
michael@1 44 Source0: ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-%{version}.tar.gz
michael@1 45
michael@1 46 # build information
michael@1 47 Prefix: %{l_prefix}
michael@1 48 BuildRoot: %{l_buildroot}
michael@4 49 BuildPreReq: OpenPKG, openpkg >= 20050726, make, gcc, pkgconfig
michael@1 50 PreReq: OpenPKG, openpkg >= 20050726
michael@1 51 BuildPreReq: X11, png, mng, jpeg, tiff, mesa, xrender
michael@1 52 PreReq: X11, png, mng, jpeg, tiff, mesa, xrender
michael@3 53 BuildPreReq: openssl, zlib, libiconv, sqlite, dbus
michael@3 54 PreReq: openssl, zlib, libiconv, sqlite, dbus
michael@1 55 BuildPreReq: fontconfig, freetype
michael@1 56 PreReq: fontconfig, freetype
michael@1 57 AutoReq: no
michael@1 58 AutoReqProv: no
michael@1 59 Provides: QTSDK
michael@1 60
michael@1 61 %description
michael@3 62 Qt is a comprehensive C++ framework for cross-platform application
michael@3 63 development. Using Qt, you can develop applications and user
michael@3 64 interfaces once, and deploy them across many desktop and embedded
michael@3 65 operating systems without rewriting the source code.
michael@1 66
michael@1 67 %track
michael@1 68 prog qt = {
michael@1 69 version = %{version}
michael@1 70 url = ftp://ftp.trolltech.com/qt/source/
michael@1 71 regex = qt-x11-opensource-src-(__VER__)\.tar\.gz
michael@1 72 }
michael@1 73
michael@1 74 %prep
michael@1 75 # announce exceptional build requirements
michael@1 76 ( echo "This package has exceptional storage requirements:"
michael@1 77 echo " qt-%{version}-root (2,5 Go)"
michael@1 78 echo " qt-x11-opensource-src-%{version} (4,5 Go)"
michael@1 79 echo " qt-%{version}-<date>.<arch>-<os>-<tag>.rpm (1 Go)"
michael@1 80 echo "Building with no options takes 0,5 hours on a dual core"
michael@3 81 echo "2 GHz CPU, or 2 hours with all build options enabled."
michael@1 82 ) | %{l_rpmtool} msg -b -t notice
michael@1 83
michael@1 84 %setup -q -n qt-x11-opensource-src-%{version}
michael@1 85 x11_incdir=`%{l_rc} --query x11_incdir`
michael@1 86 x11_libdir=`%{l_rc} --query x11_libdir`
michael@1 87 fontconf=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig`
michael@1 88 loclibs=''
michael@1 89 x11_supdir=''
michael@1 90 case "%{l_platform -t}" in
michael@1 91 *-sunos* )
michael@1 92 loclibs='-lsocket -lnsl'
michael@1 93 [ -d /usr/X/sfw/lib ] && x11_supdir=/usr/X/sfw/lib
michael@1 94 ;;
michael@1 95 esac
michael@1 96 ( cd mkspecs/qws
michael@1 97 for plat in freebsd-generic-g++ macx-generic-g++ solaris-generic-g++;
michael@1 98 do
michael@1 99 ln -s $plat `echo $plat | %{l_shtool} subst -e 's;\(.*\)-generic-\(.*\);\1-x86-\2;'`
michael@1 100 done
michael@1 101 ) || exit $?
michael@1 102 %{l_shtool} subst \
michael@1 103 -e 's;\(-z[ \t][ \t]*\)\([^ \t\"][^ \t\"]*\);\1"\2";g' \
michael@1 104 configure
michael@1 105 %{l_shtool} subst \
michael@1 106 -e "s;\(QMAKE_LIBS_X11.*\)-lfreetype -lfontconfig;\1$fontconf;" \
michael@1 107 configure
michael@1 108 %{l_shtool} subst \
michael@1 109 -e 's;-silent|;-rpath|-silent|;' \
michael@1 110 -e 's;\(RPATH_FLAGS="\)\\"\$QT_INSTALL_LIBS\\" \($RPATH_FLAGS"\);\1\2;' \
michael@1 111 -e "s;\(echo.*QMAKE_RPATHDIR +=\).*\$QT_INSTALL_LIBS\\\\\"\\\";\1 $x11_libdir\";" \
michael@1 112 configure
michael@1 113 if [ ".$x11_supdir" != . -a -d "$x11_supdir" ]; then
michael@1 114 %{l_shtool} subst \
michael@1 115 -e "s;\(echo.*QMAKE_RPATHDIR += \)\($x11_libdir\\\"\)\( >> \\\"\$QTCONFIG\.tmp\\\"\);\1\2\3 \&\& \1$x11_supdir\"\3;" \
michael@1 116 configure
michael@1 117 fi
michael@1 118 %{l_shtool} subst \
michael@1 119 -e 's;\(TRY_INCLUDEPATHS = \).*\(\$\$INCLUDEPATH\);\1\2;' \
michael@1 120 -e 's;/freetype2;/freetype;' \
michael@1 121 config.tests/unix/freetype/freetype.pri
michael@1 122 %{l_shtool} subst \
michael@1 123 -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconf;" \
michael@1 124 config.tests/x11/fontconfig/fontconfig.pro
michael@1 125 %{l_shtool} subst \
michael@1 126 -e "s;\(LIBS += -lpq\);\1 -lssl -lcrypto $loclibs;" \
michael@1 127 config.tests/unix/psql/psql.pro
michael@1 128 %{l_shtool} subst \
michael@1 129 -e 's;^mac:\(LIBS\);\1;' \
michael@1 130 config.tests/unix/iconv/iconv.pro
michael@1 131 %{l_shtool} subst \
michael@1 132 -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \
michael@1 133 -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/lib;' \
michael@1 134 -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \
michael@1 135 -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2 $x11_supdir;" \
michael@1 136 -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \
michael@1 137 mkspecs/qws/*/qmake.conf \
michael@1 138 mkspecs/*/*.conf
michael@1 139 %{l_shtool} subst \
michael@3 140 -e 's;^\(QMAKE_LIBS +=.*\);\1 -liconv;' \
michael@3 141 src/corelib/corelib.pro
michael@3 142 %{l_shtool} subst \
michael@1 143 -e "s;^\(QMAKE_INCDIR_X11[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \
michael@1 144 -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2 $x11_supdir;" \
michael@1 145 mkspecs/qws/solaris*/qmake.conf \
michael@1 146 mkspecs/solaris*/qmake.conf
michael@1 147 %{l_shtool} subst \
michael@1 148 -e 's; *\.\./3rdparty/freetype/.*;;g' \
michael@1 149 -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \
michael@1 150 src/gui/text/text.pri
michael@1 151 %{l_shtool} subst \
michael@1 152 -e 's;\(#include *"\)\(tiffio.h"\);\1tiff/\2;' \
michael@1 153 src/plugins/imageformats/tiff/qtiffhandler.cpp
michael@1 154 # for projfile in `find examples/ -name '*.pro' -print`; do
michael@1 155 # echo 'CONFIG += release' >>$projfile
michael@1 156 # done
michael@1 157
michael@1 158 %build
michael@1 159 # protect against sloppy code inclusion of all unused subprojects
michael@1 160 rm -rf src/3rdparty/[^cdhmsw]* src/3rdparty/sql* src/3rdparty/win*
michael@1 161
michael@1 162 case "%{l_platform -t}" in
michael@3 163 *-aix* ) platcomp="aix-g++" ;;
michael@3 164 *-freebsd* ) platcomp="freebsd-g++" ;;
michael@3 165 *-hpux* ) platcomp="hpux-g++" ;;
michael@3 166 *-irix* ) platcomp="irix-g++" ;;
michael@3 167 *64-linux* ) platcomp="linux-g++-64" ;;
michael@3 168 *-linux* ) platcomp="linux-g++" ;;
michael@3 169 *-darwin* ) platcomp="macx-g++" ;;
michael@3 170 *-sunos* ) platcomp="solaris-g++" ;;
michael@1 171 * ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;;
michael@1 172 esac
michael@1 173
michael@1 174 %if "%{with_shared}" == "yes"
michael@1 175 # optional shared build (precedes mandatory static build)
michael@1 176 echo 'yes' | ./configure \
michael@1 177 -prefix %{l_prefix} \
michael@1 178 -bindir %{l_prefix}/bin \
michael@1 179 -libdir %{l_prefix}/lib/qt \
michael@1 180 -docdir %{l_prefix}/share/qt/doc \
michael@1 181 -headerdir %{l_prefix}/include \
michael@1 182 -plugindir %{l_prefix}/share/qt/plugins \
michael@1 183 -datadir %{l_prefix}/share/qt \
michael@1 184 -translationdir %{l_prefix}/share/qt/translations \
michael@1 185 -sysconfdir %{l_prefix}/etc/qt \
michael@1 186 -examplesdir %{l_prefix}/share/qt/examples \
michael@1 187 -demosdir %{l_prefix}/share/qt/demos \
michael@1 188 -release \
michael@1 189 -shared \
michael@1 190 -platform $platcomp \
michael@1 191 -no-sql-ibase \
michael@3 192 -qt-sql-mysql \
michael@1 193 -no-sql-odbc \
michael@1 194 -no-sql-psql \
michael@1 195 -no-sql-sqlite2 \
michael@1 196 -qt-sql-sqlite \
michael@1 197 -system-sqlite \
michael@3 198 -openssl-linked \
michael@1 199 -xmlpatterns \
michael@1 200 -svg \
michael@1 201 -no-webkit \
michael@1 202 -system-zlib \
michael@1 203 -qt-gif \
michael@1 204 -system-libpng \
michael@1 205 -system-libmng \
michael@1 206 -system-libjpeg \
michael@1 207 -system-libtiff \
michael@1 208 -rpath \
michael@1 209 -no-cups \
michael@1 210 -iconv \
michael@1 211 -pch \
michael@1 212 -dbus-linked \
michael@1 213 -opengl \
michael@1 214 -xrender \
michael@1 215 -fontconfig \
michael@1 216 -freetype \
michael@3 217 -no-glib
michael@1 218
michael@4 219 # sadly, the webkit is broken in Qt 4.4.3.
michael@1 220 # default options are implicitly used, und zwar...
michael@1 221 #-no-fast -exceptions -accessibility -stl -qt3support -nis
michael@1 222 #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
michael@1 223
michael@1 224 # carry out shared build procedure
michael@1 225 ( cd src
michael@1 226 %{l_make} %{l_mflags -O} \
michael@1 227 sub-moc sub-rcc sub-uic
michael@1 228 %{l_make} %{l_mflags -O} \
michael@1 229 sub-corelib sub-xml sub-network sub-gui sub-sql \
michael@1 230 sub-script sub-testlib sub-qt3support sub-dbus \
michael@1 231 sub-opengl sub-xmlpatterns sub-svg sub-plugins
michael@1 232 ) || exit $?
michael@1 233
michael@1 234 # cache shared libs and initialize the build configuration, which
michael@1 235 # would otherwise still contain references to our shared libs build
michael@1 236 %{l_shtool} mkdir -f -p -m 755 dynamic
michael@1 237 mv lib/* dynamic/
michael@1 238 ( cd qmake
michael@1 239 %{l_make} %{l_mflags} distclean
michael@1 240 ) || exit $?
michael@1 241 rm -f .qmake.cache
michael@1 242 %endif
michael@1 243
michael@1 244 # mandatory static build (follows optional shared build)
michael@1 245 echo 'yes' | ./configure \
michael@1 246 -prefix %{l_prefix} \
michael@1 247 -bindir %{l_prefix}/bin \
michael@1 248 -libdir %{l_prefix}/lib \
michael@1 249 -docdir %{l_prefix}/share/qt/doc \
michael@1 250 -headerdir %{l_prefix}/include \
michael@1 251 -plugindir %{l_prefix}/share/qt/plugins \
michael@1 252 -datadir %{l_prefix}/share/qt \
michael@1 253 -translationdir %{l_prefix}/share/qt/translations \
michael@1 254 -sysconfdir %{l_prefix}/etc/qt \
michael@1 255 -examplesdir %{l_prefix}/share/qt/examples \
michael@1 256 -demosdir %{l_prefix}/share/qt/demos \
michael@1 257 -release \
michael@1 258 -static \
michael@1 259 -platform $platcomp \
michael@1 260 -no-sql-ibase \
michael@3 261 -qt-sql-mysql \
michael@1 262 -no-sql-odbc \
michael@1 263 -no-sql-psql \
michael@1 264 -no-sql-sqlite2 \
michael@1 265 -qt-sql-sqlite \
michael@1 266 -system-sqlite \
michael@3 267 -openssl-linked \
michael@1 268 -xmlpatterns \
michael@1 269 -svg \
michael@1 270 -no-webkit \
michael@1 271 -system-zlib \
michael@1 272 -qt-gif \
michael@1 273 -system-libpng \
michael@1 274 -system-libmng \
michael@1 275 -system-libjpeg \
michael@1 276 -system-libtiff \
michael@1 277 -rpath \
michael@1 278 -no-cups \
michael@1 279 -iconv \
michael@1 280 -pch \
michael@1 281 -dbus-linked \
michael@1 282 -opengl \
michael@1 283 -xrender \
michael@1 284 -fontconfig \
michael@1 285 -freetype \
michael@3 286 -no-glib
michael@1 287
michael@1 288 # default options are implicitly used, und zwar...
michael@1 289 #-no-fast -exceptions -accessibility -stl -qt3support -nis
michael@1 290 #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
michael@1 291
michael@1 292 # carry out static build procedure
michael@1 293 %{l_make} %{l_mflags -O} sub-src
michael@1 294 %if "%{with_tools}" == "yes"
michael@1 295 %{l_make} %{l_mflags -O} sub-tools
michael@1 296 %endif
michael@1 297 %if "%{with_examples}" == "yes"
michael@1 298 %{l_make} %{l_mflags -O} \
michael@1 299 sub-demos-make_default-ordered \
michael@1 300 sub-examples-make_default-ordered
michael@1 301 %endif
michael@1 302
michael@1 303 %install
michael@1 304 rm -rf $RPM_BUILD_ROOT
michael@1 305
michael@1 306 # carry out installation procedure
michael@1 307 targets="sub-moc-install_subtargets-ordered \
michael@1 308 sub-rcc-install_subtargets-ordered \
michael@1 309 sub-uic-install_subtargets-ordered \
michael@1 310 sub-corelib-install_subtargets-ordered \
michael@1 311 sub-xml-install_subtargets-ordered \
michael@1 312 sub-network-install_subtargets-ordered \
michael@1 313 sub-gui-install_subtargets-ordered \
michael@1 314 sub-sql-install_subtargets-ordered \
michael@1 315 sub-script-install_subtargets-ordered \
michael@1 316 sub-testlib-install_subtargets-ordered \
michael@1 317 sub-qt3support-install_subtargets-ordered \
michael@1 318 sub-dbus-install_subtargets-ordered \
michael@1 319 sub-uic3-install_subtargets-ordered \
michael@1 320 sub-opengl-install_subtargets-ordered \
michael@1 321 sub-xmlpatterns-install_subtargets-ordered \
michael@1 322 sub-svg-install_subtargets-ordered \
michael@1 323 sub-plugins-install_subtargets-ordered"
michael@1 324 %if "%{with_tools}" == "yes"
michael@1 325 targets="$targets sub-tools-install_subtargets-ordered"
michael@1 326 %endif
michael@1 327 %if "%{with_examples}" == "yes"
michael@1 328 targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered"
michael@1 329 %endif
michael@3 330 targets="$targets install_htmldocs install_qchdocs install_docimages install_translations install_qmake install_mkspecs"
michael@1 331 %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT"
michael@1 332
michael@1 333 %if "%{with_shared}" == "yes"
michael@1 334 # install shared libs and symlinks
michael@1 335 %{l_shtool} mkdir -f -p -m 755 \
michael@1 336 $RPM_BUILD_ROOT%{l_prefix}/lib/qt
michael@1 337 %{l_tar} cf - dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
michael@1 338
michael@1 339 # explain nonstandard shared library placement
michael@1 340 ( echo "This directory contains optional shared libraries as"
michael@1 341 echo "defined by the OpenPKG build specification. Although"
michael@1 342 echo "shared libraries are only optionally built (see the"
michael@1 343 echo "build time 'with_shared yes' option), static libraries"
michael@1 344 echo "are built and installed in the parent 'lib' directory."
michael@1 345 ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README
michael@1 346
michael@1 347 # do not support pkg-config(1) with shared libs
michael@1 348 rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/qt/pkgconfig
michael@1 349
michael@1 350 # remove temporary dynamic link paths
michael@1 351 %{l_shtool} subst \
michael@1 352 -e 's;\(QMAKE_PRL_BUILD_DIR[^=][^=]*=\).*\(qt-x11-opensource-src.*\);\1 /tmp/\2;' \
michael@1 353 $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl
michael@1 354 %endif
michael@1 355
michael@1 356 # determine internal file listing
michael@1 357 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@1 358 %{l_files_std} \
michael@1 359 '%doc %{l_prefix}/share/qt/doc/*' \
michael@1 360 '%not %dir %{l_prefix}/lib/pkgconfig'
michael@1 361
michael@1 362 %files -f files
michael@1 363
michael@1 364 %clean
michael@1 365 rm -rf $RPM_BUILD_ROOT
michael@1 366

mercurial