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.
1 ##
2 ## qt.spec -- OpenPKG RPM Specification
3 ## Copyright (c) 2010 Michael Schloh von Bennewitz <michael@schloh.com>
4 ##
5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all
8 ## copies.
9 ##
10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE.
22 ##
24 # FIXME: MSvB: It appears that bugs in current versions of binutils
25 # FIXME: MSvB: fail to properly link Qt object code, resulting in
26 # FIXME: MSvB: 'ld: libQt*.so: pthread_mutex...: invalid version 6
27 # FIXME: MSvB: libQt*.so: could not read symbols: Bad value'
28 # FIXME: MSvB: The effects of these bugs are platform dependent.
29 # FIXME: MSvB: Solaris 11 IA-32 builds fail while Linux 2.6.25.18
30 # FIXME: MSvB: AMD64 builds succeed.
31 # FIXME: MSvB:
32 # FIXME: MSvB: -no-webkit added to broken static buildconf
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.
39 # package information
40 Name: qt
41 Summary: Cross Platform Application Framework
42 URL: http://www.trolltech.com/products/qt/
43 Vendor: Nokia Corporation
44 Packager: Michael Schloh von Bennewitz
45 Distribution: MSvB Recherche Production
46 Class: EVAL
47 Group: Development
48 License: GPL
49 Version: 4.7.0
50 Release: 20101012
52 # build options
53 %option with_tools yes
54 %option with_mysql no
55 %option with_pgsql no
56 %option with_shared no
57 %option with_examples no
59 # list of sources
60 Source0: ftp://ftp.qt.nokia.com/qt/source/qt-everywhere-opensource-src-%{version}.tar.gz
62 # build information
63 Prefix: %{l_prefix}
64 BuildRoot: %{l_buildroot}
65 BuildPreReq: OpenPKG, openpkg >= 20050726, make, gcc, pkgconfig
66 PreReq: OpenPKG, openpkg >= 20050726
67 BuildPreReq: X11, png, mng, jpeg, tiff, mesa, xrender
68 PreReq: X11, png, mng, jpeg, tiff, mesa, xrender
69 BuildPreReq: openssl, zlib, libiconv, sqlite, dbus
70 PreReq: openssl, zlib, libiconv, sqlite, dbus
71 BuildPreReq: fontconfig, freetype
72 PreReq: fontconfig, freetype
73 %if "%{with_mysql}" == "yes"
74 BuildPreReq: mysql
75 PreReq: mysql
76 %endif
77 %if "%{with_pgsql}" == "yes"
78 BuildPreReq: postgresql
79 PreReq: postgresql
80 %endif
81 AutoReq: no
82 AutoReqProv: no
83 Provides: QTSDK
85 %description
86 Qt is a comprehensive C++ framework for cross-platform application
87 development. Using Qt, you can develop applications and user
88 interfaces once, and deploy them across many desktop and embedded
89 operating systems without rewriting the source code. This package
90 distribution builds all modules of the Qt/X11 Open Source Edition.
92 %track
93 prog qt = {
94 version = %{version}
95 url = ftp://ftp.qt.nokia.com/qt/source/
96 regex = qt-everywhere-opensource-src-(__VER__)\.tar\.gz
97 }
99 %prep
100 # announce exceptional build requirements
101 ( echo "This package has exceptional build requirements:"
102 echo " qt-%{version}-root (2,5 Go)"
103 echo " qt-everywhere-opensource-src-%{version} (5,5 Go)"
104 echo " qt-%{version}-<date>.<arch>-<os>-<tag>.rpm (2 Go)"
105 echo "Building with no options takes 2,0 hours on a dual core"
106 echo "2 GHz CPU, or 6 hours with all build options enabled."
107 ) | %{l_rpmtool} msg -b -t notice
109 %setup -q -n qt-everywhere-opensource-src-%{version}
110 x11_incdir=`%{l_rc} --query x11_incdir`
111 x11_libdir=`%{l_rc} --query x11_libdir`
112 fontconflibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig`
113 lcmslibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static lcms`
114 openssllibs=`%{l_prefix}/bin/pkg-config --libs --static openssl`
116 loclibs=''
117 case "%{l_platform -t}" in
118 *-sunos* )
119 loclibs='-lsocket -lnsl'
120 ;;
121 esac
122 ( cd mkspecs/qws
123 for plat in freebsd-generic-g++ macx-generic-g++ solaris-generic-g++;
124 do
125 ln -s $plat `echo $plat | %{l_shtool} subst -e 's;\(.*\)-generic-\(.*\);\1-x86-\2;'`
126 done
127 ) || exit $?
128 %{l_shtool} subst \
129 -e 's;\(-z[\t ][\t ]*\)\([^\t \"][^\t \"]*\);\1"\2";g' \
130 configure
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 \
135 -e 's; *QMakeVar set QMAKE_CFLAGS_X11.*QT_CFLAGS_FONTCONFIG.*;;' \
136 -e 's; *QMakeVar set QMAKE_LIBS_X11.*QT_LIBS_FONTCONFIG.*;;' \
137 configure
138 %{l_shtool} subst \
139 -e "s;\(OPENSSL_LIBS *=\) *-lssl -lcrypto;\1 $openssllibs;" \
140 configure
141 # yes this is needed several times to catch nested occurences of '--cflags'
142 %{l_shtool} subst \
143 -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' \
145 configure
146 %{l_shtool} subst \
147 -e 's;\(TRY_INCLUDEPATHS = \).*\(\$\$INCLUDEPATH\);\1\2;' \
148 -e 's;/freetype2;/freetype;' \
149 config.tests/unix/freetype/freetype.pri
150 %{l_shtool} subst \
151 -e "s;\(LIBS.*=.*-lmng\);\1 $lcmslibs;" \
152 src/gui/image/qmnghandler.pri
153 %{l_shtool} subst \
154 -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconflibs;" \
155 config.tests/x11/fontconfig/fontconfig.pro
156 echo 'INCLUDEPATH += /usr/include/wacomcfg' \
157 >>src/gui/kernel/x11.pri
158 echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \
159 >>src/gui/kernel/x11.pri
160 echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \
161 >>src/gui/text/text.pri
162 echo "INCLUDEPATH = `%{l_prefix}/bin/pkg-config --cflags-only-I dbus-1 | %{l_shtool} subst -e 's;\-I;;g'`" \
163 >>config.tests/unix/dbus/dbus.pro
164 echo "LIBS = `%{l_prefix}/bin/pkg-config --libs-only-l --static dbus-1`" \
165 >>config.tests/unix/dbus/dbus.pro
166 %{l_shtool} subst \
167 -e "s;\(LIBS.*= -lpq\);\1 `%{l_prefix}/bin/pg_config --libs` $loclibs;" \
168 config.tests/unix/psql/psql.pro
169 %{l_shtool} subst \
170 -e 's;^mac[^:][^:]*:\(LIBS\);\1;' \
171 config.tests/unix/iconv/iconv.pro
172 uiclibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig lcms`
173 %{l_shtool} subst \
174 -e 's;LIBS .*= -lpq$;LIBS += -lpq -lssl -lcrypto;' \
175 src/sql/drivers/drivers.pri
176 %{l_shtool} subst \
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" \
178 src/corelib/kernel/kernel.pri \
179 src/gui/kernel/kernel.pri
180 %{l_shtool} subst \
181 -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_PSQL;INCPATH += `pg_config --includedir 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \
182 -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_MYSQL;INCPATH += `mysql_config --include 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \
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" \
184 -e 's;!static:\(!isEmpty(QT_LFLAGS_PSQL)\);\1;' \
185 -e 's;!static:\(LIBS \*= \$\$QT_LFLAGS_PSQL\);\1;' \
186 src/plugins/sqldrivers/mysql/mysql.pro \
187 src/plugins/sqldrivers/psql/psql.pro \
188 src/plugins/sqldrivers/sqlite/sqlite.pro \
189 src/sql/drivers/drivers.pri
190 %{l_shtool} subst \
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" \
192 src/dbus/dbus.pro
193 %{l_shtool} subst \
194 -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \
195 -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1;' \
196 -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \
197 -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2;" \
198 -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \
199 mkspecs/qws/*/qmake.conf \
200 mkspecs/*/*.conf
201 %{l_shtool} subst \
202 -e 's;^\(QMAKE_LIBS +=.*\);\1 -liconv;' \
203 src/corelib/corelib.pro
204 %{l_shtool} subst \
205 -e "s;^\(QMAKE_INCDIR_X11[^=]*=\).*;\1 %{l_prefix}/include $x11_incdir;" \
206 -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\).*;\1 %{l_prefix}/lib $x11_libdir;" \
207 mkspecs/qws/solaris*/qmake.conf \
208 mkspecs/solaris*/qmake.conf
209 echo "QMAKE_LIBDIR += %{l_prefix}/lib/qt/dynamic" \
210 >>mkspecs/features/shared.prf
211 %{l_shtool} subst \
212 -e 's; *\.\./3rdparty/freetype/.*;;g' \
213 -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \
214 src/gui/text/text.pri
215 %{l_shtool} subst \
216 -e 's;\(#include *"\)\(tiffio.h"\);\1tiff/\2;' \
217 src/gui/image/qtiffhandler.cpp
218 %{l_shtool} subst \
219 -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \
220 tools/qtconfig/qtconfig.pro
221 #%{l_shtool} subst \
222 # -e "s;\(\\title\) All Classes;\1 Qt's Classes;" \
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
232 %build
233 # protect against sloppy code inclusion of all unused subprojects
234 (cd src/3rdparty && rm -rf [^cdehjmswxz]* sql* win* zlib zlib.pri) || exit $?
236 # detect which platform for which to build
237 case "%{l_platform -t}" in
238 sun4[uv]-sunos* | amd64-sunos* ) platcomp="solaris-g++-64" ;;
239 i?86-sunos* ) platcomp="solaris-g++" ;;
240 amd64-linux* ) platcomp="linux-g++-64" ;;
241 i?86-linux* ) platcomp="linux-g++" ;;
242 amd64-freebsd* | i?86-freebsd* ) platcomp="freebsd-g++" ;;
243 *-aix* ) platcomp="aix-g++" ;;
244 *-darwin* ) platcomp="macx-g++" ;;
245 *-hpux* ) platcomp="hpux-g++" ;;
246 *-irix* ) platcomp="irix-g++" ;;
247 * ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;;
248 esac
250 # detect which architecture extensions are available
251 archflags=''
252 case "%{l_platform -t}" in
253 amd64-* )
254 break
255 ;;
256 * )
257 archflags='-no-sse2 -no-3dnow'
258 ;;
259 esac
261 %if "%{with_shared}" == "yes"
262 # optional shared build (precedes mandatory static build)
263 echo 'yes' | ./configure \
264 $archflags \
265 -opensource \
266 -prefix %{l_prefix} \
267 -bindir %{l_prefix}/bin \
268 -libdir %{l_prefix}/lib/qt/dynamic \
269 -docdir %{l_prefix}/share/qt/doc \
270 -headerdir %{l_prefix}/include \
271 -plugindir %{l_prefix}/lib/qt/plugins \
272 -datadir %{l_prefix}/share/qt \
273 -translationdir %{l_prefix}/share/qt/translations \
274 -sysconfdir %{l_prefix}/etc/qt \
275 -examplesdir %{l_prefix}/share/qt/examples \
276 -demosdir %{l_prefix}/share/qt/demos \
277 -release \
278 -shared \
279 -platform $platcomp \
280 -no-sql-ibase \
281 %if "%{with_mysql}" == "yes"
282 -qt-sql-mysql \
283 -plugin-sql-mysql \
284 %else
285 -no-sql-mysql \
286 %endif
287 %if "%{with_pgsql}" == "yes"
288 -qt-sql-psql \
289 -plugin-sql-psql \
290 %else
291 -no-sql-psql \
292 %endif
293 -no-sql-odbc \
294 -system-sqlite \
295 -qt-sql-sqlite \
296 -plugin-sql-sqlite \
297 -no-sql-sqlite2 \
298 -openssl-linked \
299 -xmlpatterns \
300 -svg \
301 -webkit \
302 -system-zlib \
303 -qt-gif \
304 -system-libpng \
305 -system-libmng \
306 -system-libjpeg \
307 -system-libtiff \
308 -rpath \
309 -no-cups \
310 -iconv \
311 -pch \
312 -dbus-linked \
313 -opengl \
314 -xrender \
315 -fontconfig \
316 -freetype \
317 -no-glib
319 # default options are implicitly used, for example...
320 #-no-fast -exceptions -accessibility -stl -qt3support -nis
321 #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
323 # carry out shared build procedure
324 ( cd src
325 %{l_make} %{l_mflags -O} \
326 sub-moc sub-rcc sub-uic sub-uic3
327 ) || exit $?
328 %{l_make} %{l_mflags -O} \
329 sub-corelib-make_default-ordered \
330 sub-xml-make_default-ordered \
331 sub-network-make_default-ordered \
332 sub-sql-make_default-ordered \
333 sub-testlib-make_default-ordered \
334 sub-dbus-make_default-ordered \
335 sub-gui-make_default-ordered \
336 sub-qt3support-make_default-ordered \
337 sub-opengl-make_default-ordered \
338 sub-xmlpatterns-make_default-ordered \
339 sub-multimedia-make_default-ordered \
340 sub-svg-make_default-ordered \
341 sub-script-make_default-ordered \
342 sub-declarative-make_default-ordered \
343 sub-javascriptcore-make_default-ordered \
344 sub-webkit-make_default-ordered \
345 sub-scripttools-make_default-ordered \
346 sub-plugins-make_default-ordered \
347 sub-imports-make_default-ordered \
348 sub-webkitdeclarative-make_default-ordered \
349 sub-translations-make_default-ordered
351 # arthur plugin requires libQtDesigner
352 ( cd demos
353 ( cd ../tools/designer/src/lib
354 %{l_make} %{l_mflags -O}
355 ) || exit $?
356 %{l_make} %{l_mflags -O} sub-arthurplugin
357 ) || exit $?
359 # cache shared libs and initialize the build configuration, which
360 # would otherwise still contain references to our shared libs build
361 %{l_shtool} mkdir -f -p -m 755 sharbuild/dynamic
362 mv lib/* sharbuild/dynamic/
363 mv plugins sharbuild/
364 %{l_make} %{l_mflags} confclean
365 %endif
367 # mandatory static build (follows optional shared build)
368 echo 'yes' | ./configure \
369 $archflags \
370 -opensource \
371 -prefix %{l_prefix} \
372 -bindir %{l_prefix}/bin \
373 -libdir %{l_prefix}/lib \
374 -docdir %{l_prefix}/share/qt/doc \
375 -headerdir %{l_prefix}/include \
376 -plugindir %{l_prefix}/lib/qt/plugins \
377 -datadir %{l_prefix}/share/qt \
378 -translationdir %{l_prefix}/share/qt/translations \
379 -sysconfdir %{l_prefix}/etc/qt \
380 -examplesdir %{l_prefix}/share/qt/examples \
381 -demosdir %{l_prefix}/share/qt/demos \
382 -release \
383 -static \
384 -platform $platcomp \
385 -no-sql-ibase \
386 %if "%{with_mysql}" == "yes"
387 -qt-sql-mysql \
388 %else
389 -no-sql-mysql \
390 %endif
391 %if "%{with_pgsql}" == "yes"
392 -qt-sql-psql \
393 %else
394 -no-sql-psql \
395 %endif
396 -no-sql-odbc \
397 -system-sqlite \
398 -qt-sql-sqlite \
399 -no-sql-sqlite2 \
400 -openssl-linked \
401 -xmlpatterns \
402 -svg \
403 -no-webkit \
404 -system-zlib \
405 -qt-gif \
406 -system-libpng \
407 -system-libmng \
408 -system-libjpeg \
409 -system-libtiff \
410 -rpath \
411 -no-cups \
412 -iconv \
413 -pch \
414 -dbus-linked \
415 -opengl \
416 -xrender \
417 -fontconfig \
418 -freetype \
419 -no-glib
421 # default options are implicitly used, for example...
422 #-no-fast -exceptions -accessibility -stl -qt3support -nis
423 #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
425 # carry out static build procedure
426 %{l_make} %{l_mflags -O} sub-src
427 %if "%{with_tools}" == "yes"
428 %{l_make} %{l_mflags -O} \
429 sub-tools-make_default-ordered sub-translations-make_default-ordered
430 %endif
431 %if "%{with_examples}" == "yes"
432 %{l_make} %{l_mflags -O} \
433 sub-demos-make_default-ordered \
434 sub-examples-make_default-ordered
435 %endif
436 %if "%{with_tools}" == "yes"
437 %{l_make} %{l_mflags -O} docs
438 %else
439 %if "%{with_examples}" == "yes"
440 %{l_make} %{l_mflags -O} docs
441 %endif
442 %endif
444 %install
445 rm -rf $RPM_BUILD_ROOT
447 # carry out installation procedure
448 targets="sub-tools-bootstrap-install_subtargets-ordered \
449 sub-moc-install_subtargets-ordered \
450 sub-rcc-install_subtargets-ordered \
451 sub-uic-install_subtargets-ordered \
452 sub-corelib-install_subtargets-ordered \
453 sub-xml-install_subtargets-ordered \
454 sub-network-install_subtargets-ordered \
455 sub-sql-install_subtargets-ordered \
456 sub-testlib-install_subtargets-ordered \
457 sub-dbus-install_subtargets-ordered \
458 sub-gui-install_subtargets-ordered \
459 sub-qt3support-install_subtargets-ordered \
460 sub-uic3-install_subtargets-ordered \
461 sub-opengl-install_subtargets-ordered \
462 sub-xmlpatterns-install_subtargets-ordered \
463 sub-multimedia-install_subtargets-ordered \
464 sub-svg-install_subtargets-ordered \
465 sub-script-install_subtargets-ordered \
466 sub-declarative-install_subtargets-ordered \
467 sub-scripttools-install_subtargets-ordered \
468 sub-imports-install_subtargets-ordered \
469 sub-translations-install_subtargets-ordered"
471 %if "%{with_tools}" == "yes"
472 targets="$targets sub-tools-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
473 %endif
474 %if "%{with_examples}" == "yes"
475 targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
476 %endif
477 targets="$targets install_qmake install_mkspecs"
478 %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT"
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
487 %if "%{with_shared}" == "yes"
488 # install shared libs and symlinks
489 %{l_shtool} mkdir -f -p -m 755 \
490 $RPM_BUILD_ROOT%{l_prefix}/lib/qt
491 %{l_tar} cf - sharbuild/dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
493 # offer limited support of pkg-config(1) for shared libs
494 # substitution unfortunately only handles paths with no whitespace
495 %{l_shtool} subst \
496 -e "s;-L[^\t ][^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};g" \
497 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/*
499 # explain nonstandard shared library placement
500 ( echo "This OpenPKG Qt build is using the with_shared option."
501 echo ""
502 echo "The directory %{l_prefix}/lib/qt/dynamic contains the"
503 echo "requested shared libraries. Although shared libraries"
504 echo "have been optionally built (see the build time"
505 echo "'with_shared yes' option), static libraries were"
506 echo "built by default as usual, and installed in the"
507 echo "standard library directory %{l_prefix}/lib."
508 echo ""
509 echo "To build applications using shared libraries instead,"
510 echo "please direct pkg-config(1) to use the proper definitions"
511 echo "by setting the environment variable PKG_CONFIG_PATH to "
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."
518 ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README
519 %endif
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};" \
524 -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}\(/[^\t ][^\t ]*\);-L\1%{l_prefix}\2;g" \
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" \
532 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \
533 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la
534 %endif
536 ## Doesn't work as expected, because RPM reads the --[in|ex]cludedocs
537 ## argument only when installing binary packages, rather than building.
538 #%define _excludedocs 0
539 #%define _includedocs 1
540 # echo %{_excludedocs}
541 # echo %{_includedocs}
542 #
543 ## Doesn't work as expected, because it seems that OpenPKG too mercilessly
544 ## removes RPM readi1ng of the %docdir keyword in rpm.patch.feature.
545 # %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
546 # %{l_files_std} \
547 # '%docdir %{l_prefix}/share/pkg/doc'
548 #
549 ## Doesn't work as expected, because the rpmtool(1) marks
550 ## only einzeln files as documents, skipping directories
551 # %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
552 # %{l_files_std} \
553 # '%doc %{l_prefix}/share/pkg/doc/doc.txt'
554 #
555 # determine internal file listing
556 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
557 %{l_files_std} \
558 '%not %dir %{l_prefix}/lib/pkgconfig'
560 %files -f files
562 %clean
563 rm -rf $RPM_BUILD_ROOT