qt/qt.spec

changeset 263
f4a0b439d0fb
parent 262
495dc52debb0
child 264
dd9efe7d5452
equal deleted inserted replaced
18:b742ca4a81f7 19:1ececa8184c6
29 # FIXME: MSvB: Solaris 11 IA-32 builds fail while Linux 2.6.25.18 29 # FIXME: MSvB: Solaris 11 IA-32 builds fail while Linux 2.6.25.18
30 # FIXME: MSvB: AMD64 builds succeed. 30 # FIXME: MSvB: AMD64 builds succeed.
31 # FIXME: MSvB: 31 # FIXME: MSvB:
32 # FIXME: MSvB: -no-webkit added to broken static buildconf 32 # FIXME: MSvB: -no-webkit added to broken static buildconf
33 # FIXME: MSvB: as work around for 'ld: cannot find -ljscore' 33 # FIXME: MSvB: as work around for 'ld: cannot find -ljscore'
34 # FIXME: MSvB:
35 # FIXME: MSvB: Test all of -R %{l_prefix}/lib/qt/dynamic,
36 # FIXME: MSvB: -no-rpath, -rpath, and removing $xll_libdir from
37 # FIXME: MSvB: shtool subst. Anschliessend mkspecs/qconfig.pri.
34 38
35 # package information 39 # package information
36 Name: qt 40 Name: qt
37 Summary: Cross Platform Application Framework 41 Summary: Cross Platform Application Framework
38 URL: http://www.trolltech.com/products/qt/ 42 URL: http://www.trolltech.com/products/qt/
41 Distribution: MSvB Recherche Production 45 Distribution: MSvB Recherche Production
42 Class: EVAL 46 Class: EVAL
43 Group: Development 47 Group: Development
44 License: GPL 48 License: GPL
45 Version: 4.7.0 49 Version: 4.7.0
46 Release: 20101010 50 Release: 20101012
47 51
48 # build options 52 # build options
49 %option with_tools yes 53 %option with_tools yes
50 %option with_mysql no 54 %option with_mysql no
51 %option with_pgsql no 55 %option with_pgsql no
86 distribution builds all modules of the Qt/X11 Open Source Edition. 90 distribution builds all modules of the Qt/X11 Open Source Edition.
87 91
88 %track 92 %track
89 prog qt = { 93 prog qt = {
90 version = %{version} 94 version = %{version}
91 url = ftp://ftp.trolltech.com/qt/source/ 95 url = ftp://ftp.qt.nokia.com/qt/source/
92 regex = qt-everywhere-opensource-src-(__VER__)\.tar\.gz 96 regex = qt-everywhere-opensource-src-(__VER__)\.tar\.gz
93 } 97 }
94 98
95 %prep 99 %prep
96 # announce exceptional build requirements 100 # announce exceptional build requirements
97 ( echo "This package has exceptional build requirements:" 101 ( echo "This package has exceptional build requirements:"
98 echo " qt-%{version}-root (2,5 Go)" 102 echo " qt-%{version}-root (2,5 Go)"
99 echo " qt-everywhere-opensource-src-%{version} (4,5 Go)" 103 echo " qt-everywhere-opensource-src-%{version} (5,5 Go)"
100 echo " qt-%{version}-<date>.<arch>-<os>-<tag>.rpm (1 Go)" 104 echo " qt-%{version}-<date>.<arch>-<os>-<tag>.rpm (2 Go)"
101 echo "Building with no options takes 0,5 hours on a dual core" 105 echo "Building with no options takes 2,0 hours on a dual core"
102 echo "2 GHz CPU, or 2 hours with all build options enabled." 106 echo "2 GHz CPU, or 6 hours with all build options enabled."
103 ) | %{l_rpmtool} msg -b -t notice 107 ) | %{l_rpmtool} msg -b -t notice
104 108
105 %setup -q -n qt-everywhere-opensource-src-%{version} 109 %setup -q -n qt-everywhere-opensource-src-%{version}
106 x11_incdir=`%{l_rc} --query x11_incdir` 110 x11_incdir=`%{l_rc} --query x11_incdir`
107 x11_libdir=`%{l_rc} --query x11_libdir` 111 x11_libdir=`%{l_rc} --query x11_libdir`
123 ) || exit $? 127 ) || exit $?
124 %{l_shtool} subst \ 128 %{l_shtool} subst \
125 -e 's;\(-z[\t ][\t ]*\)\([^\t \"][^\t \"]*\);\1"\2";g' \ 129 -e 's;\(-z[\t ][\t ]*\)\([^\t \"][^\t \"]*\);\1"\2";g' \
126 configure 130 configure
127 %{l_shtool} subst \ 131 %{l_shtool} subst \
132 -e 's;\(RPATH_FLAGS\)=.*\$QT_INSTALL_LIBS.*\(\$RPATH_FLAGS\)";\1="%{l_prefix}/lib/qt/dynamic \2";' \
133 configure
134 %{l_shtool} subst \
128 -e 's; *QMakeVar set QMAKE_CFLAGS_X11.*QT_CFLAGS_FONTCONFIG.*;;' \ 135 -e 's; *QMakeVar set QMAKE_CFLAGS_X11.*QT_CFLAGS_FONTCONFIG.*;;' \
129 -e 's; *QMakeVar set QMAKE_LIBS_X11.*QT_LIBS_FONTCONFIG.*;;' \ 136 -e 's; *QMakeVar set QMAKE_LIBS_X11.*QT_LIBS_FONTCONFIG.*;;' \
130 configure 137 configure
131 %{l_shtool} subst \ 138 %{l_shtool} subst \
132 -e "s;\(OPENSSL_LIBS *=\) *-lssl -lcrypto;\1 $openssllibs;" \ 139 -e "s;\(OPENSSL_LIBS *=\) *-lssl -lcrypto;\1 $openssllibs;" \
133 configure
134 %{l_shtool} subst \
135 -e 's;-silent|;-rpath|-silent|;' \
136 -e 's;\(RPATH_FLAGS="\)\\"\$QT_INSTALL_LIBS\\" \($RPATH_FLAGS"\);\1\2;' \
137 -e "s;\(echo.*QMAKE_RPATHDIR +=\).*\$QT_INSTALL_LIBS\\\\\"\\\";\1 $x11_libdir\";" \
138 configure 140 configure
139 # yes this is needed several times to catch nested occurences of '--cflags' 141 # yes this is needed several times to catch nested occurences of '--cflags'
140 %{l_shtool} subst \ 142 %{l_shtool} subst \
141 -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \ 143 -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \
142 -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \ 144 -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \
188 %{l_shtool} subst \ 190 %{l_shtool} subst \
189 -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" \ 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" \
190 src/dbus/dbus.pro 192 src/dbus/dbus.pro
191 %{l_shtool} subst \ 193 %{l_shtool} subst \
192 -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \ 194 -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \
193 -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/lib;' \ 195 -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1;' \
194 -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \ 196 -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \
195 -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2;" \ 197 -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2;" \
196 -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \ 198 -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \
197 mkspecs/qws/*/qmake.conf \ 199 mkspecs/qws/*/qmake.conf \
198 mkspecs/*/*.conf 200 mkspecs/*/*.conf
202 %{l_shtool} subst \ 204 %{l_shtool} subst \
203 -e "s;^\(QMAKE_INCDIR_X11[^=]*=\).*;\1 %{l_prefix}/include $x11_incdir;" \ 205 -e "s;^\(QMAKE_INCDIR_X11[^=]*=\).*;\1 %{l_prefix}/include $x11_incdir;" \
204 -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\).*;\1 %{l_prefix}/lib $x11_libdir;" \ 206 -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\).*;\1 %{l_prefix}/lib $x11_libdir;" \
205 mkspecs/qws/solaris*/qmake.conf \ 207 mkspecs/qws/solaris*/qmake.conf \
206 mkspecs/solaris*/qmake.conf 208 mkspecs/solaris*/qmake.conf
209 echo "QMAKE_LIBDIR += %{l_prefix}/lib/qt/dynamic" \
210 >>mkspecs/features/shared.prf
207 %{l_shtool} subst \ 211 %{l_shtool} subst \
208 -e 's; *\.\./3rdparty/freetype/.*;;g' \ 212 -e 's; *\.\./3rdparty/freetype/.*;;g' \
209 -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \ 213 -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \
210 src/gui/text/text.pri 214 src/gui/text/text.pri
211 %{l_shtool} subst \ 215 %{l_shtool} subst \
212 -e 's;\(#include *"\)\(tiffio.h"\);\1tiff/\2;' \ 216 -e 's;\(#include *"\)\(tiffio.h"\);\1tiff/\2;' \
213 src/gui/image/qtiffhandler.cpp 217 src/gui/image/qtiffhandler.cpp
214 %{l_shtool} subst \ 218 %{l_shtool} subst \
215 -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \ 219 -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \
216 tools/qtconfig/qtconfig.pro 220 tools/qtconfig/qtconfig.pro
217 # for projfile in `find examples/ -name '*.pro' -print`; do 221 #%{l_shtool} subst \
218 # echo 'CONFIG += release' >>$projfile 222 # -e "s;\(\\title\) All Classes;\1 Qt's Classes;" \
219 # done 223 # doc/src/classes.qdoc
224 %{l_shtool} subst \
225 -e "s;Qt's Classes;All Classes;" \
226 tools/assistant/tools/assistant/doc/assistant.qdoc \
227 tools/qdoc3/doc/qdoc-manual.qdoc \
228 tools/qdoc3/doc/files/qt.qdocconf \
229 tools/qdoc3/test/qt-build-docs.qdocconf \
230 tools/qdoc3/test/qt.qdocconf
220 231
221 %build 232 %build
222 # protect against sloppy code inclusion of all unused subprojects 233 # protect against sloppy code inclusion of all unused subprojects
223 (cd src/3rdparty && rm -rf [^cdehjmswxz]* sql* win* zlib zlib.pri) || exit $? 234 (cd src/3rdparty && rm -rf [^cdehjmswxz]* sql* win* zlib zlib.pri) || exit $?
224 235
252 echo 'yes' | ./configure \ 263 echo 'yes' | ./configure \
253 $archflags \ 264 $archflags \
254 -opensource \ 265 -opensource \
255 -prefix %{l_prefix} \ 266 -prefix %{l_prefix} \
256 -bindir %{l_prefix}/bin \ 267 -bindir %{l_prefix}/bin \
257 -libdir %{l_prefix}/lib/qt \ 268 -libdir %{l_prefix}/lib/qt/dynamic \
258 -docdir %{l_prefix}/share/qt/doc \ 269 -docdir %{l_prefix}/share/qt/doc \
259 -headerdir %{l_prefix}/include \ 270 -headerdir %{l_prefix}/include \
260 -plugindir %{l_prefix}/lib/qt/plugins \ 271 -plugindir %{l_prefix}/lib/qt/plugins \
261 -datadir %{l_prefix}/share/qt \ 272 -datadir %{l_prefix}/share/qt \
262 -translationdir %{l_prefix}/share/qt/translations \ 273 -translationdir %{l_prefix}/share/qt/translations \
338 sub-translations-make_default-ordered 349 sub-translations-make_default-ordered
339 350
340 # arthur plugin requires libQtDesigner 351 # arthur plugin requires libQtDesigner
341 ( cd demos 352 ( cd demos
342 ( cd ../tools/designer/src/lib 353 ( cd ../tools/designer/src/lib
343 %{l_make} %{l_mflags -O} staticlib 354 %{l_make} %{l_mflags -O}
344 ) || exit $? 355 ) || exit $?
345 %{l_make} %{l_mflags -O} sub-arthurplugin 356 %{l_make} %{l_mflags -O} sub-arthurplugin
346 ( cd ../tools/designer/src/lib
347 %{l_make} %{l_mflags -O} distclean
348 ) || exit $?
349 ) || exit $? 357 ) || exit $?
350 358
351 # cache shared libs and initialize the build configuration, which 359 # cache shared libs and initialize the build configuration, which
352 # would otherwise still contain references to our shared libs build 360 # would otherwise still contain references to our shared libs build
353 %{l_shtool} mkdir -f -p -m 755 dynamic 361 %{l_shtool} mkdir -f -p -m 755 sharbuild/dynamic
354 mv lib/* dynamic/ 362 mv lib/* sharbuild/dynamic/
363 mv plugins sharbuild/
355 %{l_make} %{l_mflags} confclean 364 %{l_make} %{l_mflags} confclean
356 %endif 365 %endif
357 366
358 # mandatory static build (follows optional shared build) 367 # mandatory static build (follows optional shared build)
359 echo 'yes' | ./configure \ 368 echo 'yes' | ./configure \
454 sub-multimedia-install_subtargets-ordered \ 463 sub-multimedia-install_subtargets-ordered \
455 sub-svg-install_subtargets-ordered \ 464 sub-svg-install_subtargets-ordered \
456 sub-script-install_subtargets-ordered \ 465 sub-script-install_subtargets-ordered \
457 sub-declarative-install_subtargets-ordered \ 466 sub-declarative-install_subtargets-ordered \
458 sub-scripttools-install_subtargets-ordered \ 467 sub-scripttools-install_subtargets-ordered \
459 sub-plugins-install_subtargets-ordered \
460 sub-imports-install_subtargets-ordered \ 468 sub-imports-install_subtargets-ordered \
461 sub-translations-install_subtargets-ordered" 469 sub-translations-install_subtargets-ordered"
462 470
463 %if "%{with_tools}" == "yes" 471 %if "%{with_tools}" == "yes"
464 targets="$targets sub-tools-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages" 472 targets="$targets sub-tools-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
467 targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages" 475 targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
468 %endif 476 %endif
469 targets="$targets install_qmake install_mkspecs" 477 targets="$targets install_qmake install_mkspecs"
470 %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT" 478 %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT"
471 479
480 # only install static or shared plugins according to user choice
481 %if "%{with_shared}" != "yes"
482 %{l_make} %{l_mflags} sub-plugins-install_subtargets-ordered INSTALL_ROOT="$RPM_BUILD_ROOT"
483 %else
484 %{l_tar} cf - sharbuild/plugins | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
485 %endif
486
472 %if "%{with_shared}" == "yes" 487 %if "%{with_shared}" == "yes"
473 # install shared libs and symlinks 488 # install shared libs and symlinks
474 %{l_shtool} mkdir -f -p -m 755 \ 489 %{l_shtool} mkdir -f -p -m 755 \
475 $RPM_BUILD_ROOT%{l_prefix}/lib/qt 490 $RPM_BUILD_ROOT%{l_prefix}/lib/qt
476 %{l_tar} cf - dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt 491 %{l_tar} cf - sharbuild/dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
477 492
478 # offer limited support of pkg-config(1) for shared libs 493 # offer limited support of pkg-config(1) for shared libs
479 # substitution unfortunately only handles paths with no whitespace 494 # substitution unfortunately only handles paths with no whitespace
480 %{l_shtool} subst \ 495 %{l_shtool} subst \
481 -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};g" \ 496 -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};g" \
482 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/* 497 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/*
483 498
484 # explain nonstandard shared library placement 499 # explain nonstandard shared library placement
485 ( echo "This OpenPKG Qt build is using the with_shared option." 500 ( echo "This OpenPKG Qt build is using the with_shared option."
486 echo "" 501 echo ""
487 echo "This directory contains optional shared libraries as" 502 echo "The directory %{l_prefix}/lib/qt/dynamic contains the"
488 echo "defined by the OpenPKG build specification. Although" 503 echo "requested shared libraries. Although shared libraries"
489 echo "shared libraries have been optionally built (see the" 504 echo "have been optionally built (see the build time"
490 echo "build time 'with_shared yes' option), static libraries" 505 echo "'with_shared yes' option), static libraries were"
491 echo "were built by default as usual, and installed in the" 506 echo "built by default as usual, and installed in the"
492 echo "standard library directory %{l_prefix}/lib." 507 echo "standard library directory %{l_prefix}/lib."
493 echo "" 508 echo ""
494 echo "To build applications using shared libraries instead," 509 echo "To build applications using shared libraries instead,"
495 echo "please direct pkg-config(1) to use the proper definitions" 510 echo "please direct pkg-config(1) to use the proper definitions"
496 echo "by setting the environment variable PKG_CONFIG_PATH to " 511 echo "by setting the environment variable PKG_CONFIG_PATH to "
497 echo "%{l_prefix}/lib/qt/dynamic/pkgconfig." 512 echo "%{l_prefix}/lib/qt/dynamic/pkgconfig."
513 echo ""
514 echo "Note: If building via qmake(1), please append"
515 echo " either 'static' or 'shared' to the line"
516 echo " 'CONFIG +=' in the project file (name.pro)."
517 echo " Then execute %{l_prefix}/bin/qmake on this file."
498 ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README 518 ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README
499 519 %endif
500 # remove temporary dynamic link paths 520
501 %{l_shtool} subst \ 521 # correct temporary runtime link paths (static libs)
522 %{l_shtool} subst \
523 -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \
502 -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}\(/[^\t ][^\t ]*\);-L\1%{l_prefix}\2;g" \ 524 -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}\(/[^\t ][^\t ]*\);-L\1%{l_prefix}\2;g" \
503 -e "s;\([\t ][\t ]*\)[^\t ][^\t ]*\(qt-everywhere-opensource-src-%{version}.*\);\1/tmp/\2;" \ 525 $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl \
526 $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
527 %if "%{with_shared}" == "yes"
528 # correct temporary runtime link paths (dynamic libs)
529 %{l_shtool} subst \
530 -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \
531 -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L\1%{l_prefix}/lib/qt/dynamic;g" \
504 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \ 532 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \
505 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la 533 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la
506 %endif 534 %endif
507 535
508 ## Doesn't work as expected, because RPM reads the --[in|ex]cludedocs 536 ## Doesn't work as expected, because RPM reads the --[in|ex]cludedocs

mercurial