mozilla.spec 7.8 KB

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