qt.spec 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. ##
  2. ## qt.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2002 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 options
  26. %ifndef with_xft
  27. %define with_xft no
  28. %endif
  29. # package information
  30. Name: qt
  31. Summary: The Qt Toolkit
  32. URL: http://www.trolltech.com/products/qt/x11.html
  33. Vendor: TrollTech AS
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG [EVAL]
  36. Group: XWindow
  37. License: GPL
  38. Version: 3.1.0
  39. Release: 20021125
  40. # list of sources
  41. Source0: ftp://ftp.silug.org/pub/qt/source/qt-x11-free-%{version}.tar.gz
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 20020206, X11, gcc
  46. PreReq: OpenPKG, openpkg >= 20020206, X11
  47. AutoReq: no
  48. AutoReqProv: no
  49. %description
  50. Qt is a GUI (graphical user interface) software toolkit which simplifies
  51. the task of writing and maintaining GUIs, and allows the developer to
  52. create prototypes and feature-rich applications quickly. Offering C++
  53. library bindings, Qt enables development in an object-oriented
  54. environment and appeals to developers with portability in mind. Qt's
  55. portable C++ library bindings allow for error-free recompiling on at
  56. least the three major platforms Unix (and Linux), Apple Macintosh, and
  57. Microsoft Windows. Its API architecture is designed to reduce complexity
  58. and increase reliability through a signal and slot mechanism, which is
  59. similar to templates in C++, but with influences from component
  60. technology.
  61. Options:
  62. --define 'with_xft %{with_xft}'
  63. %prep
  64. %setup -q -n qt-x11-free-%{version}
  65. %build
  66. export QTDIR=`pwd`
  67. case "%{l_target}" in
  68. *-freebsd* ) oscomp="freebsd-g++" ;;
  69. *-linux* ) oscomp="linux-g++" ;;
  70. *-solaris* ) oscomp="solaris-g++" ;;
  71. * ) echo "platform %{l_target} not supported" 2>&1; exit 1 ;;
  72. esac
  73. # ensure that libXft exists
  74. %if "%{with_xft}" == "yes"
  75. found_xft=""
  76. for ext in a so sl; do
  77. if [ -f "`%{l_prefix}/etc/rc --query x11_libdir`/libXft.$ext" ]; then
  78. found_xft="da"
  79. break;
  80. fi
  81. done
  82. if [ ".$found_xft" = . ]; then
  83. echo "ERROR! Library libXft could not be found," 2>&1;
  84. echo "please consider building without with_xft" 2>&1;
  85. exit 1;
  86. fi
  87. %endif
  88. # special trolltech configuration
  89. echo "yes" | ./configure \
  90. -prefix %{l_prefix} \
  91. -docdir %{l_prefix}/share/qt/doc \
  92. -datadir %{l_prefix}/share/qt/data \
  93. -static -qt-gif -qt-zlib -platform $oscomp \
  94. -thread -stl -qt-libpng -qt-libjpeg -qt-libmng \
  95. %if "%{with_xft}" == "yes"
  96. -xft
  97. %else
  98. -no-xft
  99. %endif
  100. # set $HOME to a writable directory for qsettings
  101. HOME=$PWD
  102. %{l_make} %{l_mflags -O} \
  103. MAKE="%{l_make} %{l_mflags -O}" \
  104. symlinks src-qmake src-moc sub-src sub-tools
  105. # FIXME: "-Wl,-rpath,/tmp/qt-x11-free-3.0.4/lib"
  106. %install
  107. rm -rf $RPM_BUILD_ROOT
  108. # make directory structure
  109. %{l_shtool} mkdir -f -p -m 755 \
  110. $RPM_BUILD_ROOT%{l_prefix}/bin \
  111. $RPM_BUILD_ROOT%{l_prefix}/lib \
  112. $RPM_BUILD_ROOT%{l_prefix}/include/qt/private \
  113. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  114. $RPM_BUILD_ROOT%{l_prefix}/man/man3 \
  115. $RPM_BUILD_ROOT%{l_prefix}/share/qt/doc/html \
  116. $RPM_BUILD_ROOT%{l_prefix}/share/qt/templates \
  117. $RPM_BUILD_ROOT%{l_prefix}/share/qt/phrasebooks \
  118. $RPM_BUILD_ROOT%{l_prefix}/share/qt/images
  119. # copy binaries, headers, and then libraries to their target.
  120. %{l_shtool} install -c -s -m 755 \
  121. bin/qmake bin/moc bin/uic \
  122. bin/linguist bin/lrelease bin/lupdate \
  123. bin/assistant bin/qtconfig bin/designer \
  124. $RPM_BUILD_ROOT%{l_prefix}/bin/
  125. # copy mkspecs directory for later portable use of qmake
  126. cp -rp mkspecs $RPM_BUILD_ROOT%{l_prefix}/share/qt/
  127. %{l_shtool} install -c -m 644 \
  128. include/*.h $RPM_BUILD_ROOT%{l_prefix}/include/qt/
  129. %{l_shtool} install -c -m 644 \
  130. include/private/*.h $RPM_BUILD_ROOT%{l_prefix}/include/qt/private/
  131. %{l_shtool} install -c -m 644 \
  132. doc/html/* $RPM_BUILD_ROOT%{l_prefix}/share/qt/doc/html/
  133. %{l_shtool} install -c -m 644 \
  134. tools/designer/templates/*.ui $RPM_BUILD_ROOT%{l_prefix}/share/qt/templates/
  135. %{l_shtool} install -c -m 644 \
  136. tools/linguist/phrasebooks/*.qph $RPM_BUILD_ROOT%{l_prefix}/share/qt/phrasebooks/
  137. %{l_shtool} install -c -m 644 \
  138. tools/designer/designer/images/* $RPM_BUILD_ROOT%{l_prefix}/share/qt/images/
  139. ( cd lib && tar cf - * ) |\
  140. ( cd $RPM_BUILD_ROOT%{l_prefix}/lib && tar xf - )
  141. ( cd doc/man/man3
  142. for man in *.3qt; do
  143. %{l_shtool} subst -e 's;\.3qt;.3;' $man
  144. mv $man `echo $man | sed -e 's;\.3qt$;.3;'`
  145. done
  146. %{l_shtool} install -c -m 644 \
  147. *.3 $RPM_BUILD_ROOT%{l_prefix}/man/man3/
  148. cd ../man1
  149. %{l_shtool} install -c -m 644 \
  150. *.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  151. )
  152. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  153. %files -f files
  154. %clean
  155. rm -rf $RPM_BUILD_ROOT