qt/qt.spec

Sat, 23 Oct 2010 01:34:51 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 23 Oct 2010 01:34:51 +0200
changeset 288
74a0826c1949
parent 266
00db87db5e04
child 289
1ff6f25dc4d9
permissions
-rw-r--r--

Correct javascript core and mysql with ssl buildconf, add glib option.

michael@1 1 ##
michael@1 2 ## qt.spec -- OpenPKG RPM Specification
michael@257 3 ## Copyright (c) 2010 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@86 24 # FIXME: MSvB: It appears that bugs in current versions of binutils
michael@86 25 # FIXME: MSvB: fail to properly link Qt object code, resulting in
michael@86 26 # FIXME: MSvB: 'ld: libQt*.so: pthread_mutex...: invalid version 6
michael@86 27 # FIXME: MSvB: libQt*.so: could not read symbols: Bad value'
michael@86 28 # FIXME: MSvB: The effects of these bugs are platform dependent.
michael@86 29 # FIXME: MSvB: Solaris 11 IA-32 builds fail while Linux 2.6.25.18
michael@86 30 # FIXME: MSvB: AMD64 builds succeed.
michael@1 31
michael@1 32 # package information
michael@1 33 Name: qt
michael@213 34 Summary: Cross Platform Application Framework
michael@1 35 URL: http://www.trolltech.com/products/qt/
michael@1 36 Vendor: Nokia Corporation
michael@1 37 Packager: Michael Schloh von Bennewitz
michael@1 38 Distribution: MSvB Recherche Production
michael@1 39 Class: EVAL
michael@1 40 Group: Development
michael@1 41 License: GPL
michael@257 42 Version: 4.7.0
michael@288 43 Release: 20101018
michael@1 44
michael@1 45 # build options
michael@1 46 %option with_tools yes
michael@288 47 %option with_glib no
michael@65 48 %option with_mysql no
michael@65 49 %option with_pgsql no
michael@1 50 %option with_shared no
michael@1 51 %option with_examples no
michael@1 52
michael@1 53 # list of sources
michael@257 54 Source0: ftp://ftp.qt.nokia.com/qt/source/qt-everywhere-opensource-src-%{version}.tar.gz
michael@1 55
michael@1 56 # build information
michael@1 57 Prefix: %{l_prefix}
michael@1 58 BuildRoot: %{l_buildroot}
michael@4 59 BuildPreReq: OpenPKG, openpkg >= 20050726, make, gcc, pkgconfig
michael@1 60 PreReq: OpenPKG, openpkg >= 20050726
michael@1 61 BuildPreReq: X11, png, mng, jpeg, tiff, mesa, xrender
michael@1 62 PreReq: X11, png, mng, jpeg, tiff, mesa, xrender
michael@3 63 BuildPreReq: openssl, zlib, libiconv, sqlite, dbus
michael@3 64 PreReq: openssl, zlib, libiconv, sqlite, dbus
michael@1 65 BuildPreReq: fontconfig, freetype
michael@1 66 PreReq: fontconfig, freetype
michael@288 67 %if "%{with_glib}" == "yes"
michael@288 68 BuildPreReq: glib2
michael@288 69 PreReq: glib2
michael@288 70 %endif
michael@65 71 %if "%{with_mysql}" == "yes"
michael@65 72 BuildPreReq: mysql
michael@65 73 PreReq: mysql
michael@65 74 %endif
michael@65 75 %if "%{with_pgsql}" == "yes"
michael@65 76 BuildPreReq: postgresql
michael@65 77 PreReq: postgresql
michael@65 78 %endif
michael@1 79 AutoReq: no
michael@1 80 AutoReqProv: no
michael@1 81 Provides: QTSDK
michael@1 82
michael@1 83 %description
michael@3 84 Qt is a comprehensive C++ framework for cross-platform application
michael@3 85 development. Using Qt, you can develop applications and user
michael@3 86 interfaces once, and deploy them across many desktop and embedded
michael@86 87 operating systems without rewriting the source code. This package
michael@86 88 distribution builds all modules of the Qt/X11 Open Source Edition.
michael@1 89
michael@1 90 %track
michael@1 91 prog qt = {
michael@1 92 version = %{version}
michael@263 93 url = ftp://ftp.qt.nokia.com/qt/source/
michael@257 94 regex = qt-everywhere-opensource-src-(__VER__)\.tar\.gz
michael@1 95 }
michael@1 96
michael@1 97 %prep
michael@1 98 # announce exceptional build requirements
michael@257 99 ( echo "This package has exceptional build requirements:"
michael@264 100 echo " qt-%{version}-root (4,5 Go)"
michael@263 101 echo " qt-everywhere-opensource-src-%{version} (5,5 Go)"
michael@263 102 echo " qt-%{version}-<date>.<arch>-<os>-<tag>.rpm (2 Go)"
michael@263 103 echo "Building with no options takes 2,0 hours on a dual core"
michael@264 104 echo "2 GHz CPU, or 5 hours with all build options enabled."
michael@1 105 ) | %{l_rpmtool} msg -b -t notice
michael@1 106
michael@257 107 %setup -q -n qt-everywhere-opensource-src-%{version}
michael@1 108 x11_incdir=`%{l_rc} --query x11_incdir`
michael@1 109 x11_libdir=`%{l_rc} --query x11_libdir`
michael@92 110 fontconflibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig`
michael@257 111 lcmslibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static lcms`
michael@92 112 openssllibs=`%{l_prefix}/bin/pkg-config --libs --static openssl`
michael@288 113 mysqllibs=`%{l_prefix}/bin/mysql_config --libs`
michael@92 114
michael@1 115 loclibs=''
michael@1 116 case "%{l_platform -t}" in
michael@1 117 *-sunos* )
michael@1 118 loclibs='-lsocket -lnsl'
michael@1 119 ;;
michael@1 120 esac
michael@1 121 ( cd mkspecs/qws
michael@1 122 for plat in freebsd-generic-g++ macx-generic-g++ solaris-generic-g++;
michael@266 123 do
michael@1 124 ln -s $plat `echo $plat | %{l_shtool} subst -e 's;\(.*\)-generic-\(.*\);\1-x86-\2;'`
michael@1 125 done
michael@1 126 ) || exit $?
michael@1 127 %{l_shtool} subst \
michael@92 128 -e 's;\(-z[\t ][\t ]*\)\([^\t \"][^\t \"]*\);\1"\2";g' \
michael@1 129 configure
michael@1 130 %{l_shtool} subst \
michael@263 131 -e 's;\(RPATH_FLAGS\)=.*\$QT_INSTALL_LIBS.*\(\$RPATH_FLAGS\)";\1="%{l_prefix}/lib/qt/dynamic \2";' \
michael@264 132 -e 's;\(QMAKE_RPATHDIR +=\) \\"\$QT_INSTALL_LIBS\\";\1 %{l_prefix}/lib/qt/dynamic;' \
michael@263 133 configure
michael@263 134 %{l_shtool} subst \
michael@288 135 -e "s;\(OPENSSL_LIBS *=\) *-lssl -lcrypto;\1 $openssllibs;" \
michael@92 136 configure
michael@92 137 %{l_shtool} subst \
michael@288 138 -e 's; *QMakeVar set QMAKE_CFLAGS_X11.*QT_CFLAGS_FONTCONFIG.*;;' \
michael@288 139 configure
michael@288 140 # yes this is needed several times to catch nested occurences of '--libs'
michael@288 141 %{l_shtool} subst \
michael@288 142 -e 's;\(QT_LIBS_FONTCONFIG *=.*PKG_CONFIG.*\) --libs ;\1 --libs-only-L ;g' \
michael@288 143 -e 's;\(QT_LIBS_FONTCONFIG *=.*PKG_CONFIG.*\) --libs ;\1 --libs-only-L ;g' \
michael@1 144 configure
michael@257 145 # yes this is needed several times to catch nested occurences of '--cflags'
michael@288 146 # QT_CFLAGS_SQLITE
michael@288 147 # QT_CFLAGS_DBUS
michael@288 148 # QT_CFLAGS_GLIB ***Special case, see following substitution block
michael@288 149 # QT_CFLAGS_GSTREAMER
michael@288 150 # QT_CFLAGS_ICD
michael@288 151 # QT_CFLAGS_QTNETWORK
michael@288 152 # QT_CFLAGS_PULSEAUDIO
michael@288 153 # QT_CFLAGS_FONTCONFIG
michael@288 154 # QT_CFLAGS_QGTKSTYLE
michael@288 155 # QT_CFLAGS_DIRECTFB
michael@257 156 %{l_shtool} subst \
michael@257 157 -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \
michael@257 158 -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \
michael@257 159 configure
michael@288 160 # hack to get back the standard '--cflags' of just Qt_CFLAGS_GLIB
michael@288 161 %{l_shtool} subst \
michael@288 162 -e 's;\(QT_CFLAGS_GLIB *=.*PKG_CONFIG.*\) --cflags-only-other ;\1 --cflags ;g' \
michael@288 163 configure
michael@1 164 %{l_shtool} subst \
michael@1 165 -e 's;\(TRY_INCLUDEPATHS = \).*\(\$\$INCLUDEPATH\);\1\2;' \
michael@1 166 -e 's;/freetype2;/freetype;' \
michael@1 167 config.tests/unix/freetype/freetype.pri
michael@1 168 %{l_shtool} subst \
michael@257 169 -e "s;\(LIBS.*=.*-lmng\);\1 $lcmslibs;" \
michael@257 170 src/gui/image/qmnghandler.pri
michael@257 171 %{l_shtool} subst \
michael@92 172 -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconflibs;" \
michael@1 173 config.tests/x11/fontconfig/fontconfig.pro
michael@213 174 echo 'INCLUDEPATH += /usr/include/wacomcfg' \
michael@213 175 >>src/gui/kernel/x11.pri
michael@257 176 echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \
michael@257 177 >>src/gui/kernel/x11.pri
michael@257 178 echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \
michael@257 179 >>src/gui/text/text.pri
michael@257 180 echo "INCLUDEPATH = `%{l_prefix}/bin/pkg-config --cflags-only-I dbus-1 | %{l_shtool} subst -e 's;\-I;;g'`" \
michael@257 181 >>config.tests/unix/dbus/dbus.pro
michael@257 182 echo "LIBS = `%{l_prefix}/bin/pkg-config --libs-only-l --static dbus-1`" \
michael@257 183 >>config.tests/unix/dbus/dbus.pro
michael@1 184 %{l_shtool} subst \
michael@257 185 -e "s;\(LIBS.*= -lpq\);\1 `%{l_prefix}/bin/pg_config --libs` $loclibs;" \
michael@1 186 config.tests/unix/psql/psql.pro
michael@1 187 %{l_shtool} subst \
michael@257 188 -e 's;^mac[^:][^:]*:\(LIBS\);\1;' \
michael@1 189 config.tests/unix/iconv/iconv.pro
michael@257 190 uiclibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig lcms`
michael@1 191 %{l_shtool} subst \
michael@65 192 -e 's;LIBS .*= -lpq$;LIBS += -lpq -lssl -lcrypto;' \
michael@288 193 -e "s;LIBS .*= \$\$QT_LFLAGS_MYSQL;LIBS += $mysqllibs;" \
michael@65 194 src/sql/drivers/drivers.pri
michael@65 195 %{l_shtool} subst \
michael@86 196 -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" \
michael@86 197 src/corelib/kernel/kernel.pri \
michael@86 198 src/gui/kernel/kernel.pri
michael@86 199 %{l_shtool} subst \
michael@86 200 -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_PSQL;INCPATH += `pg_config --includedir 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \
michael@86 201 -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_MYSQL;INCPATH += `mysql_config --include 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \
michael@86 202 -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" \
michael@257 203 -e 's;!static:\(!isEmpty(QT_LFLAGS_PSQL)\);\1;' \
michael@257 204 -e 's;!static:\(LIBS \*= \$\$QT_LFLAGS_PSQL\);\1;' \
michael@92 205 src/plugins/sqldrivers/mysql/mysql.pro \
michael@92 206 src/plugins/sqldrivers/psql/psql.pro \
michael@92 207 src/plugins/sqldrivers/sqlite/sqlite.pro \
michael@86 208 src/sql/drivers/drivers.pri
michael@86 209 %{l_shtool} subst \
michael@86 210 -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" \
michael@86 211 src/dbus/dbus.pro
michael@86 212 %{l_shtool} subst \
michael@1 213 -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \
michael@263 214 -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1;' \
michael@1 215 -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \
michael@86 216 -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2;" \
michael@1 217 -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \
michael@1 218 mkspecs/qws/*/qmake.conf \
michael@1 219 mkspecs/*/*.conf
michael@1 220 %{l_shtool} subst \
michael@3 221 -e 's;^\(QMAKE_LIBS +=.*\);\1 -liconv;' \
michael@3 222 src/corelib/corelib.pro
michael@3 223 %{l_shtool} subst \
michael@266 224 -e 's;\(DESTDIR *=\) *\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;' \
michael@266 225 src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro
michael@266 226 %{l_shtool} subst \
michael@266 227 -e 's;\(pathToJavaScriptCoreOutput *=\) *\$\$ARGS/\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;g' \
michael@266 228 src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
michael@266 229 %{l_shtool} subst \
michael@86 230 -e "s;^\(QMAKE_INCDIR_X11[^=]*=\).*;\1 %{l_prefix}/include $x11_incdir;" \
michael@86 231 -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\).*;\1 %{l_prefix}/lib $x11_libdir;" \
michael@1 232 mkspecs/qws/solaris*/qmake.conf \
michael@1 233 mkspecs/solaris*/qmake.conf
michael@263 234 echo "QMAKE_LIBDIR += %{l_prefix}/lib/qt/dynamic" \
michael@263 235 >>mkspecs/features/shared.prf
michael@1 236 %{l_shtool} subst \
michael@1 237 -e 's; *\.\./3rdparty/freetype/.*;;g' \
michael@1 238 -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \
michael@1 239 src/gui/text/text.pri
michael@1 240 %{l_shtool} subst \
michael@1 241 -e 's;\(#include *"\)\(tiffio.h"\);\1tiff/\2;' \
michael@257 242 src/gui/image/qtiffhandler.cpp
michael@92 243 %{l_shtool} subst \
michael@92 244 -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \
michael@92 245 tools/qtconfig/qtconfig.pro
michael@265 246 %{l_shtool} subst \
michael@265 247 -e 's;webkit;web-broken-kit;g' \
michael@265 248 tools/assistant/tools/assistant/assistant.pro
michael@265 249 echo "DEFINES += QT_NO_WEBKIT" \
michael@265 250 >>tools/assistant/tools/assistant/assistant.pro
michael@263 251 %{l_shtool} subst \
michael@264 252 -e "s;Qt.s Classes;All Classes;" \
michael@263 253 tools/assistant/tools/assistant/doc/assistant.qdoc \
michael@263 254 tools/qdoc3/doc/qdoc-manual.qdoc \
michael@263 255 tools/qdoc3/doc/files/qt.qdocconf \
michael@263 256 tools/qdoc3/test/qt-build-docs.qdocconf \
michael@263 257 tools/qdoc3/test/qt.qdocconf
michael@1 258
michael@1 259 %build
michael@1 260 # protect against sloppy code inclusion of all unused subprojects
michael@257 261 (cd src/3rdparty && rm -rf [^cdehjmswxz]* sql* win* zlib zlib.pri) || exit $?
michael@1 262
michael@92 263 # detect which platform for which to build
michael@1 264 case "%{l_platform -t}" in
michael@86 265 sun4[uv]-sunos* | amd64-sunos* ) platcomp="solaris-g++-64" ;;
michael@86 266 i?86-sunos* ) platcomp="solaris-g++" ;;
michael@86 267 amd64-linux* ) platcomp="linux-g++-64" ;;
michael@86 268 i?86-linux* ) platcomp="linux-g++" ;;
michael@86 269 amd64-freebsd* | i?86-freebsd* ) platcomp="freebsd-g++" ;;
michael@86 270 *-aix* ) platcomp="aix-g++" ;;
michael@86 271 *-darwin* ) platcomp="macx-g++" ;;
michael@86 272 *-hpux* ) platcomp="hpux-g++" ;;
michael@86 273 *-irix* ) platcomp="irix-g++" ;;
michael@86 274 * ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;;
michael@1 275 esac
michael@1 276
michael@92 277 # detect which architecture extensions are available
michael@92 278 archflags=''
michael@92 279 case "%{l_platform -t}" in
michael@92 280 amd64-* )
michael@92 281 break
michael@92 282 ;;
michael@92 283 * )
michael@92 284 archflags='-no-sse2 -no-3dnow'
michael@92 285 ;;
michael@92 286 esac
michael@92 287
michael@1 288 %if "%{with_shared}" == "yes"
michael@1 289 # optional shared build (precedes mandatory static build)
michael@1 290 echo 'yes' | ./configure \
michael@92 291 $archflags \
michael@205 292 -opensource \
michael@1 293 -prefix %{l_prefix} \
michael@1 294 -bindir %{l_prefix}/bin \
michael@263 295 -libdir %{l_prefix}/lib/qt/dynamic \
michael@1 296 -docdir %{l_prefix}/share/qt/doc \
michael@1 297 -headerdir %{l_prefix}/include \
michael@86 298 -plugindir %{l_prefix}/lib/qt/plugins \
michael@1 299 -datadir %{l_prefix}/share/qt \
michael@1 300 -translationdir %{l_prefix}/share/qt/translations \
michael@1 301 -sysconfdir %{l_prefix}/etc/qt \
michael@1 302 -examplesdir %{l_prefix}/share/qt/examples \
michael@1 303 -demosdir %{l_prefix}/share/qt/demos \
michael@1 304 -release \
michael@1 305 -shared \
michael@1 306 -platform $platcomp \
michael@1 307 -no-sql-ibase \
michael@288 308 %if "%{with_glib}" == "yes"
michael@288 309 -glib \
michael@288 310 %else
michael@288 311 -no-glib \
michael@288 312 %endif
michael@65 313 %if "%{with_mysql}" == "yes"
michael@3 314 -qt-sql-mysql \
michael@86 315 -plugin-sql-mysql \
michael@65 316 %else
michael@65 317 -no-sql-mysql \
michael@65 318 %endif
michael@65 319 %if "%{with_pgsql}" == "yes"
michael@65 320 -qt-sql-psql \
michael@86 321 -plugin-sql-psql \
michael@65 322 %else
michael@65 323 -no-sql-psql \
michael@65 324 %endif
michael@1 325 -no-sql-odbc \
michael@65 326 -system-sqlite \
michael@65 327 -qt-sql-sqlite \
michael@86 328 -plugin-sql-sqlite \
michael@1 329 -no-sql-sqlite2 \
michael@3 330 -openssl-linked \
michael@288 331 -optimized-qmake \
michael@1 332 -xmlpatterns \
michael@1 333 -svg \
michael@215 334 -webkit \
michael@1 335 -system-zlib \
michael@1 336 -qt-gif \
michael@1 337 -system-libpng \
michael@1 338 -system-libmng \
michael@1 339 -system-libjpeg \
michael@1 340 -system-libtiff \
michael@1 341 -rpath \
michael@1 342 -no-cups \
michael@257 343 -iconv \
michael@1 344 -pch \
michael@1 345 -dbus-linked \
michael@1 346 -opengl \
michael@1 347 -xrender \
michael@1 348 -fontconfig \
michael@288 349 -freetype
michael@1 350
michael@86 351 # default options are implicitly used, for example...
michael@1 352 #-no-fast -exceptions -accessibility -stl -qt3support -nis
michael@1 353 #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
michael@1 354
michael@1 355 # carry out shared build procedure
michael@1 356 ( cd src
michael@1 357 %{l_make} %{l_mflags -O} \
michael@215 358 sub-moc sub-rcc sub-uic sub-uic3
michael@1 359 ) || exit $?
michael@257 360 %{l_make} %{l_mflags -O} \
michael@257 361 sub-corelib-make_default-ordered \
michael@257 362 sub-xml-make_default-ordered \
michael@257 363 sub-network-make_default-ordered \
michael@257 364 sub-sql-make_default-ordered \
michael@257 365 sub-testlib-make_default-ordered \
michael@257 366 sub-dbus-make_default-ordered \
michael@257 367 sub-gui-make_default-ordered \
michael@257 368 sub-qt3support-make_default-ordered \
michael@257 369 sub-opengl-make_default-ordered \
michael@257 370 sub-xmlpatterns-make_default-ordered \
michael@257 371 sub-multimedia-make_default-ordered \
michael@257 372 sub-svg-make_default-ordered \
michael@257 373 sub-script-make_default-ordered \
michael@257 374 sub-declarative-make_default-ordered \
michael@257 375 sub-javascriptcore-make_default-ordered \
michael@257 376 sub-webkit-make_default-ordered \
michael@257 377 sub-scripttools-make_default-ordered \
michael@257 378 sub-plugins-make_default-ordered \
michael@257 379 sub-imports-make_default-ordered \
michael@257 380 sub-webkitdeclarative-make_default-ordered \
michael@257 381 sub-translations-make_default-ordered
michael@205 382
michael@205 383 # arthur plugin requires libQtDesigner
michael@92 384 ( cd demos
michael@205 385 ( cd ../tools/designer/src/lib
michael@263 386 %{l_make} %{l_mflags -O}
michael@205 387 ) || exit $?
michael@92 388 %{l_make} %{l_mflags -O} sub-arthurplugin
michael@92 389 ) || exit $?
michael@1 390
michael@1 391 # cache shared libs and initialize the build configuration, which
michael@1 392 # would otherwise still contain references to our shared libs build
michael@263 393 %{l_shtool} mkdir -f -p -m 755 sharbuild/dynamic
michael@263 394 mv lib/* sharbuild/dynamic/
michael@263 395 mv plugins sharbuild/
michael@257 396 %{l_make} %{l_mflags} confclean
michael@1 397 %endif
michael@1 398
michael@1 399 # mandatory static build (follows optional shared build)
michael@1 400 echo 'yes' | ./configure \
michael@92 401 $archflags \
michael@205 402 -opensource \
michael@1 403 -prefix %{l_prefix} \
michael@1 404 -bindir %{l_prefix}/bin \
michael@1 405 -libdir %{l_prefix}/lib \
michael@1 406 -docdir %{l_prefix}/share/qt/doc \
michael@1 407 -headerdir %{l_prefix}/include \
michael@86 408 -plugindir %{l_prefix}/lib/qt/plugins \
michael@1 409 -datadir %{l_prefix}/share/qt \
michael@1 410 -translationdir %{l_prefix}/share/qt/translations \
michael@1 411 -sysconfdir %{l_prefix}/etc/qt \
michael@1 412 -examplesdir %{l_prefix}/share/qt/examples \
michael@1 413 -demosdir %{l_prefix}/share/qt/demos \
michael@1 414 -release \
michael@1 415 -static \
michael@1 416 -platform $platcomp \
michael@1 417 -no-sql-ibase \
michael@288 418 %if "%{with_glib}" == "yes"
michael@288 419 -glib \
michael@288 420 %else
michael@288 421 -no-glib \
michael@288 422 %endif
michael@65 423 %if "%{with_mysql}" == "yes"
michael@3 424 -qt-sql-mysql \
michael@65 425 %else
michael@65 426 -no-sql-mysql \
michael@65 427 %endif
michael@65 428 %if "%{with_pgsql}" == "yes"
michael@65 429 -qt-sql-psql \
michael@65 430 %else
michael@65 431 -no-sql-psql \
michael@65 432 %endif
michael@1 433 -no-sql-odbc \
michael@65 434 -system-sqlite \
michael@65 435 -qt-sql-sqlite \
michael@1 436 -no-sql-sqlite2 \
michael@3 437 -openssl-linked \
michael@288 438 -optimized-qmake \
michael@1 439 -xmlpatterns \
michael@1 440 -svg \
michael@265 441 -webkit \
michael@1 442 -system-zlib \
michael@1 443 -qt-gif \
michael@1 444 -system-libpng \
michael@1 445 -system-libmng \
michael@1 446 -system-libjpeg \
michael@1 447 -system-libtiff \
michael@1 448 -rpath \
michael@1 449 -no-cups \
michael@257 450 -iconv \
michael@1 451 -pch \
michael@1 452 -dbus-linked \
michael@1 453 -opengl \
michael@1 454 -xrender \
michael@1 455 -fontconfig \
michael@288 456 -freetype
michael@1 457
michael@86 458 # default options are implicitly used, for example...
michael@1 459 #-no-fast -exceptions -accessibility -stl -qt3support -nis
michael@1 460 #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
michael@1 461
michael@1 462 # carry out static build procedure
michael@258 463 %{l_make} %{l_mflags -O} sub-src
michael@1 464 %if "%{with_tools}" == "yes"
michael@258 465 %{l_make} %{l_mflags -O} \
michael@258 466 sub-tools-make_default-ordered sub-translations-make_default-ordered
michael@1 467 %endif
michael@1 468 %if "%{with_examples}" == "yes"
michael@1 469 %{l_make} %{l_mflags -O} \
michael@1 470 sub-demos-make_default-ordered \
michael@1 471 sub-examples-make_default-ordered
michael@1 472 %endif
michael@258 473 %if "%{with_tools}" == "yes"
michael@258 474 %{l_make} %{l_mflags -O} docs
michael@258 475 %else
michael@258 476 %if "%{with_examples}" == "yes"
michael@258 477 %{l_make} %{l_mflags -O} docs
michael@258 478 %endif
michael@258 479 %endif
michael@1 480
michael@1 481 %install
michael@1 482 rm -rf $RPM_BUILD_ROOT
michael@1 483
michael@1 484 # carry out installation procedure
michael@215 485 targets="sub-tools-bootstrap-install_subtargets-ordered \
michael@215 486 sub-moc-install_subtargets-ordered \
michael@1 487 sub-rcc-install_subtargets-ordered \
michael@1 488 sub-uic-install_subtargets-ordered \
michael@1 489 sub-corelib-install_subtargets-ordered \
michael@1 490 sub-xml-install_subtargets-ordered \
michael@1 491 sub-network-install_subtargets-ordered \
michael@257 492 sub-sql-install_subtargets-ordered \
michael@257 493 sub-testlib-install_subtargets-ordered \
michael@257 494 sub-dbus-install_subtargets-ordered \
michael@1 495 sub-gui-install_subtargets-ordered \
michael@1 496 sub-qt3support-install_subtargets-ordered \
michael@1 497 sub-uic3-install_subtargets-ordered \
michael@1 498 sub-opengl-install_subtargets-ordered \
michael@1 499 sub-xmlpatterns-install_subtargets-ordered \
michael@257 500 sub-multimedia-install_subtargets-ordered \
michael@1 501 sub-svg-install_subtargets-ordered \
michael@257 502 sub-script-install_subtargets-ordered \
michael@257 503 sub-declarative-install_subtargets-ordered \
michael@257 504 sub-scripttools-install_subtargets-ordered \
michael@257 505 sub-imports-install_subtargets-ordered \
michael@257 506 sub-translations-install_subtargets-ordered"
michael@257 507
michael@1 508 %if "%{with_tools}" == "yes"
michael@258 509 targets="$targets sub-tools-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
michael@1 510 %endif
michael@1 511 %if "%{with_examples}" == "yes"
michael@258 512 targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
michael@1 513 %endif
michael@258 514 targets="$targets install_qmake install_mkspecs"
michael@1 515 %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT"
michael@266 516 %{l_shtool} install -c -m 644 \
michael@266 517 lib/libjscore.a lib/libjscore.prl \
michael@266 518 $RPM_BUILD_ROOT%{l_prefix}/lib/
michael@1 519
michael@266 520 # correct paths in pkg-config(1) configuration files
michael@266 521 %{l_shtool} subst \
michael@266 522 -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};g" \
michael@266 523 $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/*
michael@266 524
michael@266 525 # install static or shared plugins according to user choice
michael@263 526 %if "%{with_shared}" != "yes"
michael@263 527 %{l_make} %{l_mflags} sub-plugins-install_subtargets-ordered INSTALL_ROOT="$RPM_BUILD_ROOT"
michael@263 528 %else
michael@264 529 %{l_tar} cf - -C sharbuild plugins | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
michael@263 530 %endif
michael@266 531
michael@1 532 %if "%{with_shared}" == "yes"
michael@1 533 # install shared libs and symlinks
michael@1 534 %{l_shtool} mkdir -f -p -m 755 \
michael@1 535 $RPM_BUILD_ROOT%{l_prefix}/lib/qt
michael@264 536 %{l_tar} cf - -C sharbuild dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
michael@1 537
michael@86 538 # offer limited support of pkg-config(1) for shared libs
michael@87 539 # substitution unfortunately only handles paths with no whitespace
michael@86 540 %{l_shtool} subst \
michael@266 541 -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L%{l_prefix}/lib/qt/dynamic;g" \
michael@257 542 -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};g" \
michael@87 543 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/*
michael@86 544
michael@1 545 # explain nonstandard shared library placement
michael@86 546 ( echo "This OpenPKG Qt build is using the with_shared option."
michael@86 547 echo ""
michael@263 548 echo "The directory %{l_prefix}/lib/qt/dynamic contains the"
michael@263 549 echo "requested shared libraries. Although shared libraries"
michael@263 550 echo "have been optionally built (see the build time"
michael@263 551 echo "'with_shared yes' option), static libraries were"
michael@263 552 echo "built by default as usual, and installed in the"
michael@86 553 echo "standard library directory %{l_prefix}/lib."
michael@86 554 echo ""
michael@86 555 echo "To build applications using shared libraries instead,"
michael@262 556 echo "please direct pkg-config(1) to use the proper definitions"
michael@86 557 echo "by setting the environment variable PKG_CONFIG_PATH to "
michael@86 558 echo "%{l_prefix}/lib/qt/dynamic/pkgconfig."
michael@263 559 echo ""
michael@263 560 echo "Note: If building via qmake(1), please append"
michael@263 561 echo " either 'static' or 'shared' to the line"
michael@263 562 echo " 'CONFIG +=' in the project file (name.pro)."
michael@263 563 echo " Then execute %{l_prefix}/bin/qmake on this file."
michael@1 564 ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README
michael@263 565 %endif
michael@1 566
michael@263 567 # correct temporary runtime link paths (static libs)
michael@1 568 %{l_shtool} subst \
michael@263 569 -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \
michael@257 570 -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}\(/[^\t ][^\t ]*\);-L\1%{l_prefix}\2;g" \
michael@263 571 $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl \
michael@263 572 $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
michael@263 573 %if "%{with_shared}" == "yes"
michael@263 574 # correct temporary runtime link paths (dynamic libs)
michael@263 575 %{l_shtool} subst \
michael@263 576 -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \
michael@263 577 -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L\1%{l_prefix}/lib/qt/dynamic;g" \
michael@92 578 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \
michael@92 579 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la
michael@1 580 %endif
michael@1 581
michael@259 582 ## Doesn't work as expected, because RPM reads the --[in|ex]cludedocs
michael@259 583 ## argument only when installing binary packages, rather than building.
michael@259 584 #%define _excludedocs 0
michael@259 585 #%define _includedocs 1
michael@259 586 # echo %{_excludedocs}
michael@259 587 # echo %{_includedocs}
michael@259 588 #
michael@259 589 ## Doesn't work as expected, because it seems that OpenPKG too mercilessly
michael@259 590 ## removes RPM readi1ng of the %docdir keyword in rpm.patch.feature.
michael@259 591 # %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@259 592 # %{l_files_std} \
michael@259 593 # '%docdir %{l_prefix}/share/pkg/doc'
michael@259 594 #
michael@259 595 ## Doesn't work as expected, because the rpmtool(1) marks
michael@259 596 ## only einzeln files as documents, skipping directories
michael@259 597 # %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@259 598 # %{l_files_std} \
michael@259 599 # '%doc %{l_prefix}/share/pkg/doc/doc.txt'
michael@259 600 #
michael@1 601 # determine internal file listing
michael@1 602 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@1 603 %{l_files_std} \
michael@1 604 '%not %dir %{l_prefix}/lib/pkgconfig'
michael@1 605
michael@1 606 %files -f files
michael@1 607
michael@1 608 %clean
michael@1 609 rm -rf $RPM_BUILD_ROOT
michael@1 610

mercurial