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.
qt/qt.spec | file | annotate | diff | comparison | revisions |
1.1 --- a/qt/qt.spec Fri Oct 15 18:58:09 2010 +0200 1.2 +++ b/qt/qt.spec Fri Oct 15 19:06:09 2010 +0200 1.3 @@ -31,6 +31,10 @@ 1.4 # FIXME: MSvB: 1.5 # FIXME: MSvB: -no-webkit added to broken static buildconf 1.6 # FIXME: MSvB: as work around for 'ld: cannot find -ljscore' 1.7 +# FIXME: MSvB: 1.8 +# FIXME: MSvB: Test all of -R %{l_prefix}/lib/qt/dynamic, 1.9 +# FIXME: MSvB: -no-rpath, -rpath, and removing $xll_libdir from 1.10 +# FIXME: MSvB: shtool subst. Anschliessend mkspecs/qconfig.pri. 1.11 1.12 # package information 1.13 Name: qt 1.14 @@ -43,7 +47,7 @@ 1.15 Group: Development 1.16 License: GPL 1.17 Version: 4.7.0 1.18 -Release: 20101010 1.19 +Release: 20101012 1.20 1.21 # build options 1.22 %option with_tools yes 1.23 @@ -88,7 +92,7 @@ 1.24 %track 1.25 prog qt = { 1.26 version = %{version} 1.27 - url = ftp://ftp.trolltech.com/qt/source/ 1.28 + url = ftp://ftp.qt.nokia.com/qt/source/ 1.29 regex = qt-everywhere-opensource-src-(__VER__)\.tar\.gz 1.30 } 1.31 1.32 @@ -96,10 +100,10 @@ 1.33 # announce exceptional build requirements 1.34 ( echo "This package has exceptional build requirements:" 1.35 echo " qt-%{version}-root (2,5 Go)" 1.36 - echo " qt-everywhere-opensource-src-%{version} (4,5 Go)" 1.37 - echo " qt-%{version}-<date>.<arch>-<os>-<tag>.rpm (1 Go)" 1.38 - echo "Building with no options takes 0,5 hours on a dual core" 1.39 - echo "2 GHz CPU, or 2 hours with all build options enabled." 1.40 + echo " qt-everywhere-opensource-src-%{version} (5,5 Go)" 1.41 + echo " qt-%{version}-<date>.<arch>-<os>-<tag>.rpm (2 Go)" 1.42 + echo "Building with no options takes 2,0 hours on a dual core" 1.43 + echo "2 GHz CPU, or 6 hours with all build options enabled." 1.44 ) | %{l_rpmtool} msg -b -t notice 1.45 1.46 %setup -q -n qt-everywhere-opensource-src-%{version} 1.47 @@ -125,17 +129,15 @@ 1.48 -e 's;\(-z[\t ][\t ]*\)\([^\t \"][^\t \"]*\);\1"\2";g' \ 1.49 configure 1.50 %{l_shtool} subst \ 1.51 + -e 's;\(RPATH_FLAGS\)=.*\$QT_INSTALL_LIBS.*\(\$RPATH_FLAGS\)";\1="%{l_prefix}/lib/qt/dynamic \2";' \ 1.52 + configure 1.53 + %{l_shtool} subst \ 1.54 -e 's; *QMakeVar set QMAKE_CFLAGS_X11.*QT_CFLAGS_FONTCONFIG.*;;' \ 1.55 -e 's; *QMakeVar set QMAKE_LIBS_X11.*QT_LIBS_FONTCONFIG.*;;' \ 1.56 configure 1.57 %{l_shtool} subst \ 1.58 -e "s;\(OPENSSL_LIBS *=\) *-lssl -lcrypto;\1 $openssllibs;" \ 1.59 configure 1.60 - %{l_shtool} subst \ 1.61 - -e 's;-silent|;-rpath|-silent|;' \ 1.62 - -e 's;\(RPATH_FLAGS="\)\\"\$QT_INSTALL_LIBS\\" \($RPATH_FLAGS"\);\1\2;' \ 1.63 - -e "s;\(echo.*QMAKE_RPATHDIR +=\).*\$QT_INSTALL_LIBS\\\\\"\\\";\1 $x11_libdir\";" \ 1.64 - configure 1.65 # yes this is needed several times to catch nested occurences of '--cflags' 1.66 %{l_shtool} subst \ 1.67 -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \ 1.68 @@ -190,7 +192,7 @@ 1.69 src/dbus/dbus.pro 1.70 %{l_shtool} subst \ 1.71 -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \ 1.72 - -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/lib;' \ 1.73 + -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1;' \ 1.74 -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \ 1.75 -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2;" \ 1.76 -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \ 1.77 @@ -204,6 +206,8 @@ 1.78 -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\).*;\1 %{l_prefix}/lib $x11_libdir;" \ 1.79 mkspecs/qws/solaris*/qmake.conf \ 1.80 mkspecs/solaris*/qmake.conf 1.81 + echo "QMAKE_LIBDIR += %{l_prefix}/lib/qt/dynamic" \ 1.82 + >>mkspecs/features/shared.prf 1.83 %{l_shtool} subst \ 1.84 -e 's; *\.\./3rdparty/freetype/.*;;g' \ 1.85 -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \ 1.86 @@ -214,9 +218,16 @@ 1.87 %{l_shtool} subst \ 1.88 -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \ 1.89 tools/qtconfig/qtconfig.pro 1.90 -# for projfile in `find examples/ -name '*.pro' -print`; do 1.91 -# echo 'CONFIG += release' >>$projfile 1.92 -# done 1.93 + #%{l_shtool} subst \ 1.94 + # -e "s;\(\\title\) All Classes;\1 Qt's Classes;" \ 1.95 + # doc/src/classes.qdoc 1.96 + %{l_shtool} subst \ 1.97 + -e "s;Qt's Classes;All Classes;" \ 1.98 + tools/assistant/tools/assistant/doc/assistant.qdoc \ 1.99 + tools/qdoc3/doc/qdoc-manual.qdoc \ 1.100 + tools/qdoc3/doc/files/qt.qdocconf \ 1.101 + tools/qdoc3/test/qt-build-docs.qdocconf \ 1.102 + tools/qdoc3/test/qt.qdocconf 1.103 1.104 %build 1.105 # protect against sloppy code inclusion of all unused subprojects 1.106 @@ -254,7 +265,7 @@ 1.107 -opensource \ 1.108 -prefix %{l_prefix} \ 1.109 -bindir %{l_prefix}/bin \ 1.110 - -libdir %{l_prefix}/lib/qt \ 1.111 + -libdir %{l_prefix}/lib/qt/dynamic \ 1.112 -docdir %{l_prefix}/share/qt/doc \ 1.113 -headerdir %{l_prefix}/include \ 1.114 -plugindir %{l_prefix}/lib/qt/plugins \ 1.115 @@ -340,18 +351,16 @@ 1.116 # arthur plugin requires libQtDesigner 1.117 ( cd demos 1.118 ( cd ../tools/designer/src/lib 1.119 - %{l_make} %{l_mflags -O} staticlib 1.120 + %{l_make} %{l_mflags -O} 1.121 ) || exit $? 1.122 %{l_make} %{l_mflags -O} sub-arthurplugin 1.123 - ( cd ../tools/designer/src/lib 1.124 - %{l_make} %{l_mflags -O} distclean 1.125 - ) || exit $? 1.126 ) || exit $? 1.127 1.128 # cache shared libs and initialize the build configuration, which 1.129 # would otherwise still contain references to our shared libs build 1.130 - %{l_shtool} mkdir -f -p -m 755 dynamic 1.131 - mv lib/* dynamic/ 1.132 + %{l_shtool} mkdir -f -p -m 755 sharbuild/dynamic 1.133 + mv lib/* sharbuild/dynamic/ 1.134 + mv plugins sharbuild/ 1.135 %{l_make} %{l_mflags} confclean 1.136 %endif 1.137 1.138 @@ -456,7 +465,6 @@ 1.139 sub-script-install_subtargets-ordered \ 1.140 sub-declarative-install_subtargets-ordered \ 1.141 sub-scripttools-install_subtargets-ordered \ 1.142 - sub-plugins-install_subtargets-ordered \ 1.143 sub-imports-install_subtargets-ordered \ 1.144 sub-translations-install_subtargets-ordered" 1.145 1.146 @@ -469,11 +477,18 @@ 1.147 targets="$targets install_qmake install_mkspecs" 1.148 %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT" 1.149 1.150 + # only install static or shared plugins according to user choice 1.151 +%if "%{with_shared}" != "yes" 1.152 + %{l_make} %{l_mflags} sub-plugins-install_subtargets-ordered INSTALL_ROOT="$RPM_BUILD_ROOT" 1.153 +%else 1.154 + %{l_tar} cf - sharbuild/plugins | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt 1.155 +%endif 1.156 + 1.157 %if "%{with_shared}" == "yes" 1.158 # install shared libs and symlinks 1.159 %{l_shtool} mkdir -f -p -m 755 \ 1.160 $RPM_BUILD_ROOT%{l_prefix}/lib/qt 1.161 - %{l_tar} cf - dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt 1.162 + %{l_tar} cf - sharbuild/dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt 1.163 1.164 # offer limited support of pkg-config(1) for shared libs 1.165 # substitution unfortunately only handles paths with no whitespace 1.166 @@ -484,23 +499,36 @@ 1.167 # explain nonstandard shared library placement 1.168 ( echo "This OpenPKG Qt build is using the with_shared option." 1.169 echo "" 1.170 - echo "This directory contains optional shared libraries as" 1.171 - echo "defined by the OpenPKG build specification. Although" 1.172 - echo "shared libraries have been optionally built (see the" 1.173 - echo "build time 'with_shared yes' option), static libraries" 1.174 - echo "were built by default as usual, and installed in the" 1.175 + echo "The directory %{l_prefix}/lib/qt/dynamic contains the" 1.176 + echo "requested shared libraries. Although shared libraries" 1.177 + echo "have been optionally built (see the build time" 1.178 + echo "'with_shared yes' option), static libraries were" 1.179 + echo "built by default as usual, and installed in the" 1.180 echo "standard library directory %{l_prefix}/lib." 1.181 echo "" 1.182 echo "To build applications using shared libraries instead," 1.183 echo "please direct pkg-config(1) to use the proper definitions" 1.184 echo "by setting the environment variable PKG_CONFIG_PATH to " 1.185 echo "%{l_prefix}/lib/qt/dynamic/pkgconfig." 1.186 + echo "" 1.187 + echo "Note: If building via qmake(1), please append" 1.188 + echo " either 'static' or 'shared' to the line" 1.189 + echo " 'CONFIG +=' in the project file (name.pro)." 1.190 + echo " Then execute %{l_prefix}/bin/qmake on this file." 1.191 ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README 1.192 +%endif 1.193 1.194 - # remove temporary dynamic link paths 1.195 + # correct temporary runtime link paths (static libs) 1.196 %{l_shtool} subst \ 1.197 + -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \ 1.198 -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}\(/[^\t ][^\t ]*\);-L\1%{l_prefix}\2;g" \ 1.199 - -e "s;\([\t ][\t ]*\)[^\t ][^\t ]*\(qt-everywhere-opensource-src-%{version}.*\);\1/tmp/\2;" \ 1.200 + $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl \ 1.201 + $RPM_BUILD_ROOT%{l_prefix}/lib/*.la 1.202 +%if "%{with_shared}" == "yes" 1.203 + # correct temporary runtime link paths (dynamic libs) 1.204 + %{l_shtool} subst \ 1.205 + -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \ 1.206 + -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L\1%{l_prefix}/lib/qt/dynamic;g" \ 1.207 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \ 1.208 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la 1.209 %endif