Sun, 03 Apr 2011 13:34:55 +0200
Correct and improve several packaging aspects including...
Correct datadir path for python modules, correct jar(1) path for
building libgcj classes, strip libexecdir path of version numbers,
improve name of oblbld build path, clean whitespace from as(1) and
ld(1) GNU detection, remove seemingly discarded '--with-local-prefix'
configure argument, and correct hardcoded lto plugin libtool archive
dependency information.
Most importantly, correct IA32 architecture detection logic in
config.gcc to correctly emit SSE2 instructions conditionally, leading
to the removal of all '-march' bootstrap options and replacement with
unconditional (for IA32/AMD64) '-mtune=native' options. Comments and
buildtime warnings are corrected appropriately. In theory these changes
cause a more portable, orthoganal, and optimal bootstrap to be built.
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@257 | 146 | %{l_shtool} subst \ |
michael@257 | 147 | -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \ |
michael@257 | 148 | -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \ |
michael@257 | 149 | configure |
michael@288 | 150 | # hack to get back the standard '--cflags' of just Qt_CFLAGS_GLIB |
michael@288 | 151 | %{l_shtool} subst \ |
michael@288 | 152 | -e 's;\(QT_CFLAGS_GLIB *=.*PKG_CONFIG.*\) --cflags-only-other ;\1 --cflags ;g' \ |
michael@288 | 153 | configure |
michael@1 | 154 | %{l_shtool} subst \ |
michael@1 | 155 | -e 's;\(TRY_INCLUDEPATHS = \).*\(\$\$INCLUDEPATH\);\1\2;' \ |
michael@1 | 156 | -e 's;/freetype2;/freetype;' \ |
michael@1 | 157 | config.tests/unix/freetype/freetype.pri |
michael@1 | 158 | %{l_shtool} subst \ |
michael@257 | 159 | -e "s;\(LIBS.*=.*-lmng\);\1 $lcmslibs;" \ |
michael@257 | 160 | src/gui/image/qmnghandler.pri |
michael@257 | 161 | %{l_shtool} subst \ |
michael@92 | 162 | -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconflibs;" \ |
michael@1 | 163 | config.tests/x11/fontconfig/fontconfig.pro |
michael@213 | 164 | echo 'INCLUDEPATH += /usr/include/wacomcfg' \ |
michael@213 | 165 | >>src/gui/kernel/x11.pri |
michael@257 | 166 | echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \ |
michael@257 | 167 | >>src/gui/kernel/x11.pri |
michael@257 | 168 | echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \ |
michael@257 | 169 | >>src/gui/text/text.pri |
michael@257 | 170 | echo "INCLUDEPATH = `%{l_prefix}/bin/pkg-config --cflags-only-I dbus-1 | %{l_shtool} subst -e 's;\-I;;g'`" \ |
michael@257 | 171 | >>config.tests/unix/dbus/dbus.pro |
michael@257 | 172 | echo "LIBS = `%{l_prefix}/bin/pkg-config --libs-only-l --static dbus-1`" \ |
michael@257 | 173 | >>config.tests/unix/dbus/dbus.pro |
michael@1 | 174 | %{l_shtool} subst \ |
michael@257 | 175 | -e "s;\(LIBS.*= -lpq\);\1 `%{l_prefix}/bin/pg_config --libs` $loclibs;" \ |
michael@1 | 176 | config.tests/unix/psql/psql.pro |
michael@1 | 177 | %{l_shtool} subst \ |
michael@257 | 178 | -e 's;^mac[^:][^:]*:\(LIBS\);\1;' \ |
michael@1 | 179 | config.tests/unix/iconv/iconv.pro |
michael@257 | 180 | uiclibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig lcms` |
michael@1 | 181 | %{l_shtool} subst \ |
michael@65 | 182 | -e 's;LIBS .*= -lpq$;LIBS += -lpq -lssl -lcrypto;' \ |
michael@288 | 183 | -e "s;LIBS .*= \$\$QT_LFLAGS_MYSQL;LIBS += $mysqllibs;" \ |
michael@65 | 184 | src/sql/drivers/drivers.pri |
michael@65 | 185 | %{l_shtool} subst \ |
michael@86 | 186 | -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 | 187 | src/corelib/kernel/kernel.pri \ |
michael@86 | 188 | src/gui/kernel/kernel.pri |
michael@86 | 189 | %{l_shtool} subst \ |
michael@86 | 190 | -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_PSQL;INCPATH += `pg_config --includedir 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \ |
michael@86 | 191 | -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_MYSQL;INCPATH += `mysql_config --include 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \ |
michael@86 | 192 | -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 | 193 | -e 's;!static:\(!isEmpty(QT_LFLAGS_PSQL)\);\1;' \ |
michael@257 | 194 | -e 's;!static:\(LIBS \*= \$\$QT_LFLAGS_PSQL\);\1;' \ |
michael@92 | 195 | src/plugins/sqldrivers/mysql/mysql.pro \ |
michael@92 | 196 | src/plugins/sqldrivers/psql/psql.pro \ |
michael@92 | 197 | src/plugins/sqldrivers/sqlite/sqlite.pro \ |
michael@86 | 198 | src/sql/drivers/drivers.pri |
michael@86 | 199 | %{l_shtool} subst \ |
michael@86 | 200 | -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 | 201 | src/dbus/dbus.pro |
michael@86 | 202 | %{l_shtool} subst \ |
michael@1 | 203 | -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \ |
michael@263 | 204 | -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1;' \ |
michael@1 | 205 | -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \ |
michael@86 | 206 | -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2;" \ |
michael@1 | 207 | -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \ |
michael@1 | 208 | mkspecs/qws/*/qmake.conf \ |
michael@1 | 209 | mkspecs/*/*.conf |
michael@1 | 210 | %{l_shtool} subst \ |
michael@3 | 211 | -e 's;^\(QMAKE_LIBS +=.*\);\1 -liconv;' \ |
michael@3 | 212 | src/corelib/corelib.pro |
michael@3 | 213 | %{l_shtool} subst \ |
michael@266 | 214 | -e 's;\(DESTDIR *=\) *\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;' \ |
michael@266 | 215 | src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro |
michael@266 | 216 | %{l_shtool} subst \ |
michael@266 | 217 | -e 's;\(pathToJavaScriptCoreOutput *=\) *\$\$ARGS/\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;g' \ |
michael@266 | 218 | src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri |
michael@266 | 219 | %{l_shtool} subst \ |
michael@86 | 220 | -e "s;^\(QMAKE_INCDIR_X11[^=]*=\).*;\1 %{l_prefix}/include $x11_incdir;" \ |
michael@86 | 221 | -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\).*;\1 %{l_prefix}/lib $x11_libdir;" \ |
michael@1 | 222 | mkspecs/qws/solaris*/qmake.conf \ |
michael@1 | 223 | mkspecs/solaris*/qmake.conf |
michael@263 | 224 | echo "QMAKE_LIBDIR += %{l_prefix}/lib/qt/dynamic" \ |
michael@263 | 225 | >>mkspecs/features/shared.prf |
michael@1 | 226 | %{l_shtool} subst \ |
michael@1 | 227 | -e 's; *\.\./3rdparty/freetype/.*;;g' \ |
michael@1 | 228 | -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \ |
michael@1 | 229 | src/gui/text/text.pri |
michael@1 | 230 | %{l_shtool} subst \ |
michael@1 | 231 | -e 's;\(#include *"\)\(tiffio.h"\);\1tiff/\2;' \ |
michael@257 | 232 | src/gui/image/qtiffhandler.cpp |
michael@92 | 233 | %{l_shtool} subst \ |
michael@92 | 234 | -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \ |
michael@92 | 235 | tools/qtconfig/qtconfig.pro |
michael@265 | 236 | %{l_shtool} subst \ |
michael@265 | 237 | -e 's;webkit;web-broken-kit;g' \ |
michael@265 | 238 | tools/assistant/tools/assistant/assistant.pro |
michael@265 | 239 | echo "DEFINES += QT_NO_WEBKIT" \ |
michael@265 | 240 | >>tools/assistant/tools/assistant/assistant.pro |
michael@263 | 241 | %{l_shtool} subst \ |
michael@264 | 242 | -e "s;Qt.s Classes;All Classes;" \ |
michael@263 | 243 | tools/assistant/tools/assistant/doc/assistant.qdoc \ |
michael@263 | 244 | tools/qdoc3/doc/qdoc-manual.qdoc \ |
michael@263 | 245 | tools/qdoc3/doc/files/qt.qdocconf \ |
michael@263 | 246 | tools/qdoc3/test/qt-build-docs.qdocconf \ |
michael@263 | 247 | tools/qdoc3/test/qt.qdocconf |
michael@1 | 248 | |
michael@1 | 249 | %build |
michael@1 | 250 | # protect against sloppy code inclusion of all unused subprojects |
michael@257 | 251 | (cd src/3rdparty && rm -rf [^cdehjmswxz]* sql* win* zlib zlib.pri) || exit $? |
michael@1 | 252 | |
michael@92 | 253 | # detect which platform for which to build |
michael@1 | 254 | case "%{l_platform -t}" in |
michael@86 | 255 | sun4[uv]-sunos* | amd64-sunos* ) platcomp="solaris-g++-64" ;; |
michael@86 | 256 | i?86-sunos* ) platcomp="solaris-g++" ;; |
michael@86 | 257 | amd64-linux* ) platcomp="linux-g++-64" ;; |
michael@86 | 258 | i?86-linux* ) platcomp="linux-g++" ;; |
michael@86 | 259 | amd64-freebsd* | i?86-freebsd* ) platcomp="freebsd-g++" ;; |
michael@86 | 260 | *-aix* ) platcomp="aix-g++" ;; |
michael@86 | 261 | *-darwin* ) platcomp="macx-g++" ;; |
michael@86 | 262 | *-hpux* ) platcomp="hpux-g++" ;; |
michael@86 | 263 | *-irix* ) platcomp="irix-g++" ;; |
michael@86 | 264 | * ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;; |
michael@1 | 265 | esac |
michael@1 | 266 | |
michael@92 | 267 | # detect which architecture extensions are available |
michael@92 | 268 | archflags='' |
michael@92 | 269 | case "%{l_platform -t}" in |
michael@92 | 270 | amd64-* ) |
michael@92 | 271 | break |
michael@92 | 272 | ;; |
michael@92 | 273 | * ) |
michael@92 | 274 | archflags='-no-sse2 -no-3dnow' |
michael@92 | 275 | ;; |
michael@92 | 276 | esac |
michael@92 | 277 | |
michael@1 | 278 | %if "%{with_shared}" == "yes" |
michael@1 | 279 | # optional shared build (precedes mandatory static build) |
michael@1 | 280 | echo 'yes' | ./configure \ |
michael@92 | 281 | $archflags \ |
michael@205 | 282 | -opensource \ |
michael@1 | 283 | -prefix %{l_prefix} \ |
michael@1 | 284 | -bindir %{l_prefix}/bin \ |
michael@263 | 285 | -libdir %{l_prefix}/lib/qt/dynamic \ |
michael@1 | 286 | -docdir %{l_prefix}/share/qt/doc \ |
michael@1 | 287 | -headerdir %{l_prefix}/include \ |
michael@86 | 288 | -plugindir %{l_prefix}/lib/qt/plugins \ |
michael@1 | 289 | -datadir %{l_prefix}/share/qt \ |
michael@1 | 290 | -translationdir %{l_prefix}/share/qt/translations \ |
michael@1 | 291 | -sysconfdir %{l_prefix}/etc/qt \ |
michael@1 | 292 | -examplesdir %{l_prefix}/share/qt/examples \ |
michael@1 | 293 | -demosdir %{l_prefix}/share/qt/demos \ |
michael@1 | 294 | -release \ |
michael@1 | 295 | -shared \ |
michael@1 | 296 | -platform $platcomp \ |
michael@1 | 297 | -no-sql-ibase \ |
michael@288 | 298 | %if "%{with_glib}" == "yes" |
michael@288 | 299 | -glib \ |
michael@288 | 300 | %else |
michael@288 | 301 | -no-glib \ |
michael@288 | 302 | %endif |
michael@65 | 303 | %if "%{with_mysql}" == "yes" |
michael@3 | 304 | -qt-sql-mysql \ |
michael@86 | 305 | -plugin-sql-mysql \ |
michael@65 | 306 | %else |
michael@65 | 307 | -no-sql-mysql \ |
michael@65 | 308 | %endif |
michael@65 | 309 | %if "%{with_pgsql}" == "yes" |
michael@65 | 310 | -qt-sql-psql \ |
michael@86 | 311 | -plugin-sql-psql \ |
michael@65 | 312 | %else |
michael@65 | 313 | -no-sql-psql \ |
michael@65 | 314 | %endif |
michael@1 | 315 | -no-sql-odbc \ |
michael@65 | 316 | -system-sqlite \ |
michael@65 | 317 | -qt-sql-sqlite \ |
michael@86 | 318 | -plugin-sql-sqlite \ |
michael@1 | 319 | -no-sql-sqlite2 \ |
michael@3 | 320 | -openssl-linked \ |
michael@288 | 321 | -optimized-qmake \ |
michael@1 | 322 | -xmlpatterns \ |
michael@1 | 323 | -svg \ |
michael@215 | 324 | -webkit \ |
michael@1 | 325 | -system-zlib \ |
michael@1 | 326 | -qt-gif \ |
michael@1 | 327 | -system-libpng \ |
michael@1 | 328 | -system-libmng \ |
michael@1 | 329 | -system-libjpeg \ |
michael@1 | 330 | -system-libtiff \ |
michael@1 | 331 | -rpath \ |
michael@1 | 332 | -no-cups \ |
michael@257 | 333 | -iconv \ |
michael@1 | 334 | -pch \ |
michael@1 | 335 | -dbus-linked \ |
michael@1 | 336 | -opengl \ |
michael@1 | 337 | -xrender \ |
michael@1 | 338 | -fontconfig \ |
michael@288 | 339 | -freetype |
michael@1 | 340 | |
michael@86 | 341 | # default options are implicitly used, for example... |
michael@1 | 342 | #-no-fast -exceptions -accessibility -stl -qt3support -nis |
michael@1 | 343 | #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb |
michael@1 | 344 | |
michael@1 | 345 | # carry out shared build procedure |
michael@1 | 346 | ( cd src |
michael@1 | 347 | %{l_make} %{l_mflags -O} \ |
michael@215 | 348 | sub-moc sub-rcc sub-uic sub-uic3 |
michael@1 | 349 | ) || exit $? |
michael@257 | 350 | %{l_make} %{l_mflags -O} \ |
michael@257 | 351 | sub-corelib-make_default-ordered \ |
michael@257 | 352 | sub-xml-make_default-ordered \ |
michael@257 | 353 | sub-network-make_default-ordered \ |
michael@257 | 354 | sub-sql-make_default-ordered \ |
michael@257 | 355 | sub-testlib-make_default-ordered \ |
michael@257 | 356 | sub-dbus-make_default-ordered \ |
michael@257 | 357 | sub-gui-make_default-ordered \ |
michael@257 | 358 | sub-qt3support-make_default-ordered \ |
michael@257 | 359 | sub-opengl-make_default-ordered \ |
michael@257 | 360 | sub-xmlpatterns-make_default-ordered \ |
michael@257 | 361 | sub-multimedia-make_default-ordered \ |
michael@257 | 362 | sub-svg-make_default-ordered \ |
michael@257 | 363 | sub-script-make_default-ordered \ |
michael@257 | 364 | sub-declarative-make_default-ordered \ |
michael@257 | 365 | sub-javascriptcore-make_default-ordered \ |
michael@257 | 366 | sub-webkit-make_default-ordered \ |
michael@257 | 367 | sub-scripttools-make_default-ordered \ |
michael@257 | 368 | sub-plugins-make_default-ordered \ |
michael@257 | 369 | sub-imports-make_default-ordered \ |
michael@257 | 370 | sub-webkitdeclarative-make_default-ordered \ |
michael@257 | 371 | sub-translations-make_default-ordered |
michael@205 | 372 | |
michael@205 | 373 | # arthur plugin requires libQtDesigner |
michael@92 | 374 | ( cd demos |
michael@205 | 375 | ( cd ../tools/designer/src/lib |
michael@263 | 376 | %{l_make} %{l_mflags -O} |
michael@205 | 377 | ) || exit $? |
michael@92 | 378 | %{l_make} %{l_mflags -O} sub-arthurplugin |
michael@92 | 379 | ) || exit $? |
michael@1 | 380 | |
michael@1 | 381 | # cache shared libs and initialize the build configuration, which |
michael@1 | 382 | # would otherwise still contain references to our shared libs build |
michael@263 | 383 | %{l_shtool} mkdir -f -p -m 755 sharbuild/dynamic |
michael@263 | 384 | mv lib/* sharbuild/dynamic/ |
michael@263 | 385 | mv plugins sharbuild/ |
michael@257 | 386 | %{l_make} %{l_mflags} confclean |
michael@1 | 387 | %endif |
michael@1 | 388 | |
michael@1 | 389 | # mandatory static build (follows optional shared build) |
michael@1 | 390 | echo 'yes' | ./configure \ |
michael@92 | 391 | $archflags \ |
michael@205 | 392 | -opensource \ |
michael@1 | 393 | -prefix %{l_prefix} \ |
michael@1 | 394 | -bindir %{l_prefix}/bin \ |
michael@1 | 395 | -libdir %{l_prefix}/lib \ |
michael@1 | 396 | -docdir %{l_prefix}/share/qt/doc \ |
michael@1 | 397 | -headerdir %{l_prefix}/include \ |
michael@86 | 398 | -plugindir %{l_prefix}/lib/qt/plugins \ |
michael@1 | 399 | -datadir %{l_prefix}/share/qt \ |
michael@1 | 400 | -translationdir %{l_prefix}/share/qt/translations \ |
michael@1 | 401 | -sysconfdir %{l_prefix}/etc/qt \ |
michael@1 | 402 | -examplesdir %{l_prefix}/share/qt/examples \ |
michael@1 | 403 | -demosdir %{l_prefix}/share/qt/demos \ |
michael@1 | 404 | -release \ |
michael@1 | 405 | -static \ |
michael@1 | 406 | -platform $platcomp \ |
michael@1 | 407 | -no-sql-ibase \ |
michael@288 | 408 | %if "%{with_glib}" == "yes" |
michael@288 | 409 | -glib \ |
michael@288 | 410 | %else |
michael@288 | 411 | -no-glib \ |
michael@288 | 412 | %endif |
michael@65 | 413 | %if "%{with_mysql}" == "yes" |
michael@3 | 414 | -qt-sql-mysql \ |
michael@65 | 415 | %else |
michael@65 | 416 | -no-sql-mysql \ |
michael@65 | 417 | %endif |
michael@65 | 418 | %if "%{with_pgsql}" == "yes" |
michael@65 | 419 | -qt-sql-psql \ |
michael@65 | 420 | %else |
michael@65 | 421 | -no-sql-psql \ |
michael@65 | 422 | %endif |
michael@1 | 423 | -no-sql-odbc \ |
michael@65 | 424 | -system-sqlite \ |
michael@65 | 425 | -qt-sql-sqlite \ |
michael@1 | 426 | -no-sql-sqlite2 \ |
michael@3 | 427 | -openssl-linked \ |
michael@288 | 428 | -optimized-qmake \ |
michael@1 | 429 | -xmlpatterns \ |
michael@1 | 430 | -svg \ |
michael@265 | 431 | -webkit \ |
michael@1 | 432 | -system-zlib \ |
michael@1 | 433 | -qt-gif \ |
michael@1 | 434 | -system-libpng \ |
michael@1 | 435 | -system-libmng \ |
michael@1 | 436 | -system-libjpeg \ |
michael@1 | 437 | -system-libtiff \ |
michael@1 | 438 | -rpath \ |
michael@1 | 439 | -no-cups \ |
michael@257 | 440 | -iconv \ |
michael@1 | 441 | -pch \ |
michael@1 | 442 | -dbus-linked \ |
michael@1 | 443 | -opengl \ |
michael@1 | 444 | -xrender \ |
michael@1 | 445 | -fontconfig \ |
michael@288 | 446 | -freetype |
michael@1 | 447 | |
michael@86 | 448 | # default options are implicitly used, for example... |
michael@1 | 449 | #-no-fast -exceptions -accessibility -stl -qt3support -nis |
michael@1 | 450 | #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb |
michael@1 | 451 | |
michael@1 | 452 | # carry out static build procedure |
michael@258 | 453 | %{l_make} %{l_mflags -O} sub-src |
michael@1 | 454 | %if "%{with_tools}" == "yes" |
michael@258 | 455 | %{l_make} %{l_mflags -O} \ |
michael@258 | 456 | sub-tools-make_default-ordered sub-translations-make_default-ordered |
michael@1 | 457 | %endif |
michael@1 | 458 | %if "%{with_examples}" == "yes" |
michael@1 | 459 | %{l_make} %{l_mflags -O} \ |
michael@1 | 460 | sub-demos-make_default-ordered \ |
michael@1 | 461 | sub-examples-make_default-ordered |
michael@1 | 462 | %endif |
michael@258 | 463 | %if "%{with_tools}" == "yes" |
michael@258 | 464 | %{l_make} %{l_mflags -O} docs |
michael@258 | 465 | %else |
michael@258 | 466 | %if "%{with_examples}" == "yes" |
michael@258 | 467 | %{l_make} %{l_mflags -O} docs |
michael@258 | 468 | %endif |
michael@258 | 469 | %endif |
michael@1 | 470 | |
michael@1 | 471 | %install |
michael@1 | 472 | rm -rf $RPM_BUILD_ROOT |
michael@1 | 473 | |
michael@1 | 474 | # carry out installation procedure |
michael@215 | 475 | targets="sub-tools-bootstrap-install_subtargets-ordered \ |
michael@215 | 476 | sub-moc-install_subtargets-ordered \ |
michael@1 | 477 | sub-rcc-install_subtargets-ordered \ |
michael@1 | 478 | sub-uic-install_subtargets-ordered \ |
michael@1 | 479 | sub-corelib-install_subtargets-ordered \ |
michael@1 | 480 | sub-xml-install_subtargets-ordered \ |
michael@1 | 481 | sub-network-install_subtargets-ordered \ |
michael@257 | 482 | sub-sql-install_subtargets-ordered \ |
michael@257 | 483 | sub-testlib-install_subtargets-ordered \ |
michael@257 | 484 | sub-dbus-install_subtargets-ordered \ |
michael@1 | 485 | sub-gui-install_subtargets-ordered \ |
michael@1 | 486 | sub-qt3support-install_subtargets-ordered \ |
michael@1 | 487 | sub-uic3-install_subtargets-ordered \ |
michael@1 | 488 | sub-opengl-install_subtargets-ordered \ |
michael@1 | 489 | sub-xmlpatterns-install_subtargets-ordered \ |
michael@257 | 490 | sub-multimedia-install_subtargets-ordered \ |
michael@1 | 491 | sub-svg-install_subtargets-ordered \ |
michael@257 | 492 | sub-script-install_subtargets-ordered \ |
michael@257 | 493 | sub-declarative-install_subtargets-ordered \ |
michael@257 | 494 | sub-scripttools-install_subtargets-ordered \ |
michael@257 | 495 | sub-imports-install_subtargets-ordered \ |
michael@257 | 496 | sub-translations-install_subtargets-ordered" |
michael@257 | 497 | |
michael@1 | 498 | %if "%{with_tools}" == "yes" |
michael@258 | 499 | targets="$targets sub-tools-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages" |
michael@1 | 500 | %endif |
michael@1 | 501 | %if "%{with_examples}" == "yes" |
michael@258 | 502 | targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages" |
michael@1 | 503 | %endif |
michael@258 | 504 | targets="$targets install_qmake install_mkspecs" |
michael@1 | 505 | %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT" |
michael@266 | 506 | %{l_shtool} install -c -m 644 \ |
michael@266 | 507 | lib/libjscore.a lib/libjscore.prl \ |
michael@266 | 508 | $RPM_BUILD_ROOT%{l_prefix}/lib/ |
michael@1 | 509 | |
michael@266 | 510 | # correct paths in pkg-config(1) configuration files |
michael@266 | 511 | %{l_shtool} subst \ |
michael@266 | 512 | -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};g" \ |
michael@266 | 513 | $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/* |
michael@266 | 514 | |
michael@266 | 515 | # install static or shared plugins according to user choice |
michael@263 | 516 | %if "%{with_shared}" != "yes" |
michael@263 | 517 | %{l_make} %{l_mflags} sub-plugins-install_subtargets-ordered INSTALL_ROOT="$RPM_BUILD_ROOT" |
michael@263 | 518 | %else |
michael@264 | 519 | %{l_tar} cf - -C sharbuild plugins | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt |
michael@263 | 520 | %endif |
michael@266 | 521 | |
michael@1 | 522 | %if "%{with_shared}" == "yes" |
michael@1 | 523 | # install shared libs and symlinks |
michael@1 | 524 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@1 | 525 | $RPM_BUILD_ROOT%{l_prefix}/lib/qt |
michael@264 | 526 | %{l_tar} cf - -C sharbuild dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt |
michael@1 | 527 | |
michael@86 | 528 | # offer limited support of pkg-config(1) for shared libs |
michael@87 | 529 | # substitution unfortunately only handles paths with no whitespace |
michael@86 | 530 | %{l_shtool} subst \ |
michael@266 | 531 | -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L%{l_prefix}/lib/qt/dynamic;g" \ |
michael@257 | 532 | -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};g" \ |
michael@87 | 533 | $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/* |
michael@86 | 534 | |
michael@1 | 535 | # explain nonstandard shared library placement |
michael@86 | 536 | ( echo "This OpenPKG Qt build is using the with_shared option." |
michael@86 | 537 | echo "" |
michael@263 | 538 | echo "The directory %{l_prefix}/lib/qt/dynamic contains the" |
michael@263 | 539 | echo "requested shared libraries. Although shared libraries" |
michael@263 | 540 | echo "have been optionally built (see the build time" |
michael@263 | 541 | echo "'with_shared yes' option), static libraries were" |
michael@263 | 542 | echo "built by default as usual, and installed in the" |
michael@86 | 543 | echo "standard library directory %{l_prefix}/lib." |
michael@86 | 544 | echo "" |
michael@86 | 545 | echo "To build applications using shared libraries instead," |
michael@262 | 546 | echo "please direct pkg-config(1) to use the proper definitions" |
michael@86 | 547 | echo "by setting the environment variable PKG_CONFIG_PATH to " |
michael@86 | 548 | echo "%{l_prefix}/lib/qt/dynamic/pkgconfig." |
michael@263 | 549 | echo "" |
michael@263 | 550 | echo "Note: If building via qmake(1), please append" |
michael@263 | 551 | echo " either 'static' or 'shared' to the line" |
michael@263 | 552 | echo " 'CONFIG +=' in the project file (name.pro)." |
michael@263 | 553 | echo " Then execute %{l_prefix}/bin/qmake on this file." |
michael@1 | 554 | ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README |
michael@263 | 555 | %endif |
michael@1 | 556 | |
michael@263 | 557 | # correct temporary runtime link paths (static libs) |
michael@1 | 558 | %{l_shtool} subst \ |
michael@263 | 559 | -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \ |
michael@257 | 560 | -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}\(/[^\t ][^\t ]*\);-L\1%{l_prefix}\2;g" \ |
michael@263 | 561 | $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl \ |
michael@263 | 562 | $RPM_BUILD_ROOT%{l_prefix}/lib/*.la |
michael@263 | 563 | %if "%{with_shared}" == "yes" |
michael@263 | 564 | # correct temporary runtime link paths (dynamic libs) |
michael@263 | 565 | %{l_shtool} subst \ |
michael@263 | 566 | -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \ |
michael@263 | 567 | -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L\1%{l_prefix}/lib/qt/dynamic;g" \ |
michael@92 | 568 | $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \ |
michael@92 | 569 | $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la |
michael@1 | 570 | %endif |
michael@1 | 571 | |
michael@259 | 572 | ## Doesn't work as expected, because RPM reads the --[in|ex]cludedocs |
michael@259 | 573 | ## argument only when installing binary packages, rather than building. |
michael@259 | 574 | #%define _excludedocs 0 |
michael@259 | 575 | #%define _includedocs 1 |
michael@259 | 576 | # echo %{_excludedocs} |
michael@259 | 577 | # echo %{_includedocs} |
michael@259 | 578 | # |
michael@259 | 579 | ## Doesn't work as expected, because it seems that OpenPKG too mercilessly |
michael@259 | 580 | ## removes RPM readi1ng of the %docdir keyword in rpm.patch.feature. |
michael@259 | 581 | # %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@259 | 582 | # %{l_files_std} \ |
michael@259 | 583 | # '%docdir %{l_prefix}/share/pkg/doc' |
michael@259 | 584 | # |
michael@259 | 585 | ## Doesn't work as expected, because the rpmtool(1) marks |
michael@259 | 586 | ## only einzeln files as documents, skipping directories |
michael@259 | 587 | # %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@259 | 588 | # %{l_files_std} \ |
michael@259 | 589 | # '%doc %{l_prefix}/share/pkg/doc/doc.txt' |
michael@259 | 590 | # |
michael@1 | 591 | # determine internal file listing |
michael@1 | 592 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@1 | 593 | %{l_files_std} \ |
michael@1 | 594 | '%not %dir %{l_prefix}/lib/pkgconfig' |
michael@1 | 595 | |
michael@1 | 596 | %files -f files |
michael@1 | 597 | |
michael@1 | 598 | %clean |
michael@1 | 599 | rm -rf $RPM_BUILD_ROOT |
michael@1 | 600 |