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