firefox.spec 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. ##
  2. ## firefox.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2005 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: firefox
  26. Summary: Graphical Web Browser
  27. URL: http://www.mozilla.org/products/firefox/
  28. Vendor: The Mozilla Project
  29. Packager: OpenPKG
  30. Distribution: OpenPKG
  31. Class: JUNK
  32. Group: Web
  33. License: MPL
  34. Version: 1.0.2
  35. Release: 20050324
  36. # package options
  37. %option with_optimize yes
  38. # list of sources
  39. Source0: ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2
  40. Source1: firefox.sh
  41. Source2: firefox.pod
  42. Patch0: firefox.patch
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc, perl, pkgconfig
  47. PreReq: OpenPKG, openpkg >= 20040130, xsel, wmctrl
  48. BuildPreReq: X11, glib, gtk, png, jpeg, orbit, libiconv
  49. PreReq: X11, glib, gtk, png, jpeg, orbit, libiconv
  50. BuildPreReq: infozip, zlib, openssl, freetype, cairo, cairo::with_x11 = yes
  51. PreReq: infozip, zlib, openssl, freetype, cairo, cairo::with_x11 = yes
  52. AutoReq: no
  53. AutoReqProv: no
  54. %description
  55. Firefox is a speedy, full-featured Web browser based on the Mozilla
  56. codebase. It uses the Mozilla Gecko engine for rendering the Mozilla
  57. Web content and XUL for presenting the GUI.
  58. %track
  59. prog firefox = {
  60. version = %{version}
  61. url = ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/
  62. regex = (__VER__)
  63. url = ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/__NEWVER__/source/
  64. regex = firefox-(__VER__)-source\.tar\.bz2
  65. }
  66. %prep
  67. # extract source distribution
  68. %setup -q -n mozilla
  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_rc} --query x11_libdir`
  81. x11_incdir=`%{l_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. MOZILLA_OFFICIAL=1
  95. BUILD_OFFICIAL=1
  96. MOZ_PHOENIX=1
  97. export CC CXX CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
  98. export GLIB_CONFIG GTK_CONFIG LIBIDL_CONFIG
  99. export MOZILLA_OFFICIAL BUILD_OFFICIAL
  100. export MOZ_PHOENIX
  101. # configure source
  102. ./configure \
  103. --prefix=%{l_prefix} \
  104. --libdir=%{l_prefix}/lib/firefox \
  105. --with-default-mozilla-five-home=%{l_prefix}/lib/firefox \
  106. --includedir=%{l_prefix}/include/firefox \
  107. --with-x \
  108. --x-includes=`%{l_rc} --query x11_incdir` \
  109. --x-libraries=`%{l_rc} --query x11_libdir` \
  110. --enable-default-toolkit=gtk \
  111. --enable-toolkit-gtk \
  112. --disable-toolkit-qt \
  113. --disable-toolkit-xlib \
  114. --with-gtk-prefix=%{l_prefix} \
  115. --with-glib-prefix=%{l_prefix} \
  116. --with-libIDL-prefix=%{l_prefix} \
  117. --with-system-jpeg=%{l_prefix} \
  118. --with-system-png=%{l_prefix} \
  119. --with-system-zlib=%{l_prefix} \
  120. --with-ft-prefix=%{l_prefix} \
  121. --enable-application=browser \
  122. --with-user-appdir=.firefox \
  123. --enable-extensions=all,-typeaheadfind \
  124. --enable-jsd \
  125. --enable-crypto \
  126. --enable-chrome-format=jar \
  127. --enable-svg \
  128. --enable-svg-renderer-cairo \
  129. --enable-static \
  130. --enable-strip \
  131. %if "%{with_optimize}" == "yes"
  132. --enable-optimize="-O2" \
  133. %else
  134. --disable-optimize \
  135. %endif
  136. --disable-xft \
  137. --disable-freetype2 \
  138. --disable-xinerama \
  139. --disable-shared \
  140. --disable-tests \
  141. --disable-ldap \
  142. --disable-accessibility \
  143. --disable-debug \
  144. --disable-dtd-debug \
  145. --disable-pedantic \
  146. --disable-auto-deps \
  147. --disable-md \
  148. --disable-cpp-exceptions \
  149. --disable-cpp-rtti \
  150. --disable-xterm-updates \
  151. --disable-elf-dynstr-gc \
  152. --disable-profilesharing \
  153. --enable-single-profile \
  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 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