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