qt/qt.spec

changeset 1
52e8b53d33be
child 3
c2e6bf16b6f4
equal deleted inserted replaced
-1:000000000000 0:33e55b4df288
1 ##
2 ## qt.spec -- OpenPKG RPM Specification
3 ## Copyright (c) 2008 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 ##
23
24
25 # package information
26 Name: qt
27 Summary: Cross-platform Application Framework
28 URL: http://www.trolltech.com/products/qt/
29 Vendor: Nokia Corporation
30 Packager: Michael Schloh von Bennewitz
31 Distribution: MSvB Recherche Production
32 Class: EVAL
33 Group: Development
34 License: GPL
35 Version: 4.4.3
36 Release: 20081124
37
38 # build options
39 %option with_tools yes
40 %option with_shared no
41 %option with_examples no
42
43 # list of sources
44 Source0: ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-%{version}.tar.gz
45
46 # build information
47 Prefix: %{l_prefix}
48 BuildRoot: %{l_buildroot}
49 BuildPreReq: OpenPKG, openpkg >= 20050726, gcc, pkgconfig
50 PreReq: OpenPKG, openpkg >= 20050726
51 BuildPreReq: X11, png, mng, jpeg, tiff, mesa, xrender
52 PreReq: X11, png, mng, jpeg, tiff, mesa, xrender
53 BuildPreReq: zlib, libiconv, sqlite, dbus, glib2
54 PreReq: zlib, libiconv, sqlite, dbus, glib2
55 BuildPreReq: fontconfig, freetype
56 PreReq: fontconfig, freetype
57 AutoReq: no
58 AutoReqProv: no
59 Provides: QTSDK
60
61 %description
62 Qt is a cross-platform application framework. Using Qt, you can
63 develop applications and user interfaces once, and deploy them
64 across many desktop and embedded operating systems without
65 rewriting the source code.
66
67 %track
68 prog qt = {
69 version = %{version}
70 url = ftp://ftp.trolltech.com/qt/source/
71 regex = qt-x11-opensource-src-(__VER__)\.tar\.gz
72 }
73
74 %prep
75 # announce exceptional build requirements
76 ( echo "This package has exceptional storage requirements:"
77 echo " qt-%{version}-root (2,5 Go)"
78 echo " qt-x11-opensource-src-%{version} (4,5 Go)"
79 echo " qt-%{version}-<date>.<arch>-<os>-<tag>.rpm (1 Go)"
80 echo "Building with no options takes 0,5 hours on a dual core"
81 echo "2 GHz CPU, or 1,5 hours with all build options enabled."
82 ) | %{l_rpmtool} msg -b -t notice
83
84 %setup -q -n qt-x11-opensource-src-%{version}
85 x11_incdir=`%{l_rc} --query x11_incdir`
86 x11_libdir=`%{l_rc} --query x11_libdir`
87 fontconf=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig`
88 loclibs=''
89 x11_supdir=''
90 case "%{l_platform -t}" in
91 *-sunos* )
92 loclibs='-lsocket -lnsl'
93 [ -d /usr/X/sfw/lib ] && x11_supdir=/usr/X/sfw/lib
94 ;;
95 esac
96 ( cd mkspecs/qws
97 for plat in freebsd-generic-g++ macx-generic-g++ solaris-generic-g++;
98 do
99 ln -s $plat `echo $plat | %{l_shtool} subst -e 's;\(.*\)-generic-\(.*\);\1-x86-\2;'`
100 done
101 ) || exit $?
102 %{l_shtool} subst \
103 -e 's;\(-z[ \t][ \t]*\)\([^ \t\"][^ \t\"]*\);\1"\2";g' \
104 configure
105 %{l_shtool} subst \
106 -e "s;\(QMAKE_LIBS_X11.*\)-lfreetype -lfontconfig;\1$fontconf;" \
107 configure
108 %{l_shtool} subst \
109 -e 's;-silent|;-rpath|-silent|;' \
110 -e 's;\(RPATH_FLAGS="\)\\"\$QT_INSTALL_LIBS\\" \($RPATH_FLAGS"\);\1\2;' \
111 -e "s;\(echo.*QMAKE_RPATHDIR +=\).*\$QT_INSTALL_LIBS\\\\\"\\\";\1 $x11_libdir\";" \
112 configure
113 if [ ".$x11_supdir" != . -a -d "$x11_supdir" ]; then
114 %{l_shtool} subst \
115 -e "s;\(echo.*QMAKE_RPATHDIR += \)\($x11_libdir\\\"\)\( >> \\\"\$QTCONFIG\.tmp\\\"\);\1\2\3 \&\& \1$x11_supdir\"\3;" \
116 configure
117 fi
118 %{l_shtool} subst \
119 -e 's;\(TRY_INCLUDEPATHS = \).*\(\$\$INCLUDEPATH\);\1\2;' \
120 -e 's;/freetype2;/freetype;' \
121 config.tests/unix/freetype/freetype.pri
122 %{l_shtool} subst \
123 -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconf;" \
124 config.tests/x11/fontconfig/fontconfig.pro
125 %{l_shtool} subst \
126 -e "s;\(LIBS += -lpq\);\1 -lssl -lcrypto $loclibs;" \
127 config.tests/unix/psql/psql.pro
128 %{l_shtool} subst \
129 -e 's;^mac:\(LIBS\);\1;' \
130 config.tests/unix/iconv/iconv.pro
131 %{l_shtool} subst \
132 -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \
133 -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/lib;' \
134 -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \
135 -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2 $x11_supdir;" \
136 -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \
137 mkspecs/qws/*/qmake.conf \
138 mkspecs/*/*.conf
139 %{l_shtool} subst \
140 -e "s;^\(QMAKE_INCDIR_X11[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \
141 -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2 $x11_supdir;" \
142 mkspecs/qws/solaris*/qmake.conf \
143 mkspecs/solaris*/qmake.conf
144 %{l_shtool} subst \
145 -e 's; *\.\./3rdparty/freetype/.*;;g' \
146 -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \
147 src/gui/text/text.pri
148 %{l_shtool} subst \
149 -e 's;\(#include *"\)\(tiffio.h"\);\1tiff/\2;' \
150 src/plugins/imageformats/tiff/qtiffhandler.cpp
151 # for projfile in `find examples/ -name '*.pro' -print`; do
152 # echo 'CONFIG += release' >>$projfile
153 # done
154
155 %build
156 # protect against sloppy code inclusion of all unused subprojects
157 rm -rf src/3rdparty/[^cdhmsw]* src/3rdparty/sql* src/3rdparty/win*
158
159 case "%{l_platform -t}" in
160 *-aix* ) platcomp="aix-g++" ;;
161 *-freebsd* ) platcomp="freebsd-g++" ;;
162 *-hpux* ) platcomp="hpux-g++" ;;
163 *-irix* ) platcomp="irix-g++" ;;
164 *-linux* ) platcomp="linux-g++" ;;
165 *-darwin* ) platcomp="macx-g++" ;;
166 *-sunos* ) platcomp="solaris-g++" ;;
167 * ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;;
168 esac
169
170 %if "%{with_shared}" == "yes"
171 # optional shared build (precedes mandatory static build)
172 echo 'yes' | ./configure \
173 -prefix %{l_prefix} \
174 -bindir %{l_prefix}/bin \
175 -libdir %{l_prefix}/lib/qt \
176 -docdir %{l_prefix}/share/qt/doc \
177 -headerdir %{l_prefix}/include \
178 -plugindir %{l_prefix}/share/qt/plugins \
179 -datadir %{l_prefix}/share/qt \
180 -translationdir %{l_prefix}/share/qt/translations \
181 -sysconfdir %{l_prefix}/etc/qt \
182 -examplesdir %{l_prefix}/share/qt/examples \
183 -demosdir %{l_prefix}/share/qt/demos \
184 -release \
185 -shared \
186 -platform $platcomp \
187 -no-sql-ibase \
188 -no-sql-mysql \
189 -no-sql-odbc \
190 -no-sql-psql \
191 -no-sql-sqlite2 \
192 -qt-sql-sqlite \
193 -system-sqlite \
194 -xmlpatterns \
195 -svg \
196 -no-webkit \
197 -system-zlib \
198 -qt-gif \
199 -system-libpng \
200 -system-libmng \
201 -system-libjpeg \
202 -system-libtiff \
203 -rpath \
204 -no-cups \
205 -iconv \
206 -pch \
207 -dbus-linked \
208 -opengl \
209 -xrender \
210 -fontconfig \
211 -freetype \
212 -glib
213
214 # default options are implicitly used, und zwar...
215 #-no-fast -exceptions -accessibility -stl -qt3support -nis
216 #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
217
218 # carry out shared build procedure
219 ( cd src
220 %{l_make} %{l_mflags -O} \
221 sub-moc sub-rcc sub-uic
222 %{l_make} %{l_mflags -O} \
223 sub-corelib sub-xml sub-network sub-gui sub-sql \
224 sub-script sub-testlib sub-qt3support sub-dbus \
225 sub-opengl sub-xmlpatterns sub-svg sub-plugins
226 ) || exit $?
227
228 # cache shared libs and initialize the build configuration, which
229 # would otherwise still contain references to our shared libs build
230 %{l_shtool} mkdir -f -p -m 755 dynamic
231 mv lib/* dynamic/
232 ( cd qmake
233 %{l_make} %{l_mflags} distclean
234 ) || exit $?
235 rm -f .qmake.cache
236 %endif
237
238 # mandatory static build (follows optional shared build)
239 echo 'yes' | ./configure \
240 -prefix %{l_prefix} \
241 -bindir %{l_prefix}/bin \
242 -libdir %{l_prefix}/lib \
243 -docdir %{l_prefix}/share/qt/doc \
244 -headerdir %{l_prefix}/include \
245 -plugindir %{l_prefix}/share/qt/plugins \
246 -datadir %{l_prefix}/share/qt \
247 -translationdir %{l_prefix}/share/qt/translations \
248 -sysconfdir %{l_prefix}/etc/qt \
249 -examplesdir %{l_prefix}/share/qt/examples \
250 -demosdir %{l_prefix}/share/qt/demos \
251 -release \
252 -static \
253 -platform $platcomp \
254 -no-sql-ibase \
255 -no-sql-mysql \
256 -no-sql-odbc \
257 -no-sql-psql \
258 -no-sql-sqlite2 \
259 -qt-sql-sqlite \
260 -system-sqlite \
261 -xmlpatterns \
262 -svg \
263 -no-webkit \
264 -system-zlib \
265 -qt-gif \
266 -system-libpng \
267 -system-libmng \
268 -system-libjpeg \
269 -system-libtiff \
270 -rpath \
271 -no-cups \
272 -iconv \
273 -pch \
274 -dbus-linked \
275 -opengl \
276 -xrender \
277 -fontconfig \
278 -freetype \
279 -glib
280
281 # default options are implicitly used, und zwar...
282 #-no-fast -exceptions -accessibility -stl -qt3support -nis
283 #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
284
285 # carry out static build procedure
286 %{l_make} %{l_mflags -O} sub-src
287 %if "%{with_tools}" == "yes"
288 %{l_make} %{l_mflags -O} sub-tools
289 %endif
290 %if "%{with_examples}" == "yes"
291 %{l_make} %{l_mflags -O} \
292 sub-demos-make_default-ordered \
293 sub-examples-make_default-ordered
294 %endif
295
296 %install
297 rm -rf $RPM_BUILD_ROOT
298
299 # carry out installation procedure
300 targets="sub-moc-install_subtargets-ordered \
301 sub-rcc-install_subtargets-ordered \
302 sub-uic-install_subtargets-ordered \
303 sub-corelib-install_subtargets-ordered \
304 sub-xml-install_subtargets-ordered \
305 sub-network-install_subtargets-ordered \
306 sub-gui-install_subtargets-ordered \
307 sub-sql-install_subtargets-ordered \
308 sub-script-install_subtargets-ordered \
309 sub-testlib-install_subtargets-ordered \
310 sub-qt3support-install_subtargets-ordered \
311 sub-dbus-install_subtargets-ordered \
312 sub-uic3-install_subtargets-ordered \
313 sub-opengl-install_subtargets-ordered \
314 sub-xmlpatterns-install_subtargets-ordered \
315 sub-svg-install_subtargets-ordered \
316 sub-plugins-install_subtargets-ordered"
317 %if "%{with_tools}" == "yes"
318 targets="$targets sub-tools-install_subtargets-ordered"
319 %endif
320 %if "%{with_examples}" == "yes"
321 targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered"
322 %endif
323 targets="$targets install_htmldocs install_translations install_qmake install_mkspecs"
324 %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT"
325
326 %if "%{with_shared}" == "yes"
327 # install shared libs and symlinks
328 %{l_shtool} mkdir -f -p -m 755 \
329 $RPM_BUILD_ROOT%{l_prefix}/lib/qt
330 %{l_tar} cf - dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
331
332 # explain nonstandard shared library placement
333 ( echo "This directory contains optional shared libraries as"
334 echo "defined by the OpenPKG build specification. Although"
335 echo "shared libraries are only optionally built (see the"
336 echo "build time 'with_shared yes' option), static libraries"
337 echo "are built and installed in the parent 'lib' directory."
338 ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README
339
340 # do not support pkg-config(1) with shared libs
341 rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/qt/pkgconfig
342
343 # remove temporary dynamic link paths
344 %{l_shtool} subst \
345 -e 's;\(QMAKE_PRL_BUILD_DIR[^=][^=]*=\).*\(qt-x11-opensource-src.*\);\1 /tmp/\2;' \
346 $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl
347 %endif
348
349 # determine internal file listing
350 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
351 %{l_files_std} \
352 '%doc %{l_prefix}/share/qt/doc/*' \
353 '%not %dir %{l_prefix}/lib/pkgconfig'
354
355 %files -f files
356
357 %clean
358 rm -rf $RPM_BUILD_ROOT
359

mercurial