kde-qt.spec 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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: 20040406
  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. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20040130, X11, gcc
  44. PreReq: OpenPKG, openpkg >= 20040130, X11
  45. AutoReq: no
  46. AutoReqProv: no
  47. %description
  48. KDE is a powerful Open Source graphical desktop environment for Unix
  49. workstations. It combines ease of use, contemporary functionality,
  50. and outstanding graphical design with the technological superiority
  51. of the Unix operating system.
  52. This part is the KDE underlying Qt Toolkit.
  53. (The major differences between this package and the standard OpenPKG
  54. Qt package are: shared library version only, threading enabled,
  55. stripped down installation size, perhaps different version to
  56. fullfill exactly the requirements of KDE, no build options, etc. So,
  57. this package is just for KDE internal use only.)
  58. %track
  59. prog kde-qt = {
  60. version = %{version}
  61. url = ftp://ftp.trolltech.com/pub/qt/source/
  62. regex = qt-x11-free-(3\.2\.\d+)\.tar\.gz
  63. }
  64. %prep
  65. %setup -q -n qt-x11-free-%{version}
  66. # avoid dependencies external to OpenPKG instance
  67. cp -rp mkspecs mkspecs.fresh
  68. %{l_shtool} subst \
  69. -e 's;[ \t]*-I/usr/local/include;;g' \
  70. -e 's;[ \t]*/usr/local/include;;g' \
  71. -e 's;[ \t]*-L/usr/local/lib;;g' \
  72. -e 's;[ \t]*/usr/local/lib;;g' \
  73. mkspecs/darwin-g++/qmake.conf \
  74. mkspecs/freebsd-g++/qmake.conf \
  75. mkspecs/netbsd-g++/qmake.conf \
  76. mkspecs/macx-pbuilder/qmake.conf \
  77. mkspecs/openbsd-g++/qmake.conf
  78. # correctly detect OpenPKG xrender and xft installations
  79. %{l_shtool} subst \
  80. -e 's;INCDIRS=";INCDIRS="%{l_prefix}/include ;g' \
  81. -e 's;LIBDIRS=";LIBDIRS="%{l_prefix}/lib ;g' \
  82. -e 's;freetype2/freetype/;freetype/;g' \
  83. -e 's;freetype2;freetype;g' \
  84. config.tests/x11/xfreetype.test \
  85. config.tests/x11/xrender.test
  86. # repair nonstandard posix thread test macro usage
  87. %{l_shtool} subst \
  88. -e 's/\(defined(_POSIX_THREAD_SAFE_FUNCTIONS)\)/(\1 \&\& _POSIX_THREAD_SAFE_FUNCTIONS-0>0)/g' \
  89. src/dialogs/qfiledialog.cpp src/kernel/qfont_x11.cpp \
  90. src/tools/qdatetime.cpp src/tools/qdir_unix.cpp
  91. %build
  92. # display a warning that this package is a beast
  93. ( echo "The qt package requires about 320 MB of temporary disk space"
  94. echo "and one to five hours (depending on options) to build on a"
  95. echo "800 MHz system. Therefore, please be prepared and be patient."
  96. ) | %{l_rpmtool} msg -b -t notice
  97. # set HOME to a writable directory for qsettings
  98. # and set QTDIR to just the source tree directory
  99. # and determine the target platform to build
  100. HOME=`pwd`
  101. QTDIR=`pwd`
  102. case "%{l_platform -t}" in
  103. *-freebsd* ) oscomp="freebsd-g++" ;;
  104. *-linux* ) oscomp="linux-g++" ;;
  105. *-sunos* ) oscomp="solaris-g++" ;;
  106. * ) echo "platform %{l_platform -t} not supported" 2>&1; exit 1 ;;
  107. esac
  108. # put in proper search paths for dynamic libraries
  109. rflags=`echo '%{l_ldflags}' | %{l_shtool} subst \
  110. -e 's;%{l_prefix}/lib;%{l_prefix}/lib/qtdyn;g' \
  111. -e 's;-L;-R;g'`
  112. # calculate X11 paths in advance
  113. l_x11_incdir=`%{l_prefix}/etc/rc --query x11_incdir`
  114. l_x11_libdir=`%{l_prefix}/etc/rc --query x11_libdir`
  115. # special trolltech configuration
  116. CC="%{l_cc}" \
  117. CXX="%{l_cxx}" \
  118. CFLAGS="%{l_cflags -O}" \
  119. CXXFLAGS="%{l_cxxflags -O}" \
  120. echo "yes" | ./configure \
  121. -platform $oscomp \
  122. -prefix %{l_prefix} \
  123. -bindir %{l_prefix}/libexec/kde \
  124. -libdir %{l_prefix}/lib/kde \
  125. -headerdir %{l_prefix}/include/kde \
  126. -docdir %{l_prefix}/share/kde/qt/doc \
  127. -datadir %{l_prefix}/share/kde/qt/data \
  128. -release -shared -stl -sm \
  129. -qt-zlib -qt-libpng -qt-libjpeg -qt-libmng -qt-gif \
  130. -no-nis -no-cups -no-nas-sound -no-xinerama \
  131. -xrender -no-xft -no-tablet -no-xkb \
  132. -disable-opengl -enable-sql \
  133. -no-exceptions -thread \
  134. -I$QTDIR/include \
  135. %{l_cppflags} %{l_ldflags} \
  136. -I${l_x11_incdir} -L${l_x11_libdir} \
  137. -R%{l_prefix}/lib/kde
  138. # build Qt (but without additional tools, the tutorial and the examples)
  139. %{l_make} %{l_mflags -O} \
  140. MAKE="%{l_make} %{l_mflags -O}" \
  141. LD_LIBRARY_PATH="$QTDIR/lib" \
  142. symlinks src-qmake src-moc sub-src
  143. ( cd tools/designer
  144. %{l_make} %{l_mflags -O} \
  145. MAKE="%{l_make} %{l_mflags -O}" \
  146. LD_LIBRARY_PATH="$QTDIR/lib" \
  147. sub-uic
  148. ) || exit $?
  149. %install
  150. rm -rf $RPM_BUILD_ROOT
  151. # create directory structure
  152. %{l_shtool} mkdir -f -p -m 755 \
  153. $RPM_BUILD_ROOT%{l_prefix}/libexec/kde \
  154. $RPM_BUILD_ROOT%{l_prefix}/include/kde/qt/private \
  155. $RPM_BUILD_ROOT%{l_prefix}/lib/kde \
  156. $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
  157. # install tools
  158. %{l_shtool} install -c -s -m 755 \
  159. bin/moc bin/uic \
  160. $RPM_BUILD_ROOT%{l_prefix}/libexec/kde/
  161. # install library
  162. %{l_shtool} install -c -m 755 \
  163. lib/libqt-mt.so.%{version} \
  164. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/
  165. %{l_shtool} mkln -s \
  166. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.%{version} \
  167. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.`echo %{version} | sed -e 's;\.[0-9]$;;'`
  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]\.[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
  174. # install headers
  175. ( cd include
  176. # (do not pick up symlinks to non-existing files)
  177. rm -f qxtwidget.h qmotif.h qmotifdialog.h qmotifwidget.h
  178. ) || exit $?
  179. %{l_shtool} install -c -m 644 \
  180. include/*.h \
  181. $RPM_BUILD_ROOT%{l_prefix}/include/kde/qt/
  182. %{l_shtool} install -c -m 644 \
  183. include/private/*.h \
  184. $RPM_BUILD_ROOT%{l_prefix}/include/kde/qt/private/
  185. # install pkg-config specification
  186. l_x11_incdir=`%{l_prefix}/etc/rc --query x11_incdir`
  187. l_x11_libdir=`%{l_prefix}/etc/rc --query x11_libdir`
  188. %{l_shtool} install -c -m 644 \
  189. %{l_value -s l_prefix} \
  190. -e "s;@l_version@;%{version};g" \
  191. -e "s;@l_x11_incdir@;${l_x11_incdir};g" \
  192. -e "s;@l_x11_libdir@;${l_x11_libdir};g" \
  193. %{SOURCE kde-qt.pc} \
  194. $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
  195. # determine installation files
  196. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  197. %{l_files_std} \
  198. '%not %dir %{l_prefix}/lib/pkgconfig'
  199. %files -f files
  200. %clean
  201. rm -rf $RPM_BUILD_ROOT