mozilla.spec 8.1 KB

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