firefox.spec 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. ##
  2. ## firefox.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. # FIXME: rse: fails to build because some .rdf/.jar stuff cannot be built
  26. # package version
  27. %define V_main 1.0PR
  28. %define V_subdir 0.10.1
  29. # package information
  30. Name: firefox
  31. Summary: Graphical Web Browser
  32. URL: http://www.mozilla.org/products/firefox/
  33. Vendor: The Mozilla Project
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG
  36. Class: EVAL
  37. Group: Web
  38. License: MPL
  39. Version: %{V_subdir}
  40. Release: 20041003
  41. # package options
  42. %option with_optimize yes
  43. # list of sources
  44. Source0: ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{V_subdir}/firefox-%{V_main}-source.tar.bz2
  45. Source1: ftp://ftp.openpkg.org/sources/CPY/mozilla/mozilla-1.7.2-libart.tar.bz2
  46. Source2: firefox.sh
  47. Source3: firefox.pod
  48. Patch0: firefox.patch
  49. # build information
  50. Prefix: %{l_prefix}
  51. BuildRoot: %{l_buildroot}
  52. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc, perl
  53. PreReq: OpenPKG, openpkg >= 20040130, xsel
  54. BuildPreReq: X11, glib, gtk, png, jpeg, orbit, libiconv
  55. BuildPreReq: infozip, zlib, openssl, freetype
  56. PreReq: X11, glib, gtk, png, jpeg, orbit, libiconv
  57. PreReq: infozip, zlib, openssl, freetype
  58. AutoReq: no
  59. AutoReqProv: no
  60. %description
  61. Firefox is a speedy, full-featured Web browser based on the Mozilla
  62. codebase. It uses the Mozilla Gecko engine for rendering the Mozilla
  63. Web content and XUL for presenting the GUI.
  64. %track
  65. prog firefox = {
  66. version = %{V_main}
  67. url = ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/
  68. regex = (__VER__)
  69. url = ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/__NEWVER__/
  70. regex = firefox-(__VER__)-source\.tar\.bz2
  71. }
  72. %prep
  73. # extract source distribution
  74. %setup -q -c
  75. %setup -q -D -T -a 1
  76. cd mozilla
  77. # patch source distribution
  78. %patch -p0
  79. # strip down source distribution (save disk space)
  80. find . -type d -name "CVS" -print | xargs rm -rf
  81. find . -type d -name "macbuild" -print | xargs rm -rf
  82. find . -type f -name ".cvsignore" -print | xargs rm -f
  83. find . -type f -name "makefile.win" -print | xargs rm -f
  84. find . -type f -name "MANIFEST" -print | xargs rm -f
  85. rm -rf build/package
  86. %build
  87. cd mozilla
  88. # determine X11 paths
  89. x11_libdir=`%{l_rc} --query x11_libdir`
  90. x11_incdir=`%{l_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/firefox \
  111. --includedir=%{l_prefix}/include/firefox \
  112. --with-x \
  113. --x-includes=`%{l_rc} --query x11_incdir` \
  114. --x-libraries=`%{l_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-jsd \
  127. --enable-crypto \
  128. --enable-chrome-format=jar \
  129. --enable-svg \
  130. --enable-svg-renderer-libart \
  131. --enable-static \
  132. --enable-strip \
  133. %if "%{with_optimize}" == "yes"
  134. --enable-optimize="-O2" \
  135. %else
  136. --disable-optimize \
  137. %endif
  138. --disable-xft \
  139. --disable-freetype2 \
  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 built 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/firefox;" \
  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 convenience wrapper
  177. %{l_prefix}/bin/pod2man \
  178. --section=1 --quotes=none \
  179. --release="Mozilla %{version}" --center="%{packager}" \
  180. %{SOURCE firefox.pod} >firefox.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/firefox \
  187. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  188. # move files into temporary installation tree
  189. ( cd mozilla/dist/bin && %{l_tar} -chf - . ) |\
  190. ( cd $RPM_BUILD_ROOT%{l_prefix}/lib/firefox && %{l_tar} -xf - ) || exit $?
  191. # add startup convenience wrapper
  192. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  193. %{SOURCE firefox.sh} $RPM_BUILD_ROOT%{l_prefix}/bin/firefox
  194. %{l_shtool} install -c -m 644 \
  195. firefox.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