kde-qt.spec 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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: 20040702
  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
  45. PreReq: OpenPKG, openpkg >= 20040130, X11
  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. -qt-zlib -qt-libpng -qt-libjpeg -qt-libmng -qt-gif \
  132. -no-nis -no-cups -no-nas-sound -no-xinerama \
  133. -xrender -no-xft -no-tablet -no-xkb \
  134. -disable-opengl -enable-sql \
  135. -no-exceptions -thread \
  136. -I$QTDIR/include \
  137. %{l_cppflags} %{l_ldflags} \
  138. -I${l_x11_incdir} -L${l_x11_libdir} \
  139. -R%{l_prefix}/lib/kde
  140. # build Qt (but without additional tools, the tutorial and the examples)
  141. %{l_make} %{l_mflags -O} \
  142. MAKE="%{l_make} %{l_mflags -O}" \
  143. LD_LIBRARY_PATH="$QTDIR/lib" \
  144. symlinks src-qmake src-moc sub-src
  145. ( cd tools/designer
  146. %{l_make} %{l_mflags -O} \
  147. MAKE="%{l_make} %{l_mflags -O}" \
  148. LD_LIBRARY_PATH="$QTDIR/lib" \
  149. sub-uic
  150. ) || exit $?
  151. %install
  152. rm -rf $RPM_BUILD_ROOT
  153. # create directory structure
  154. %{l_shtool} mkdir -f -p -m 755 \
  155. $RPM_BUILD_ROOT%{l_prefix}/libexec/kde \
  156. $RPM_BUILD_ROOT%{l_prefix}/include/kde/qt/private \
  157. $RPM_BUILD_ROOT%{l_prefix}/lib/kde \
  158. $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
  159. # install tools
  160. %{l_shtool} install -c -s -m 755 \
  161. bin/moc bin/uic \
  162. $RPM_BUILD_ROOT%{l_prefix}/libexec/kde/
  163. # install library
  164. %{l_shtool} install -c -m 755 \
  165. lib/libqt-mt.so.%{version} \
  166. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/
  167. %{l_shtool} mkln -s \
  168. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.%{version} \
  169. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.`echo %{version} | sed -e 's;\.[0-9]$;;'`
  170. %{l_shtool} mkln -s \
  171. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.%{version} \
  172. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.`echo %{version} | sed -e 's;\.[0-9]\.[0-9]$;;'`
  173. %{l_shtool} mkln -s \
  174. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so.%{version} \
  175. $RPM_BUILD_ROOT%{l_prefix}/lib/kde/libqt-mt.so
  176. # install headers
  177. ( cd include
  178. # (do not pick up symlinks to non-existing files)
  179. rm -f qxtwidget.h qmotif.h qmotifdialog.h qmotifwidget.h
  180. ) || exit $?
  181. %{l_shtool} install -c -m 644 \
  182. include/*.h \
  183. $RPM_BUILD_ROOT%{l_prefix}/include/kde/qt/
  184. %{l_shtool} install -c -m 644 \
  185. include/private/*.h \
  186. $RPM_BUILD_ROOT%{l_prefix}/include/kde/qt/private/
  187. # install pkg-config specification
  188. l_x11_incdir=`%{l_prefix}/etc/rc --query x11_incdir`
  189. l_x11_libdir=`%{l_prefix}/etc/rc --query x11_libdir`
  190. %{l_shtool} install -c -m 644 \
  191. %{l_value -s l_prefix} \
  192. -e "s;@l_version@;%{version};g" \
  193. -e "s;@l_x11_incdir@;${l_x11_incdir};g" \
  194. -e "s;@l_x11_libdir@;${l_x11_libdir};g" \
  195. %{SOURCE kde-qt.pc} \
  196. $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
  197. # determine installation files
  198. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  199. %{l_files_std} \
  200. '%not %dir %{l_prefix}/lib/pkgconfig'
  201. %files -f files
  202. %clean
  203. rm -rf $RPM_BUILD_ROOT