qt/qt.spec

Thu, 27 Nov 2008 14:27:51 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 27 Nov 2008 14:27:51 +0100
changeset 1
52e8b53d33be
child 3
c2e6bf16b6f4
permissions
-rw-r--r--

Import first revisions of package specifications.

michael@1 1 ##
michael@1 2 ## qt.spec -- OpenPKG RPM Specification
michael@1 3 ## Copyright (c) 2008 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@1 36 Release: 20081124
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@1 49 BuildPreReq: OpenPKG, openpkg >= 20050726, 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@1 53 BuildPreReq: zlib, libiconv, sqlite, dbus, glib2
michael@1 54 PreReq: zlib, libiconv, sqlite, dbus, glib2
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@1 62 Qt is a cross-platform application framework. Using Qt, you can
michael@1 63 develop applications and user interfaces once, and deploy them
michael@1 64 across many desktop and embedded operating systems without
michael@1 65 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@1 81 echo "2 GHz CPU, or 1,5 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@1 140 -e "s;^\(QMAKE_INCDIR_X11[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \
michael@1 141 -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2 $x11_supdir;" \
michael@1 142 mkspecs/qws/solaris*/qmake.conf \
michael@1 143 mkspecs/solaris*/qmake.conf
michael@1 144 %{l_shtool} subst \
michael@1 145 -e 's; *\.\./3rdparty/freetype/.*;;g' \
michael@1 146 -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \
michael@1 147 src/gui/text/text.pri
michael@1 148 %{l_shtool} subst \
michael@1 149 -e 's;\(#include *"\)\(tiffio.h"\);\1tiff/\2;' \
michael@1 150 src/plugins/imageformats/tiff/qtiffhandler.cpp
michael@1 151 # for projfile in `find examples/ -name '*.pro' -print`; do
michael@1 152 # echo 'CONFIG += release' >>$projfile
michael@1 153 # done
michael@1 154
michael@1 155 %build
michael@1 156 # protect against sloppy code inclusion of all unused subprojects
michael@1 157 rm -rf src/3rdparty/[^cdhmsw]* src/3rdparty/sql* src/3rdparty/win*
michael@1 158
michael@1 159 case "%{l_platform -t}" in
michael@1 160 *-aix* ) platcomp="aix-g++" ;;
michael@1 161 *-freebsd* ) platcomp="freebsd-g++" ;;
michael@1 162 *-hpux* ) platcomp="hpux-g++" ;;
michael@1 163 *-irix* ) platcomp="irix-g++" ;;
michael@1 164 *-linux* ) platcomp="linux-g++" ;;
michael@1 165 *-darwin* ) platcomp="macx-g++" ;;
michael@1 166 *-sunos* ) platcomp="solaris-g++" ;;
michael@1 167 * ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;;
michael@1 168 esac
michael@1 169
michael@1 170 %if "%{with_shared}" == "yes"
michael@1 171 # optional shared build (precedes mandatory static build)
michael@1 172 echo 'yes' | ./configure \
michael@1 173 -prefix %{l_prefix} \
michael@1 174 -bindir %{l_prefix}/bin \
michael@1 175 -libdir %{l_prefix}/lib/qt \
michael@1 176 -docdir %{l_prefix}/share/qt/doc \
michael@1 177 -headerdir %{l_prefix}/include \
michael@1 178 -plugindir %{l_prefix}/share/qt/plugins \
michael@1 179 -datadir %{l_prefix}/share/qt \
michael@1 180 -translationdir %{l_prefix}/share/qt/translations \
michael@1 181 -sysconfdir %{l_prefix}/etc/qt \
michael@1 182 -examplesdir %{l_prefix}/share/qt/examples \
michael@1 183 -demosdir %{l_prefix}/share/qt/demos \
michael@1 184 -release \
michael@1 185 -shared \
michael@1 186 -platform $platcomp \
michael@1 187 -no-sql-ibase \
michael@1 188 -no-sql-mysql \
michael@1 189 -no-sql-odbc \
michael@1 190 -no-sql-psql \
michael@1 191 -no-sql-sqlite2 \
michael@1 192 -qt-sql-sqlite \
michael@1 193 -system-sqlite \
michael@1 194 -xmlpatterns \
michael@1 195 -svg \
michael@1 196 -no-webkit \
michael@1 197 -system-zlib \
michael@1 198 -qt-gif \
michael@1 199 -system-libpng \
michael@1 200 -system-libmng \
michael@1 201 -system-libjpeg \
michael@1 202 -system-libtiff \
michael@1 203 -rpath \
michael@1 204 -no-cups \
michael@1 205 -iconv \
michael@1 206 -pch \
michael@1 207 -dbus-linked \
michael@1 208 -opengl \
michael@1 209 -xrender \
michael@1 210 -fontconfig \
michael@1 211 -freetype \
michael@1 212 -glib
michael@1 213
michael@1 214 # default options are implicitly used, und zwar...
michael@1 215 #-no-fast -exceptions -accessibility -stl -qt3support -nis
michael@1 216 #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
michael@1 217
michael@1 218 # carry out shared build procedure
michael@1 219 ( cd src
michael@1 220 %{l_make} %{l_mflags -O} \
michael@1 221 sub-moc sub-rcc sub-uic
michael@1 222 %{l_make} %{l_mflags -O} \
michael@1 223 sub-corelib sub-xml sub-network sub-gui sub-sql \
michael@1 224 sub-script sub-testlib sub-qt3support sub-dbus \
michael@1 225 sub-opengl sub-xmlpatterns sub-svg sub-plugins
michael@1 226 ) || exit $?
michael@1 227
michael@1 228 # cache shared libs and initialize the build configuration, which
michael@1 229 # would otherwise still contain references to our shared libs build
michael@1 230 %{l_shtool} mkdir -f -p -m 755 dynamic
michael@1 231 mv lib/* dynamic/
michael@1 232 ( cd qmake
michael@1 233 %{l_make} %{l_mflags} distclean
michael@1 234 ) || exit $?
michael@1 235 rm -f .qmake.cache
michael@1 236 %endif
michael@1 237
michael@1 238 # mandatory static build (follows optional shared build)
michael@1 239 echo 'yes' | ./configure \
michael@1 240 -prefix %{l_prefix} \
michael@1 241 -bindir %{l_prefix}/bin \
michael@1 242 -libdir %{l_prefix}/lib \
michael@1 243 -docdir %{l_prefix}/share/qt/doc \
michael@1 244 -headerdir %{l_prefix}/include \
michael@1 245 -plugindir %{l_prefix}/share/qt/plugins \
michael@1 246 -datadir %{l_prefix}/share/qt \
michael@1 247 -translationdir %{l_prefix}/share/qt/translations \
michael@1 248 -sysconfdir %{l_prefix}/etc/qt \
michael@1 249 -examplesdir %{l_prefix}/share/qt/examples \
michael@1 250 -demosdir %{l_prefix}/share/qt/demos \
michael@1 251 -release \
michael@1 252 -static \
michael@1 253 -platform $platcomp \
michael@1 254 -no-sql-ibase \
michael@1 255 -no-sql-mysql \
michael@1 256 -no-sql-odbc \
michael@1 257 -no-sql-psql \
michael@1 258 -no-sql-sqlite2 \
michael@1 259 -qt-sql-sqlite \
michael@1 260 -system-sqlite \
michael@1 261 -xmlpatterns \
michael@1 262 -svg \
michael@1 263 -no-webkit \
michael@1 264 -system-zlib \
michael@1 265 -qt-gif \
michael@1 266 -system-libpng \
michael@1 267 -system-libmng \
michael@1 268 -system-libjpeg \
michael@1 269 -system-libtiff \
michael@1 270 -rpath \
michael@1 271 -no-cups \
michael@1 272 -iconv \
michael@1 273 -pch \
michael@1 274 -dbus-linked \
michael@1 275 -opengl \
michael@1 276 -xrender \
michael@1 277 -fontconfig \
michael@1 278 -freetype \
michael@1 279 -glib
michael@1 280
michael@1 281 # default options are implicitly used, und zwar...
michael@1 282 #-no-fast -exceptions -accessibility -stl -qt3support -nis
michael@1 283 #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
michael@1 284
michael@1 285 # carry out static build procedure
michael@1 286 %{l_make} %{l_mflags -O} sub-src
michael@1 287 %if "%{with_tools}" == "yes"
michael@1 288 %{l_make} %{l_mflags -O} sub-tools
michael@1 289 %endif
michael@1 290 %if "%{with_examples}" == "yes"
michael@1 291 %{l_make} %{l_mflags -O} \
michael@1 292 sub-demos-make_default-ordered \
michael@1 293 sub-examples-make_default-ordered
michael@1 294 %endif
michael@1 295
michael@1 296 %install
michael@1 297 rm -rf $RPM_BUILD_ROOT
michael@1 298
michael@1 299 # carry out installation procedure
michael@1 300 targets="sub-moc-install_subtargets-ordered \
michael@1 301 sub-rcc-install_subtargets-ordered \
michael@1 302 sub-uic-install_subtargets-ordered \
michael@1 303 sub-corelib-install_subtargets-ordered \
michael@1 304 sub-xml-install_subtargets-ordered \
michael@1 305 sub-network-install_subtargets-ordered \
michael@1 306 sub-gui-install_subtargets-ordered \
michael@1 307 sub-sql-install_subtargets-ordered \
michael@1 308 sub-script-install_subtargets-ordered \
michael@1 309 sub-testlib-install_subtargets-ordered \
michael@1 310 sub-qt3support-install_subtargets-ordered \
michael@1 311 sub-dbus-install_subtargets-ordered \
michael@1 312 sub-uic3-install_subtargets-ordered \
michael@1 313 sub-opengl-install_subtargets-ordered \
michael@1 314 sub-xmlpatterns-install_subtargets-ordered \
michael@1 315 sub-svg-install_subtargets-ordered \
michael@1 316 sub-plugins-install_subtargets-ordered"
michael@1 317 %if "%{with_tools}" == "yes"
michael@1 318 targets="$targets sub-tools-install_subtargets-ordered"
michael@1 319 %endif
michael@1 320 %if "%{with_examples}" == "yes"
michael@1 321 targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered"
michael@1 322 %endif
michael@1 323 targets="$targets install_htmldocs install_translations install_qmake install_mkspecs"
michael@1 324 %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT"
michael@1 325
michael@1 326 %if "%{with_shared}" == "yes"
michael@1 327 # install shared libs and symlinks
michael@1 328 %{l_shtool} mkdir -f -p -m 755 \
michael@1 329 $RPM_BUILD_ROOT%{l_prefix}/lib/qt
michael@1 330 %{l_tar} cf - dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
michael@1 331
michael@1 332 # explain nonstandard shared library placement
michael@1 333 ( echo "This directory contains optional shared libraries as"
michael@1 334 echo "defined by the OpenPKG build specification. Although"
michael@1 335 echo "shared libraries are only optionally built (see the"
michael@1 336 echo "build time 'with_shared yes' option), static libraries"
michael@1 337 echo "are built and installed in the parent 'lib' directory."
michael@1 338 ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README
michael@1 339
michael@1 340 # do not support pkg-config(1) with shared libs
michael@1 341 rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/qt/pkgconfig
michael@1 342
michael@1 343 # remove temporary dynamic link paths
michael@1 344 %{l_shtool} subst \
michael@1 345 -e 's;\(QMAKE_PRL_BUILD_DIR[^=][^=]*=\).*\(qt-x11-opensource-src.*\);\1 /tmp/\2;' \
michael@1 346 $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl
michael@1 347 %endif
michael@1 348
michael@1 349 # determine internal file listing
michael@1 350 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@1 351 %{l_files_std} \
michael@1 352 '%doc %{l_prefix}/share/qt/doc/*' \
michael@1 353 '%not %dir %{l_prefix}/lib/pkgconfig'
michael@1 354
michael@1 355 %files -f files
michael@1 356
michael@1 357 %clean
michael@1 358 rm -rf $RPM_BUILD_ROOT
michael@1 359

mercurial