kde-qt.spec 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. ##
  2. ## kde-qt.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: kde-qt
  27. Summary: K Desktop Environment (Qt Toolkit)
  28. URL: http://www.kde.org/
  29. Vendor: TrollTech AS
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: EVAL
  33. Group: KDE
  34. License: GPL
  35. Version: 3.2.3
  36. Release: 20040701
  37. # list of sources
  38. Source0: ftp://ftp.trolltech.com/pub/qt/source/qt-x11-free-%{version}.tar.bz2
  39. Source1: kde-qt.pc
  40. Patch0: kde-qt.patch
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 20040130, X11, gcc, png, mng, jpeg, zlib
  45. PreReq: OpenPKG, openpkg >= 20040130, X11, png, mng, jpeg, zlib
  46. AutoReq: no
  47. AutoReqProv: no
  48. %description
  49. KDE is a powerful Open Source graphical desktop environment for Unix
  50. workstations. It combines ease of use, contemporary functionality,
  51. and outstanding graphical design with the technological superiority
  52. of the Unix operating system.
  53. This part is the KDE underlying Qt Toolkit.
  54. (The major differences between this package and the standard OpenPKG
  55. Qt package are: shared library version only, threading enabled,
  56. stripped down installation size, perhaps different version to
  57. fullfill exactly the requirements of KDE, no build options, etc. So,
  58. this package is just for KDE internal use only.)
  59. %track
  60. prog kde-qt = {
  61. version = %{version}
  62. url = ftp://ftp.trolltech.com/pub/qt/source/
  63. regex = qt-x11-free-(3\.2\.\d+)\.tar\.gz
  64. }
  65. %prep
  66. %setup -q -n qt-x11-free-%{version}
  67. %patch
  68. # avoid dependencies external to OpenPKG instance
  69. cp -rp mkspecs mkspecs.fresh
  70. %{l_shtool} subst \
  71. -e 's;[ \t]*-I/usr/local/include;;g' \
  72. -e 's;[ \t]*/usr/local/include;;g' \
  73. -e 's;[ \t]*-L/usr/local/lib;;g' \
  74. -e 's;[ \t]*/usr/local/lib;;g' \
  75. mkspecs/darwin-g++/qmake.conf \
  76. mkspecs/freebsd-g++/qmake.conf \
  77. mkspecs/netbsd-g++/qmake.conf \
  78. mkspecs/macx-pbuilder/qmake.conf \
  79. mkspecs/openbsd-g++/qmake.conf
  80. # correctly detect OpenPKG xrender and xft installations
  81. %{l_shtool} subst \
  82. -e 's;INCDIRS=";INCDIRS="%{l_prefix}/include ;g' \
  83. -e 's;LIBDIRS=";LIBDIRS="%{l_prefix}/lib ;g' \
  84. -e 's;freetype2/freetype/;freetype/;g' \
  85. -e 's;freetype2;freetype;g' \
  86. config.tests/x11/xfreetype.test \
  87. config.tests/x11/xrender.test
  88. # repair nonstandard posix thread test macro usage
  89. %{l_shtool} subst \
  90. -e 's/\(defined(_POSIX_THREAD_SAFE_FUNCTIONS)\)/(\1 \&\& _POSIX_THREAD_SAFE_FUNCTIONS-0>0)/g' \
  91. src/dialogs/qfiledialog.cpp src/kernel/qfont_x11.cpp \
  92. src/tools/qdatetime.cpp src/tools/qdir_unix.cpp
  93. %build
  94. # display a warning that this package is a beast
  95. ( echo "The qt package requires about 320 MB of temporary disk space"
  96. echo "and one to five hours (depending on options) to build on a"
  97. echo "800 MHz system. Therefore, please be prepared and be patient."
  98. ) | %{l_rpmtool} msg -b -t notice
  99. # set HOME to a writable directory for qsettings
  100. # and set QTDIR to just the source tree directory
  101. # and determine the target platform to build
  102. HOME=`pwd`
  103. QTDIR=`pwd`
  104. case "%{l_platform -t}" in
  105. *-freebsd* ) oscomp="freebsd-g++" ;;
  106. *-linux* ) oscomp="linux-g++" ;;
  107. *-sunos* ) oscomp="solaris-g++" ;;
  108. * ) echo "platform %{l_platform -t} not supported" 2>&1; exit 1 ;;
  109. esac
  110. # put in proper search paths for dynamic libraries
  111. rflags=`echo '%{l_ldflags}' | %{l_shtool} subst \
  112. -e 's;%{l_prefix}/lib;%{l_prefix}/lib/qtdyn;g' \
  113. -e 's;-L;-R;g'`
  114. # calculate X11 paths in advance
  115. l_x11_incdir=`%{l_prefix}/etc/rc --query x11_incdir`
  116. l_x11_libdir=`%{l_prefix}/etc/rc --query x11_libdir`
  117. # special trolltech configuration
  118. CC="%{l_cc}" \
  119. CXX="%{l_cxx}" \
  120. CFLAGS="%{l_cflags -O}" \
  121. CXXFLAGS="%{l_cxxflags -O}" \
  122. echo "yes" | ./configure \
  123. -platform $oscomp \
  124. -prefix %{l_prefix} \
  125. -bindir %{l_prefix}/libexec/kde \
  126. -libdir %{l_prefix}/lib/kde \
  127. -headerdir %{l_prefix}/include/kde \
  128. -docdir %{l_prefix}/share/kde/qt/doc \
  129. -datadir %{l_prefix}/share/kde/qt/data \
  130. -release -shared -stl -sm \
  131. -system-zlib -system-libpng \
  132. -system-libjpeg -system-libmng -qt-gif \
  133. -no-nis -no-cups -no-nas-sound -no-xinerama \
  134. -xrender -no-xft -no-tablet -no-xkb \
  135. -disable-opengl -enable-sql \
  136. -no-exceptions -thread \
  137. -I$QTDIR/include \
  138. %{l_cppflags} %{l_ldflags} \
  139. -I${l_x11_incdir} -L${l_x11_libdir} \
  140. -R%{l_prefix}/lib/kde
  141. # build Qt (but without additional tools, the tutorial and the examples)
  142. %{l_make} %{l_mflags -O} \
  143. MAKE="%{l_make} %{l_mflags -O}" \
  144. LD_LIBRARY_PATH="$QTDIR/lib" \
  145. symlinks src-qmake src-moc sub-src
  146. ( cd tools/designer
  147. %{l_make} %{l_mflags -O} \
  148. MAKE="%{l_make} %{l_mflags -O}" \
  149. LD_LIBRARY_PATH="$QTDIR/lib" \
  150. sub-uic
  151. ) || exit $?
  152. %install
  153. rm -rf $RPM_BUILD_ROOT
  154. # create directory structure
  155. %{l_shtool} mkdir -f -p -m 755 \
  156. $RPM_BUILD_ROOT%{l_prefix}/libexec/kde \
  157. $RPM_BUILD_ROOT%{l_prefix}/include/kde/qt/private \
  158. $RPM_BUILD_ROOT%{l_prefix}/lib/kde \
  159. $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
  160. # install tools
  161. %{l_shtool} install -c -s -m 755 \
  162. bin/moc bin/uic \
  163. $RPM_BUILD_ROOT%{l_prefix}/libexec/kde/
  164. # install library
  165. %{l_shtool} install -c -m 755 \
  166. lib/libqt-mt.so.%{version} \
  167. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/
  168. %{l_shtool} mkln -s \
  169. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.%{version} \
  170. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.`echo %{version} | sed -e 's;\.[0-9]$;;'`
  171. %{l_shtool} mkln -s \
  172. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.%{version} \
  173. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.`echo %{version} | sed -e 's;\.[0-9]\.[0-9]$;;'`
  174. %{l_shtool} mkln -s \
  175. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.%{version} \
  176. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so
  177. # install headers
  178. ( cd include
  179. # (do not pick up symlinks to non-existing files)
  180. rm -f qxtwidget.h qmotif.h qmotifdialog.h qmotifwidget.h
  181. ) || exit $?
  182. %{l_shtool} install -c -m 644 \
  183. include/*.h \
  184. $RPM_BUILD_ROOT%{l_prefix}/include/kde/qt/
  185. %{l_shtool} install -c -m 644 \
  186. include/private/*.h \
  187. $RPM_BUILD_ROOT%{l_prefix}/include/kde/qt/private/
  188. # install pkg-config specification
  189. l_x11_incdir=`%{l_prefix}/etc/rc --query x11_incdir`
  190. l_x11_libdir=`%{l_prefix}/etc/rc --query x11_libdir`
  191. %{l_shtool} install -c -m 644 \
  192. %{l_value -s l_prefix} \
  193. -e "s;@l_version@;%{version};g" \
  194. -e "s;@l_x11_incdir@;${l_x11_incdir};g" \
  195. -e "s;@l_x11_libdir@;${l_x11_libdir};g" \
  196. %{SOURCE kde-qt.pc} \
  197. $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
  198. # determine installation files
  199. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  200. %{l_files_std} \
  201. '%not %dir %{l_prefix}/lib/pkgconfig'
  202. %files -f files
  203. %clean
  204. rm -rf $RPM_BUILD_ROOT