mozilla.spec 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. ##
  2. ## mozilla.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: mozilla
  27. Summary: Graphical Internet Communication Frontend
  28. URL: http://www.mozilla.org/
  29. Vendor: The Mozilla Project
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: PLUS
  33. Group: Web
  34. License: MPL
  35. Version: 1.7.1
  36. Release: 20040805
  37. # package options
  38. %option with_optimize yes
  39. %option with_mailnews no
  40. %option with_composer no
  41. # list of sources
  42. Source0: ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla%{version}/src/mozilla-source-%{version}.tar.bz2
  43. Source1: mozilla.sh
  44. Source2: mozilla.pod
  45. Patch0: mozilla.patch
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc, perl, pkgconfig
  50. PreReq: OpenPKG, openpkg >= 20040130, xsel
  51. BuildPreReq: X11, glib, gtk, png, jpeg, orbit, libiconv
  52. BuildPreReq: infozip, zlib, openssl, freetype
  53. PreReq: X11, glib, gtk, png, jpeg, orbit, libiconv
  54. PreReq: infozip, zlib, openssl, freetype
  55. AutoReq: no
  56. AutoReqProv: no
  57. %description
  58. Mozilla is a full-featured Open Source Internet communication
  59. frontend derived from the popular Netscape Communicator. It provides
  60. Web, Mail, News and Chat client services and is designed for
  61. standards compliance, performance and portability.
  62. %track
  63. prog mozilla = {
  64. comment = "tho: 1.7.2 tar ball is broken. Lots of missing Makefile.in. 05.08.2004"
  65. version = %{version}
  66. url = ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/
  67. regex = mozilla(1\.\d+(\.\d+)*)\b
  68. url = ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla__NEWVER__/src/
  69. regex = mozilla-source-(__VER__)\.tar\.bz2
  70. }
  71. %prep
  72. # display a warning that this package is a beast
  73. ( echo "This package requires about 540 MB of free disk space, 200 MB of RAM"
  74. echo "and 70 minutes real-time to build on a Pentium-III 800Mhz class CPU."
  75. echo "So be prepared and patient, please... ;-)"
  76. ) | %{l_rpmtool} msg -b -t notice
  77. # extract source distribution
  78. %setup -q -n mozilla
  79. # patch source distribution
  80. %patch -p0
  81. # strip down source distribution (save disk space)
  82. find . -type d -name "CVS" -print | xargs rm -rf
  83. find . -type d -name "macbuild" -print | xargs rm -rf
  84. find . -type f -name ".cvsignore" -print | xargs rm -f
  85. find . -type f -name "makefile.win" -print | xargs rm -f
  86. find . -type f -name "MANIFEST" -print | xargs rm -f
  87. rm -rf build/package
  88. %build
  89. # determine X11 paths
  90. x11_libdir=`%{l_prefix}/etc/rc --query x11_libdir`
  91. x11_incdir=`%{l_prefix}/etc/rc --query x11_incdir`
  92. # determine build flags
  93. CC="%{l_cc}"
  94. CXX="%{l_cxx}"
  95. CFLAGS="%{l_cflags} %{l_cppflags} -I${x11_incdir}"
  96. CXXFLAGS="%{l_cxxflags} -Wno-deprecated %{l_cppflags}"
  97. CPPFLAGS="%{l_cppflags glib} -I${x11_incdir}"
  98. LDFLAGS="-L`pwd`/dist/bin -L`pwd`/dist/lib -L`pwd`/dist/lib/components"
  99. LDFLAGS="$LDFLAGS %{l_ldflags} -L${x11_libdir}"
  100. GLIB_CONFIG="%{l_prefix}/bin/glib-config"
  101. GTK_CONFIG="%{l_prefix}/bin/gtk-config"
  102. LIBIDL_CONFIG="%{l_prefix}/bin/libIDL-config"
  103. PERL="%{l_prefix}/bin/perl"
  104. MOZ_INTERNAL_LIBART_LGPL=1
  105. export CC CXX CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
  106. export GLIB_CONFIG GTK_CONFIG LIBIDL_CONFIG
  107. export MOZ_INTERNAL_LIBART_LGPL
  108. # configure source
  109. ./configure \
  110. --prefix=%{l_prefix} \
  111. --libdir=%{l_prefix}/lib/mozilla \
  112. --includedir=%{l_prefix}/include/mozilla \
  113. --with-x \
  114. --x-includes=`%{l_prefix}/etc/rc --query x11_incdir` \
  115. --x-libraries=`%{l_prefix}/etc/rc --query x11_libdir` \
  116. --enable-default-toolkit=gtk \
  117. --enable-toolkit-gtk \
  118. --disable-toolkit-qt \
  119. --disable-toolkit-xlib \
  120. --with-gtk-prefix=%{l_prefix} \
  121. --with-glib-prefix=%{l_prefix} \
  122. --with-libIDL-prefix=%{l_prefix} \
  123. --with-system-jpeg=%{l_prefix} \
  124. --with-system-png=%{l_prefix} \
  125. --with-system-zlib=%{l_prefix} \
  126. --with-ft-prefix=%{l_prefix} \
  127. --enable-jsd \
  128. --enable-crypto \
  129. --enable-chrome-format=jar \
  130. --enable-svg \
  131. --enable-svg-renderer-libart \
  132. --enable-static \
  133. --enable-strip \
  134. %if "%{with_optimize}" == "yes"
  135. --enable-optimize="-O2" \
  136. %else
  137. --disable-optimize \
  138. %endif
  139. %if "%{with_mailnews}" == "yes"
  140. --enable-mailnews \
  141. %else
  142. --disable-mailnews \
  143. %endif
  144. %if "%{with_composer}" == "yes"
  145. --enable-composer \
  146. %else
  147. --disable-composer \
  148. %endif
  149. --disable-xft \
  150. --disable-freetype2 \
  151. --disable-xinerama \
  152. --disable-shared \
  153. --disable-tests \
  154. --disable-ldap \
  155. --disable-accessibility \
  156. --disable-debug \
  157. --disable-dtd-debug \
  158. --disable-pedantic \
  159. --disable-auto-deps \
  160. --disable-md \
  161. --disable-cpp-exceptions \
  162. --disable-cpp-rtti \
  163. --disable-xterm-updates \
  164. --disable-elf-dynstr-gc \
  165. --with-pthreads
  166. # build program
  167. %{l_make} %{l_mflags}
  168. # post adjustments to built program
  169. ( cd dist/bin
  170. # prepare for multi-user usage
  171. LD_LIBRARY_PATH=.; export LD_LIBRARY_PATH
  172. MOZILLA_FIVE_HOME=.; export MOZILLA_FIVE_HOME
  173. ./regxpcom || true
  174. ./regchrome || true
  175. touch chrome/user-skins.rdf chrome/user-locales.rdf
  176. # readjust paths to reflect final location
  177. %{l_shtool} subst \
  178. -e "s;`pwd`;%{l_prefix}/lib/mozilla;" \
  179. components/xpti.dat components/compreg.dat
  180. # strip down installation tree
  181. find . -type d -depth -print | xargs rmdir >/dev/null 2>&1 || true
  182. rm -f mozilla-config mkdepend nsinstall bloaturls.txt TestGtk* LICENSE README
  183. rm -rf res/samples
  184. # work around runtime startup problems
  185. mkdir .autoreg >/dev/null 2>&1 || true
  186. ) || exit $?
  187. # generate manual page for startup convenience wrapper
  188. %{l_prefix}/bin/pod2man \
  189. --section=1 --quotes=none \
  190. --release="Mozilla %{version}" --center="%{packager}" \
  191. %{SOURCE mozilla.pod} >mozilla.1
  192. %install
  193. rm -rf $RPM_BUILD_ROOT
  194. # generate temporary installation tree
  195. %{l_shtool} mkdir -f -p -m 755 \
  196. $RPM_BUILD_ROOT%{l_prefix}/bin \
  197. $RPM_BUILD_ROOT%{l_prefix}/lib/mozilla \
  198. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  199. # move files into temporary installation tree
  200. ( cd dist/bin && %{l_tar} -chf - . ) |\
  201. ( cd $RPM_BUILD_ROOT%{l_prefix}/lib/mozilla && %{l_tar} -xf - ) || exit $?
  202. # add startup convenience wrapper
  203. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  204. %{SOURCE mozilla.sh} $RPM_BUILD_ROOT%{l_prefix}/bin/mozilla
  205. %{l_shtool} install -c -m 644 \
  206. mozilla.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  207. # determine installation files
  208. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  209. %files -f files
  210. %clean
  211. rm -rf $RPM_BUILD_ROOT