Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
1 ##
2 ## qt.spec -- OpenPKG RPM Specification
3 ## Copyright (c) 2011 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: Europalab Networks Production
39 Class: EVAL
40 Group: Development
41 License: GPL
42 Version: 4.7.3
43 Release: 20110514
45 # build options
46 %option with_tools yes
47 %option with_glib no
48 %option with_mysql no
49 %option with_pgsql no
50 %option with_shared no
51 %option with_examples no
53 # list of sources
54 Source0: ftp://ftp.qt.nokia.com/qt/source/qt-everywhere-opensource-src-%{version}.tar.gz
56 # build information
57 Prefix: %{l_prefix}
58 BuildRoot: %{l_buildroot}
59 BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc
60 PreReq: OpenPKG, openpkg >= 20060823
61 BuildPreReq: X11, png, mng, jpeg, tiff, mesa, xrender
62 PreReq: X11, png, mng, jpeg, tiff, mesa, xrender
63 BuildPreReq: pkgconfig, openssl, zlib, libiconv, sqlite, dbus
64 PreReq: pkgconfig, openssl, zlib, libiconv, sqlite, dbus
65 BuildPreReq: fontconfig, freetype
66 PreReq: fontconfig, freetype
67 %if "%{with_glib}" == "yes"
68 BuildPreReq: glib2
69 PreReq: glib2
70 %endif
71 %if "%{with_mysql}" == "yes"
72 BuildPreReq: mysql
73 PreReq: mysql
74 %endif
75 %if "%{with_pgsql}" == "yes"
76 BuildPreReq: postgresql
77 PreReq: postgresql
78 %endif
79 AutoReq: no
80 AutoReqProv: no
81 Provides: QTSDK
83 %description
84 Qt is a comprehensive C++ framework for cross-platform application
85 development. It plays the role of a widget toolkit in facilitating
86 the development of software with a graphical user interface, however
87 Qt is useful for developing command line tools and consoles for
88 servers as well.
90 %track
91 prog qt = {
92 version = %{version}
93 url = ftp://ftp.qt.nokia.com/qt/source/
94 regex = qt-everywhere-opensource-src-(__VER__)\.tar\.gz
95 }
97 %prep
98 # announce exceptional build requirements
99 ( echo "This package has exceptional build requirements:"
100 echo " qt-%{version}-root (5 Go)"
101 echo " qt-everywhere-opensource-src-%{version} (6 Go)"
102 echo " qt-%{version}-<date>.<arch>-<os>-<tag>.rpm (2 Go)"
103 echo "Building with no options takes 3,0 hours on a dual core"
104 echo "2 GHz CPU, or 5,0 hours with all build options enabled."
105 ) | %{l_rpmtool} msg -b -t notice
107 %setup -q -n qt-everywhere-opensource-src-%{version}
108 x11_incdir=`%{l_rc} --query x11_incdir`
109 x11_libdir=`%{l_rc} --query x11_libdir`
110 fontconflibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig`
111 lcmslibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static lcms`
112 openssllibs=`%{l_prefix}/bin/pkg-config --libs --static openssl`
113 mysqllibs=`%{l_prefix}/bin/mysql_config --libs`
115 # MSvB In R/D: loclibs=''
116 # MSvB In R/D: case "%{l_platform -t}" in
117 # MSvB In R/D: *-sunos* )
118 # MSvB In R/D: loclibs='-lsocket -lnsl'
119 # MSvB In R/D: ;;
120 # MSvB In R/D: esac
121 ( cd mkspecs/qws
122 for plat in freebsd-generic-g++ macx-generic-g++ solaris-generic-g++;
123 do
124 ln -s $plat `echo $plat | %{l_shtool} subst -e 's;\(.*\)-generic-\(.*\);\1-x86-\2;'`
125 done
126 ) || exit $?
127 # Trolltech Bug:
128 # yes was specified for OpenVG but cannot be enabled due to functionality tests!
129 %{l_shtool} subst \
130 -e 's;lower_case_includes;lower_case_bug;g' \
131 configure
132 %{l_shtool} subst \
133 -e 's;\(-z[\t ][\t ]*\)\([^\t \"][^\t \"]*\);\1"\2";g' \
134 configure
135 %{l_shtool} subst \
136 -e 's;\(RPATH_FLAGS\)=.*\$QT_INSTALL_LIBS.*\(\$RPATH_FLAGS\)";\1="%{l_prefix}/lib/qt/dynamic \2";' \
137 -e 's;\(QMAKE_RPATHDIR +=\) \\"\$QT_INSTALL_LIBS\\";\1 %{l_prefix}/lib/qt/dynamic;' \
138 configure
139 %{l_shtool} subst \
140 -e "s;\(OPENSSL_LIBS *=\) *-lssl -lcrypto;\1 $openssllibs;" \
141 configure
142 %{l_shtool} subst \
143 -e 's; *QMakeVar set QMAKE_CFLAGS_X11.*QT_CFLAGS_FONTCONFIG.*;;' \
144 configure
145 # yes this is needed several times to catch nested occurences of '--libs'
146 %{l_shtool} subst \
147 -e 's;\(QT_LIBS_FONTCONFIG *=.*PKG_CONFIG.*\) --libs ;\1 --libs-only-L ;g' \
148 -e 's;\(QT_LIBS_FONTCONFIG *=.*PKG_CONFIG.*\) --libs ;\1 --libs-only-L ;g' \
149 configure
150 # yes this is needed several times to catch nested occurences of '--cflags'
151 %{l_shtool} subst \
152 -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \
153 -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \
154 configure
155 # Trolltech Bug:
156 # Glib support cannot be enabled due to functionality tests!
157 # Turn on verbose messaging (-v) to ./configure to see the final report.
158 # Trolltech Bug:
159 # In file included from ../../include/QtGui/private/qgtkstyle_p.h:1,
160 # from kernel/qguiplatformplugin.cpp:63:
161 # ....../qgtkstyle_p.h:69:21: error: gtk/gtk.h: No such file or directory
162 # Workaround resolution:
163 # hack to get back the standard '--cflags' of just Qt_CFLAGS_GLIB
164 # Question: Is this needed? QT_LIBS_QGTKSTYLE=`$PKG_CONFIG --libs gobject-2.0 2>/dev/null`
165 %{l_shtool} subst \
166 -e 's;\(QT_CFLAGS_GLIB *=.*PKG_CONFIG.*\) --cflags-only-other ;\1 --cflags ;g' \
167 -e 's;\(QT_CFLAGS_QGTKSTYLE *=.*PKG_CONFIG.*\) --cflags-only-other ;\1 --cflags ;g' \
168 configure
169 %{l_shtool} subst \
170 -e 's;\(TRY_INCLUDEPATHS = \).*\(\$\$INCLUDEPATH\);\1\2;' \
171 -e 's;/freetype2;/freetype;' \
172 config.tests/unix/freetype/freetype.pri
173 # Trolltech Bug:
174 # /opdv/lib/libmng.a(libmng_cms.o): In function `mnglcms_initlibrary':
175 # libmng_cms.c:(.text+0xa): undefined reference to `cmsErrorAction'
176 %{l_shtool} subst \
177 -e "s;\(LIBS.*=.*-lmng\);\1 $lcmslibs;" \
178 src/gui/image/qmnghandler.pri
179 # Trolltech Bug:
180 # lib/libQtGui.a(qapplication_x11.o): In function
181 # `qt_init(QApplicationPrivate*, int, _XDisplay*, unsigned long, unsigned long)':
182 # qapplication_x11.cpp:(.text+0xec8d): undefined reference to `FcInit'
183 %{l_shtool} subst \
184 -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconflibs;" \
185 config.tests/x11/fontconfig/fontconfig.pro
186 echo "LIBS += `%{l_prefix}/bin/pkg-config --libs-only-L fontconfig`" \
187 >>tools/linguist/linguist/linguist.pro
188 echo 'INCLUDEPATH += /usr/include/wacomcfg' \
189 >>src/gui/kernel/x11.pri
190 echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \
191 >>src/gui/kernel/x11.pri
192 echo "contains(QT_CONFIG, fontconfig) { LIBS += $fontconflibs }" \
193 >>src/gui/text/text.pri
194 # Trolltech Bug:
195 # The QtDBus module cannot be enabled because libdbus-1 version 0.93 was not found.
196 # Turn on verbose messaging (-v) to ./configure to see the final report.
197 echo "INCLUDEPATH = `%{l_prefix}/bin/pkg-config --cflags-only-I dbus-1 | %{l_shtool} subst -e 's;\-I;;g'`" \
198 >>config.tests/unix/dbus/dbus.pro
199 echo "LIBS = `%{l_prefix}/bin/pkg-config --libs-only-l --static dbus-1`" \
200 >>config.tests/unix/dbus/dbus.pro
201 # Trolltech Bug:
202 # PostgreSQL support cannot be enabled due to functionality tests!
203 # Turn on verbose messaging (-v) to ./configure to see the final report.
204 pgldflags=`%{l_prefix}/bin/pg_config --ldflags`
205 pglibs=`%{l_prefix}/bin/pg_config --libs`
206 %{l_shtool} subst \
207 -e "s;\(LIBS.*= -lpq\);\1 $pgldflags $pglibs $loclibs -pthread;" \
208 config.tests/unix/psql/psql.pro
209 # Trolltech Bug:
210 # make: *** [sub-examples-make_default-ordered] Error 2
211 # QMAKE_PRL_LIBS in libQtSql.prl is generated defective.
212 %{l_shtool} subst \
213 -e "s;\$\$*QT_LFLAGS_PSQL;$pgldflags;" \
214 -e "s;-lpq;-lpq $pglibs $loclibs -pthread;" \
215 src/sql/drivers/psql/qsql_psql.pri
216 # Trolltech Bug:
217 # Iconv support cannot be enabled due to functionality tests!
218 # Turn on verbose messaging (-v) to ./configure to see the final report.
219 %{l_shtool} subst \
220 -e 's;^mac[^:][^:]*:\(LIBS\);\1;' \
221 config.tests/unix/iconv/iconv.pro
222 # Trolltech Bug:
223 # Missing libmng test! Parts (src/gui/image/qmnghandler.cpp) use
224 # such libmng methods as mng_create(3), mng_putchunk_term(3)...
225 # These are only optional parts of typical MNG implementations.
226 # Questions surround whether the MNG standard [1] requires these
227 # API methods in their expected form, or if this alone is excuse
228 # enough for neglecting such build time configuration.
229 # [1] http://www.libpng.org/pub/mng/spec/
230 # A work around is to force integration of Qt 3rdparty embedded
231 # MNG logic, thus weakening the loosely coupled nature of Qt
232 # components and potentially affecting security.
233 # MSvB In R/D: uiclibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig lcms`
234 # MSvB In R/D: %{l_shtool} subst \
235 # MSvB In R/D: -e 's;LIBS .*= -lpq$;LIBS += -lpq -lssl -lcrypto;' \
236 # MSvB In R/D: -e "s;LIBS .*= \$\$QT_LFLAGS_MYSQL;LIBS += $mysqllibs;" \
237 # MSvB In R/D: src/sql/drivers/drivers.pri
238 # MSvB In R/D: %{l_shtool} subst \
239 # MSvB In R/D: -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" \
240 # MSvB In R/D: src/corelib/kernel/kernel.pri \
241 # MSvB In R/D: src/gui/kernel/kernel.pri
242 # MSvB In R/D: %{l_shtool} subst \
243 # MSvB In R/D: -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_PSQL;INCPATH += `pg_config --includedir 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \
244 # MSvB In R/D: -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_MYSQL;INCPATH += `mysql_config --include 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \
245 # MSvB In R/D: -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" \
246 # MSvB In R/D: -e 's;!static:\(!isEmpty(QT_LFLAGS_PSQL)\);\1;' \
247 # MSvB In R/D: -e 's;!static:\(LIBS \*= \$\$QT_LFLAGS_PSQL\);\1;' \
248 # MSvB In R/D: src/plugins/sqldrivers/mysql/mysql.pro \
249 # MSvB In R/D: src/plugins/sqldrivers/psql/psql.pro \
250 # MSvB In R/D: src/plugins/sqldrivers/sqlite/sqlite.pro \
251 # MSvB In R/D: src/sql/drivers/drivers.pri
252 # Trolltech Bug:
253 # In file included from qdbusconnectioninterface.cpp:52:0:
254 # qdbus_symbols_p.h:58:23: fatal error: dbus/dbus.h: No such file or directoryIn
255 # file included from qdbusconnection_p.h:70:0, from qdbusconnection.cpp:51:
256 %{l_shtool} subst \
257 -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" \
258 src/dbus/dbus.pro
259 # Trolltech Bug:
260 # All the OpenGL functionality tests failed!
261 # You might need to modify the include and library search paths by
262 # editing QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in
263 # /home/mschloh/opwrk/tmp/qt-everywhere-opensource-src-4.7.3/mkspecs/linux-g++-64.
264 %{l_shtool} subst \
265 -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \
266 -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/lib;' \
267 -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\).*;\1 $x11_incdir;" \
268 -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\).*;\1 $x11_libdir;" \
269 -e "s;^\(QMAKE_INCDIR_OPENVG[^=]*=\).*;\1 $x11_incdir;" \
270 -e "s;^\(QMAKE_LIBDIR_OPENVG[^=]*=\).*;\1 $x11_libdir;" \
271 -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \
272 mkspecs/qws/*/qmake.conf \
273 mkspecs/*/*.conf
274 # Trolltech Bug:
275 # yes was specified for OpenVG but cannot be enabled due to functionality tests!
276 %{l_shtool} subst \
277 -e 's;\(\$\$*\)\(QMAKE_LIBS_OPENVG\);\1\2 \1QMAKE_LIBS_THREAD;' \
278 config.tests/unix/openvg/openvg.pro
279 echo 'QMAKE_LIBS_OPENVG = -lOpenVG' \
280 >>mkspecs/common/unix.conf
281 %{l_shtool} subst \
282 -e "s;^\(QMAKE_INCDIR_X11[^=]*=\).*;\1 $x11_incdir;" \
283 -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\).*;\1 $x11_libdir;" \
284 mkspecs/qws/*/qmake.conf \
285 mkspecs/*/qmake.conf
286 %{l_shtool} subst \
287 -e 's;^\(QMAKE_LIBS +=.*\);\1 -liconv;' \
288 src/corelib/corelib.pro
289 # Trolltech Bug:
290 # In file included from ../JavaScriptCore/runtime/RegExp.h:29:0,
291 # ../JavaScriptCore/yarr/RegexJIT.h: In destructor 'JSC::Yarr::RegexCodeBlock::~RegexCodeBlock()':
292 # ../JavaScriptCore/yarr/RegexJIT.h:63:36: error: 'jsRegExpFree' was not declared in this scope
293 %{l_shtool} subst \
294 -e 's;\(DESTDIR *=\) *\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;' \
295 src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro
296 # Trolltech Bug:
297 # In file included from ../JavaScriptCore/runtime/RegExp.h:29:0,
298 # ../JavaScriptCore/yarr/RegexJIT.h: In destructor 'JSC::Yarr::RegexCodeBlock::~RegexCodeBlock()':
299 # ../JavaScriptCore/yarr/RegexJIT.h:63:36: error: 'jsRegExpFree' was not declared in this scope
300 %{l_shtool} subst \
301 -e 's;\(pathToJavaScriptCoreOutput *=\) *\$\$ARGS/\$\$JAVASCRIPTCORE_DESTDIR;\1 $$QMAKE_LIBDIR_QT;g' \
302 src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
303 # MSvB In R/D: echo "QMAKE_LIBDIR += %{l_prefix}/lib/qt/dynamic" \
304 # MSvB In R/D: >>mkspecs/features/shared.prf
305 # MSvB In R/D: %{l_shtool} subst \
306 # MSvB In R/D: -e 's; *\.\./3rdparty/freetype/.*;;g' \
307 # MSvB In R/D: -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \
308 # MSvB In R/D: src/gui/text/text.pri
309 # Trolltech Bug:
310 # image/qtiffhandler.cpp:48:20: fatal error: tiffio.h: No such file or directory
311 # compilation terminated.
312 # make[1]: *** [.obj/release-static/qtiffhandler.o] Error 1
313 %{l_shtool} subst \
314 -e 's;\(#include *"\)\(tiffio.h"\);\1tiff/\2;' \
315 src/gui/image/qtiffhandler.cpp
316 # Trolltech Bug:
317 # In file included from ../../../gui/image/qjpeghandler.cpp:42:0:
318 # ../../../gui/image/qjpeghandler_p.h:45:35: fatal error:
319 # QtGui/qimageiohandler.h: No such file or directory
320 %{l_shtool} subst \
321 -e 's;\(INCLUDEPATH *\*=\)\( *\);\1 $RPM_BUILD_DIR/qt-everywhere-opensource-src-%{version}/include\2;' \
322 src/gui/image/qjpeghandler.pri
323 # MSvB In R/D: %{l_shtool} subst \
324 # MSvB In R/D: -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \
325 # MSvB In R/D: tools/qtconfig/qtconfig.pro
326 # MSvB In R/D: %{l_shtool} subst \
327 # MSvB In R/D: -e 's;webkit;web-broken-kit;g' \
328 # MSvB In R/D: tools/assistant/tools/assistant/assistant.pro
329 # MSvB In R/D: echo "DEFINES += QT_NO_WEBKIT" \
330 # MSvB In R/D: >>tools/assistant/tools/assistant/assistant.pro
331 # MSvB In R/D: %{l_shtool} subst \
332 # MSvB In R/D: -e 's;Qt.s Classes;All Classes;' \
333 # MSvB In R/D: tools/assistant/tools/assistant/doc/assistant.qdoc \
334 # MSvB In R/D: tools/qdoc3/doc/qdoc-manual.qdoc \
335 # MSvB In R/D: tools/qdoc3/doc/files/qt.qdocconf \
336 # MSvB In R/D: tools/qdoc3/test/qt-build-docs.qdocconf \
337 # MSvB In R/D: tools/qdoc3/test/qt.qdocconf
338 # Trolltech Bug:
339 # In file included from qpaintengine_vg.cpp:42:0:
340 # qpaintengine_vg_p.h:66:39: error: expected initializer before ':' token
341 # make[1]: *** [.obj/release-static/qpaintengine_vg.o] Error 1
342 # make: *** [sub-openvg-sub_src_target_ordered] Error 2
343 %{l_shtool} subst \
344 -e 's;Q_OPENVG_EXPORT;Q_DECL_EXPORT;g' \
345 src/openvg/*
347 %build
348 # protect against sloppy code inclusion of all unused subprojects
349 # MSvB In R/D: ce-compat clucene des easing harfbuzz javascriptcore md4 md5 s60 sha1 webkit xorg zlib_dependency.pri
350 (cd src/3rdparty && rm -rf [^cdehjmswxz]* sql* win* zlib zlib.pri) || exit $?
352 # detect which platform for which to build
353 case "%{l_platform -t}" in
354 sun4[uv]-sunos* | amd64-sunos* ) platcomp="solaris-g++-64" ;;
355 i?86-sunos* ) platcomp="solaris-g++" ;;
356 amd64-linux* ) platcomp="linux-g++-64" ;;
357 i?86-linux* ) platcomp="linux-g++" ;;
358 amd64-freebsd* | i?86-freebsd* ) platcomp="freebsd-g++" ;;
359 *-aix* ) platcomp="aix-g++" ;;
360 *-darwin* ) platcomp="macx-g++" ;;
361 *-hpux* ) platcomp="hpux-g++" ;;
362 *-irix* ) platcomp="irix-g++" ;;
363 * ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;;
364 esac
366 # detect which architecture extensions are available
367 archflags=''
368 case "%{l_platform -t}" in
369 amd64-* )
370 break
371 ;;
372 * )
373 archflags='-no-sse2 -no-3dnow'
374 ;;
375 esac
377 %if "%{with_shared}" == "yes"
378 # optional shared build (precedes mandatory static build)
379 echo 'yes' | ./configure \
380 $archflags \
381 -opensource \
382 -prefix %{l_prefix} \
383 -bindir %{l_prefix}/bin \
384 -libdir %{l_prefix}/lib/qt/dynamic \
385 -docdir %{l_prefix}/share/qt/doc \
386 -headerdir %{l_prefix}/include \
387 -plugindir %{l_prefix}/lib/qt/plugins \
388 -datadir %{l_prefix}/share/qt \
389 -translationdir %{l_prefix}/share/qt/translations \
390 -sysconfdir %{l_prefix}/etc/qt \
391 -examplesdir %{l_prefix}/share/qt/examples \
392 -demosdir %{l_prefix}/share/qt/demos \
393 %if 0
394 # Build time Qt definitions should predominate,
395 # otherwise foreign definitions cause errors like:
396 #
397 # g++ -c -I/foreign/include [...] animation/qguivariantanimation.cpp
398 # .moc/release-shared/moc_qnamespace.cpp:426:16: error: 'WA_LockPortraitOrientation' is not a member of 'Qt'
399 # .moc/release-shared/moc_qnamespace.cpp:427:16: error: 'WA_LockLandscapeOrientation' is not a member of 'Qt'
400 # .moc/release-shared/moc_qnamespace.cpp:428:16: error: 'WA_AutoOrientation' is not a member of 'Qt'
401 # .moc/release-shared/moc_qnamespace.cpp:440:16: error: 'AA_S60DisablePartialScreenInputMode' is not a member of 'Qt'
402 #
403 # Other problems include flawed definitions polluting (C|CXX)FLAGS
404 # and overriding the correct definitions in CPPFLAGS. Variables
405 # like QMAKE_(C|CXX)FLAGS exhibit this problem as well.
406 #
407 # The work around is to force a Qt dist include path in (C|CXX)FLAGS.
408 %endif
409 -I$RPM_BUILD_DIR/qt-everywhere-opensource-src-%{version}/include \
410 -release \
411 -shared \
412 -platform $platcomp \
413 -s60 \
414 -qt-style-s60 \
415 -no-sql-ibase \
416 %if "%{with_glib}" == "yes"
417 -glib \
418 %else
419 -no-glib \
420 %endif
421 %if "%{with_mysql}" == "yes"
422 -qt-sql-mysql \
423 -plugin-sql-mysql \
424 %else
425 -no-sql-mysql \
426 %endif
427 %if "%{with_pgsql}" == "yes"
428 -qt-sql-psql \
429 -plugin-sql-psql \
430 %else
431 -no-sql-psql \
432 %endif
433 -no-sql-odbc \
434 -system-sqlite \
435 -qt-sql-sqlite \
436 -plugin-sql-sqlite \
437 -no-sql-sqlite2 \
438 -openssl-linked \
439 -optimized-qmake \
440 -xmlpatterns \
441 -svg \
442 -webkit \
443 -system-zlib \
444 -qt-gif \
445 -system-libpng \
446 -system-libmng \
447 -system-libjpeg \
448 -system-libtiff \
449 -rpath \
450 -no-cups \
451 -iconv \
452 -pch \
453 -dbus-linked \
454 -opengl \
455 -openvg \
456 -xrender \
457 -fontconfig \
458 -freetype
460 # default options are implicitly used, for example...
461 #-no-fast -exceptions -accessibility -stl -qt3support -nis
462 #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
464 # carry out shared build procedure
465 # Trolltech Bug:
466 # Problem with dependency order, causes compiling of source files
467 # with unconfigured dependencies to other files to fail when
468 # building the sources in parallel. The implemented work around
469 # is disabling parallel make, causing a nearly 100% build deceleration.
470 # itemviews/qlistview.cpp: In member function 'void QListModeViewBase::dragMoveEvent(QDragMoveEvent*)':
471 # itemviews/qlistview.cpp:3134:1: internal compiler error: Segmentation fault
472 ( cd src
473 %{l_make} %{l_mflags} \
474 sub-moc sub-rcc sub-uic sub-uic3
475 ) || exit $?
476 # Trolltech Bug:
477 # Problem with dependency order, causes compiling of source files
478 # with unconfigured dependencies to other files to fail when
479 # building the sources in parallel. The implemented work around
480 # is disabling parallel make, causing a nearly 100% build deceleration.
481 %{l_make} %{l_mflags} \
482 sub-corelib-make_default-ordered \
483 sub-xml-make_default-ordered \
484 sub-network-make_default-ordered \
485 sub-sql-make_default-ordered \
486 sub-testlib-make_default-ordered \
487 sub-dbus-make_default-ordered \
488 sub-gui-make_default-ordered \
489 sub-qt3support-make_default-ordered \
490 sub-opengl-make_default-ordered \
491 sub-xmlpatterns-make_default-ordered \
492 sub-multimedia-make_default-ordered \
493 sub-svg-make_default-ordered \
494 sub-script-make_default-ordered \
495 sub-declarative-make_default-ordered \
496 sub-javascriptcore-make_default-ordered \
497 sub-webkit-make_default-ordered \
498 sub-scripttools-make_default-ordered \
499 sub-plugins-make_default-ordered \
500 sub-imports-make_default-ordered \
501 sub-webkitdeclarative-make_default-ordered \
502 sub-translations-make_default-ordered
504 # arthur plugin requires libQtDesigner
505 ( cd demos
506 ( cd ../tools/designer/src/lib
507 %{l_make} %{l_mflags -O}
508 ) || exit $?
509 %{l_make} %{l_mflags -O} sub-arthurplugin
510 ) || exit $?
512 # cache shared libs and initialize the build configuration, which
513 # would otherwise still contain references to our shared libs build
514 %{l_shtool} mkdir -f -p -m 755 sharbuild/dynamic
515 mv lib/* sharbuild/dynamic/
516 mv plugins sharbuild/
517 %{l_make} %{l_mflags} confclean
518 %endif
520 # mandatory static build (follows optional shared build)
521 echo 'yes' | ./configure \
522 $archflags \
523 -opensource \
524 -prefix %{l_prefix} \
525 -bindir %{l_prefix}/bin \
526 -libdir %{l_prefix}/lib \
527 -docdir %{l_prefix}/share/qt/doc \
528 -headerdir %{l_prefix}/include \
529 -plugindir %{l_prefix}/lib/qt/plugins \
530 -datadir %{l_prefix}/share/qt \
531 -translationdir %{l_prefix}/share/qt/translations \
532 -sysconfdir %{l_prefix}/etc/qt \
533 -examplesdir %{l_prefix}/share/qt/examples \
534 -demosdir %{l_prefix}/share/qt/demos \
535 %if 0
536 # Build time Qt definitions should predominate,
537 # otherwise foreign definitions cause errors like:
538 #
539 # g++ -c -I/foreign/include [...] animation/qguivariantanimation.cpp
540 # .moc/release-shared/moc_qnamespace.cpp:426:16: error: 'WA_LockPortraitOrientation' is not a member of 'Qt'
541 # .moc/release-shared/moc_qnamespace.cpp:427:16: error: 'WA_LockLandscapeOrientation' is not a member of 'Qt'
542 # .moc/release-shared/moc_qnamespace.cpp:428:16: error: 'WA_AutoOrientation' is not a member of 'Qt'
543 # .moc/release-shared/moc_qnamespace.cpp:440:16: error: 'AA_S60DisablePartialScreenInputMode' is not a member of 'Qt'
544 #
545 # Other problems include flawed definitions polluting (C|CXX)FLAGS
546 # and overriding the correct definitions in CPPFLAGS. Variables
547 # like QMAKE_(C|CXX)FLAGS exhibit this problem as well.
548 #
549 # The work around is to force a Qt dist include path in (C|CXX)FLAGS.
550 %endif
551 -I$RPM_BUILD_DIR/qt-everywhere-opensource-src-%{version}/include \
552 -release \
553 -static \
554 -platform $platcomp \
555 -s60 \
556 -qt-style-s60 \
557 -no-sql-ibase \
558 %if "%{with_glib}" == "yes"
559 -glib \
560 %else
561 -no-glib \
562 %endif
563 %if "%{with_mysql}" == "yes"
564 -qt-sql-mysql \
565 %else
566 -no-sql-mysql \
567 %endif
568 %if "%{with_pgsql}" == "yes"
569 -qt-sql-psql \
570 %else
571 -no-sql-psql \
572 %endif
573 -no-sql-odbc \
574 -system-sqlite \
575 -qt-sql-sqlite \
576 -no-sql-sqlite2 \
577 -openssl-linked \
578 -optimized-qmake \
579 -xmlpatterns \
580 -svg \
581 -webkit \
582 -system-zlib \
583 -qt-gif \
584 -system-libpng \
585 -system-libmng \
586 -system-libjpeg \
587 -system-libtiff \
588 -rpath \
589 -no-cups \
590 -iconv \
591 -pch \
592 -dbus-linked \
593 -opengl \
594 -openvg \
595 -xrender \
596 -fontconfig \
597 -freetype
599 # default options are implicitly used, for example...
600 #-no-fast -exceptions -accessibility -stl -qt3support -nis
601 #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
603 # carry out static build procedure
604 # Trolltech Bug:
605 # Problem with dependency order, causes compiling of qtreeview.cpp
606 # with dependency to moc_qtreeview.cpp before moc(1) has finished.
607 # The implemented work around is disabling parallel make, causing
608 # a nearly 100% build deceleration but allowing the build to procede.
609 # In file included from itemviews/qtreeview.cpp:3761:0:
610 # .moc/release-static/moc_qtreeview.cpp: In member function 'QPixmap QTreeViewPrivate::renderTreeToPixmapForAnimation(const QRect&) const':
611 # .moc/release-static/moc_qtreeview.cpp:209:1: internal compiler error: Segmentation fault
612 %{l_make} %{l_mflags} sub-src
613 %if "%{with_tools}" == "yes"
614 %{l_make} %{l_mflags -O} \
615 sub-tools-make_default-ordered sub-translations-make_default-ordered
616 %endif
617 %if "%{with_examples}" == "yes"
618 # Trolltech Bug:
619 # Another problem with dependency order with the same work around,
620 # disabling parallel make and causing a nearly 100% build deceleration.
621 # In file included from main.cpp:136:0:
622 # .moc/release-static/main.moc:84:1: internal compiler error: Segmentation fault
623 # Please submit a full bug report,
624 # with preprocessed source if appropriate.
625 # See <http://openpkg.org/> for instructions.
626 # make[3]: *** [.obj/release-static/main.o] Error 1
627 # make[2]: *** [sub-validators-make_default] Error 2
628 %{l_make} %{l_mflags} \
629 sub-demos-make_default-ordered \
630 sub-examples-make_default-ordered
631 %endif
632 %if "%{with_tools}" == "yes"
633 %{l_make} %{l_mflags -O} docs
634 %else
635 %if "%{with_examples}" == "yes"
636 %{l_make} %{l_mflags -O} docs
637 %endif
638 %endif
640 %install
641 rm -rf $RPM_BUILD_ROOT
643 # carry out installation procedure
644 targets="sub-tools-bootstrap-install_subtargets-ordered \
645 sub-moc-install_subtargets-ordered \
646 sub-rcc-install_subtargets-ordered \
647 sub-uic-install_subtargets-ordered \
648 sub-corelib-install_subtargets-ordered \
649 sub-xml-install_subtargets-ordered \
650 sub-network-install_subtargets-ordered \
651 sub-sql-install_subtargets-ordered \
652 sub-testlib-install_subtargets-ordered \
653 sub-dbus-install_subtargets-ordered \
654 sub-gui-install_subtargets-ordered \
655 sub-qt3support-install_subtargets-ordered \
656 sub-uic3-install_subtargets-ordered \
657 sub-opengl-install_subtargets-ordered \
658 sub-xmlpatterns-install_subtargets-ordered \
659 sub-multimedia-install_subtargets-ordered \
660 sub-svg-install_subtargets-ordered \
661 sub-script-install_subtargets-ordered \
662 sub-declarative-install_subtargets-ordered \
663 sub-scripttools-install_subtargets-ordered \
664 sub-imports-install_subtargets-ordered \
665 sub-translations-install_subtargets-ordered"
667 %if "%{with_tools}" == "yes"
668 targets="$targets sub-tools-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
669 %endif
670 %if "%{with_examples}" == "yes"
671 targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered install_htmldocs install_qchdocs install_docimages"
672 %endif
673 targets="$targets install_qmake install_mkspecs"
674 %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT"
675 %{l_shtool} install -c -m 644 \
676 lib/libjscore.a lib/libjscore.prl \
677 $RPM_BUILD_ROOT%{l_prefix}/lib/
679 # correct paths in pkg-config(1) configuration files
680 %{l_shtool} subst \
681 -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};' \
682 -e 's;=\([\t ]*\)[^\t ]*qt-everywhere-opensource-src-%{version};=\1%{l_prefix};g' \
683 $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/*
684 # keep library paths clean by removing redundant paths
685 %{l_shtool} subst \
686 -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}[^\t ]*[\t ]*;;g' \
687 $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/*
689 # install static or shared plugins according to user choice
690 %if "%{with_shared}" != "yes"
691 %{l_make} %{l_mflags} sub-plugins-install_subtargets-ordered INSTALL_ROOT="$RPM_BUILD_ROOT"
692 %else
693 %{l_tar} cf - -C sharbuild plugins | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
694 %endif
696 %if "%{with_shared}" == "yes"
697 # install shared libs and symlinks
698 %{l_shtool} mkdir -f -p -m 755 \
699 $RPM_BUILD_ROOT%{l_prefix}/lib/qt
700 %{l_tar} cf - -C sharbuild dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
702 # offer limited support of pkg-config(1) for shared libs
703 # substitution unfortunately only handles paths with no whitespace
704 %{l_shtool} subst \
705 -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L%{l_prefix}/lib/qt/dynamic;' \
706 -e 's;=\([\t ]*\)[^\t ]*qt-everywhere-opensource-src-%{version};=\1%{l_prefix};g' \
707 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/*
708 # keep library paths clean by removing redundant paths
709 %{l_shtool} subst \
710 -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}[^\t ]*[\t ]*;;g' \
711 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/*
713 # explain nonstandard shared library placement
714 ( echo "This OpenPKG Qt build is using the with_shared option."
715 echo ""
716 echo "The directory %{l_prefix}/lib/qt/dynamic contains the"
717 echo "requested shared libraries. Although shared libraries"
718 echo "have been optionally built (see the build time"
719 echo "'with_shared yes' option), static libraries were"
720 echo "built by default as usual, and installed in the"
721 echo "standard library directory %{l_prefix}/lib."
722 echo ""
723 echo "To build applications using shared libraries instead,"
724 echo "please direct pkg-config(1) to use the proper definitions"
725 echo "by setting the environment variable PKG_CONFIG_PATH to "
726 echo "%{l_prefix}/lib/qt/dynamic/pkgconfig."
727 echo ""
728 echo "Note: If building via qmake(1), please append"
729 echo " either 'static' or 'shared' to the line"
730 echo " 'CONFIG +=' in the project file (name.pro)."
731 echo " Then execute %{l_prefix}/bin/qmake on this file."
732 ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README
733 %endif
735 # correct temporary runtime link paths (static libs)
736 %{l_shtool} subst \
737 -e 's;/./;/;g' \
738 -e 's;\(QMAKE_PRL_BUILD_DIR[\t ]*=\).*\(qt-everywhere-opensource-src-%{version}.*\);\1 /.../\2;' \
739 -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version};-L%{l_prefix};' \
740 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/plugins/*/*.prl \
741 $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl \
742 $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
743 # clean install by removing redundant paths (static libs)
744 %{l_shtool} subst \
745 -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}[^\t ]*[\t ]*;;g' \
746 $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl \
747 $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
748 %if "%{with_shared}" == "yes"
749 # correct temporary runtime link paths (dynamic libs)
750 %{l_shtool} subst \
751 -e 's;/\./;/;g' \
752 -e 's;\(QMAKE_PRL_BUILD_DIR[\t ]*=\).*\(qt-everywhere-opensource-src-%{version}.*\);\1 /.../\2;' \
753 -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L%{l_prefix}/lib/qt/dynamic;' \
754 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \
755 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la
756 # clean install by removing redundant paths (dynamic libs)
757 %{l_shtool} subst \
758 -e 's;-L[\t ]*[^\t ]*qt-everywhere-opensource-src-%{version}[^\t ]*[\t ]*;;g' \
759 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \
760 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la
761 %endif
763 ## Doesn't work as expected, because RPM reads the --[in|ex]cludedocs
764 ## argument only when installing binary packages, rather than building.
765 #%define _excludedocs 0
766 #%define _includedocs 1
767 # echo %{_excludedocs}
768 # echo %{_includedocs}
769 #
770 ## Doesn't work as expected, because it seems that OpenPKG too mercilessly
771 ## removes RPM reading of the %docdir keyword in rpm.patch.feature.
772 # %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
773 # %{l_files_std} \
774 # '%docdir %{l_prefix}/share/pkg/doc'
775 #
776 ## Doesn't work as expected, because the rpmtool(1) marks
777 ## only einzeln files as documents, skipping directories
778 # %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
779 # %{l_files_std} \
780 # '%doc %{l_prefix}/share/pkg/doc/doc.txt'
781 #
782 # determine internal file listing
783 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
784 %{l_files_std} \
785 '%not %dir %{l_prefix}/lib/pkgconfig'
787 %files -f files
789 %clean
790 rm -rf $RPM_BUILD_ROOT