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