qt.spec 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. ##
  2. ## qt.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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: qt
  27. Summary: The Qt Toolkit
  28. URL: http://www.trolltech.com/products/qt/x11.html
  29. Vendor: TrollTech AS
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [EVAL]
  32. Group: XWindow
  33. License: GPL
  34. Version: 3.1.2
  35. Release: 20030408
  36. # package options
  37. %option with_xft no
  38. # list of sources
  39. Source0: ftp://ftp.trolltech.com/pub/qt/source/qt-x11-free-%{version}.tar.gz
  40. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20030103, X11, gcc
  44. PreReq: OpenPKG, openpkg >= 20030103, X11
  45. AutoReq: no
  46. AutoReqProv: no
  47. %description
  48. Qt is a GUI (graphical user interface) software toolkit which simplifies
  49. the task of writing and maintaining GUIs, and allows the developer to
  50. create prototypes and feature-rich applications quickly. Offering C++
  51. library bindings, Qt enables development in an object-oriented
  52. environment and appeals to developers with portability in mind. Qt's
  53. portable C++ library bindings allow for error-free recompiling on at
  54. least the three major platforms Unix (and Linux), Apple Macintosh, and
  55. Microsoft Windows. Its API architecture is designed to reduce complexity
  56. and increase reliability through a signal and slot mechanism, which is
  57. similar to templates in C++, but with influences from component
  58. technology.
  59. %prep
  60. %setup -q -n qt-x11-free-%{version}
  61. # tidy up dirty vendor tarball
  62. ( cd include
  63. for i in qmotifwidget.h qmotif.h qxtwidget.h qmotifdialog.h; do
  64. rm -f $i
  65. done
  66. )
  67. %build
  68. # display a warning that this package is a beast
  69. ( echo "This package requires about 1.3 GB of free temporary"
  70. echo "disk space for building. So be prepared, please."
  71. ) | %{l_rpmtool} msg -b -t notice
  72. export QTDIR=`pwd`
  73. case "%{l_target}" in
  74. *-freebsd* ) oscomp="freebsd-g++"
  75. %{l_shtool} subst \
  76. -e 's/defined(_POSIX_THREAD_SAFE_FUNCTIONS)/_POSIX_THREAD_SAFE_FUNCTIONS - 0 >0/g' \
  77. src/dialogs/qfiledialog.cpp src/kernel/qfont_x11.cpp \
  78. src/tools/qdatetime.cpp src/tools/qdir_unix.cpp
  79. ;;
  80. *-linux* ) oscomp="linux-g++"
  81. ;;
  82. *-solaris* ) oscomp="solaris-g++"
  83. ;;
  84. * ) echo "platform %{l_target} not supported" 2>&1; exit 1 ;;
  85. esac
  86. # special trolltech configuration
  87. echo "yes" | ./configure \
  88. -prefix %{l_prefix} \
  89. -docdir %{l_prefix}/share/qt/doc \
  90. -datadir %{l_prefix}/share/qt/data \
  91. -static -qt-gif -qt-zlib -platform $oscomp \
  92. -stl -qt-libpng -qt-libjpeg -qt-libmng \
  93. %if "%{with_xft}" == "yes"
  94. -xft
  95. %else
  96. -no-xft
  97. %endif
  98. # set $HOME to a writable directory for qsettings
  99. HOME=$PWD
  100. %{l_make} %{l_mflags -O} \
  101. MAKE="%{l_make} %{l_mflags -O}"
  102. # run configure a second time to get threaded libs, too
  103. echo "yes" | ./configure \
  104. -prefix %{l_prefix} \
  105. -docdir %{l_prefix}/share/qt/doc \
  106. -datadir %{l_prefix}/share/qt/data \
  107. -static -qt-gif -qt-zlib -platform $oscomp \
  108. -thread -stl -qt-libpng -qt-libjpeg -qt-libmng \
  109. %if "%{with_xft}" == "yes"
  110. -xft
  111. %else
  112. -no-xft
  113. %endif
  114. # make our targets a second time to get threaded libs, too
  115. %{l_make} %{l_mflags -O} \
  116. MAKE="%{l_make} %{l_mflags -O}" \
  117. symlinks src-qmake src-moc sub-src sub-tools
  118. %install
  119. rm -rf $RPM_BUILD_ROOT
  120. # make directory structure
  121. %{l_shtool} mkdir -f -p -m 755 \
  122. $RPM_BUILD_ROOT%{l_prefix}/bin \
  123. $RPM_BUILD_ROOT%{l_prefix}/lib \
  124. $RPM_BUILD_ROOT%{l_prefix}/include/qt/private \
  125. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  126. $RPM_BUILD_ROOT%{l_prefix}/man/man3 \
  127. $RPM_BUILD_ROOT%{l_prefix}/share/qt/doc/html \
  128. $RPM_BUILD_ROOT%{l_prefix}/share/qt/templates \
  129. $RPM_BUILD_ROOT%{l_prefix}/share/qt/phrasebooks \
  130. $RPM_BUILD_ROOT%{l_prefix}/share/qt/images
  131. # copy binaries, headers, and then libraries to their target
  132. %{l_shtool} install -c -s -m 755 \
  133. bin/qmake bin/moc bin/uic \
  134. bin/linguist bin/lrelease bin/lupdate \
  135. bin/assistant bin/qtconfig bin/designer \
  136. $RPM_BUILD_ROOT%{l_prefix}/bin/
  137. # copy mkspecs directory for later portable use of qmake
  138. cp -rp mkspecs $RPM_BUILD_ROOT%{l_prefix}/share/qt/
  139. # correct man suffix
  140. for man in doc/man/man3/*.3qt; do
  141. %{l_shtool} subst -e 's;\.3qt;.3;' $man
  142. mv $man `echo $man | sed -e 's;\.3qt$;.3;'`
  143. done
  144. %{l_shtool} install -c -m 644 \
  145. include/*.h $RPM_BUILD_ROOT%{l_prefix}/include/qt/
  146. %{l_shtool} install -c -m 644 \
  147. include/private/*.h $RPM_BUILD_ROOT%{l_prefix}/include/qt/private/
  148. %{l_shtool} install -c -m 644 \
  149. doc/html/* $RPM_BUILD_ROOT%{l_prefix}/share/qt/doc/html/
  150. %{l_shtool} install -c -m 644 \
  151. tools/designer/templates/*.ui $RPM_BUILD_ROOT%{l_prefix}/share/qt/templates/
  152. %{l_shtool} install -c -m 644 \
  153. tools/linguist/phrasebooks/*.qph $RPM_BUILD_ROOT%{l_prefix}/share/qt/phrasebooks/
  154. %{l_shtool} install -c -m 644 \
  155. tools/designer/designer/images/* $RPM_BUILD_ROOT%{l_prefix}/share/qt/images/
  156. %{l_shtool} install -c -m 644 \
  157. lib/*.a lib/*.prl $RPM_BUILD_ROOT%{l_prefix}/lib/
  158. %{l_shtool} install -c -m 644 \
  159. doc/man/man3/*.3 $RPM_BUILD_ROOT%{l_prefix}/man/man3/
  160. %{l_shtool} install -c -m 644 \
  161. doc/man/man1/*.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  162. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  163. %files -f files
  164. %clean
  165. rm -rf $RPM_BUILD_ROOT