firefox.spec 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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: EVAL
  32. Group: Web
  33. License: MPL
  34. Version: 1.0.4
  35. Release: 20050612
  36. # package options
  37. %option with_optimize yes
  38. %option with_svg no
  39. # list of sources
  40. Source0: ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2
  41. Source1: firefox.sh
  42. Source2: firefox.pod
  43. Source3: firefox-init.tar.gz
  44. Source4: about.png
  45. Source5: aboutCredits.png
  46. Patch0: firefox.patch
  47. # build information
  48. Prefix: %{l_prefix}
  49. BuildRoot: %{l_buildroot}
  50. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc, perl, pkgconfig
  51. PreReq: OpenPKG, openpkg >= 20040130, xsel, wmctrl
  52. BuildPreReq: X11, glib, gtk, png, jpeg, orbit, libiconv
  53. PreReq: X11, glib, gtk, png, jpeg, orbit, libiconv
  54. BuildPreReq: infozip, zlib, openssl, freetype
  55. PreReq: infozip, zlib, openssl, freetype
  56. %if "%{with_svg}" == "yes"
  57. BuildPreReq: cairo, cairo::with_x11 = yes
  58. PreReq: cairo, cairo::with_x11 = yes
  59. %endif
  60. AutoReq: no
  61. AutoReqProv: no
  62. %description
  63. Firefox is a speedy, full featured Web browser based on the Mozilla
  64. codebase. It uses the Mozilla Gecko engine for rendering the Mozilla
  65. Web content and XUL for presenting the GUI.
  66. %track
  67. prog firefox = {
  68. version = %{version}
  69. url = ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/
  70. regex = (__VER__)
  71. url = ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/__NEWVER__/source/
  72. regex = firefox-(__VER__)-source\.tar\.bz2
  73. }
  74. %prep
  75. # extract source distribution
  76. %setup -q -n mozilla
  77. # patch source distribution
  78. %patch -p0
  79. # overwrite OEM branding for OpenPKG recognition
  80. cp -f %{SOURCE about.png} browser/base/content/
  81. cp -f %{SOURCE aboutCredits.png} browser/base/content/
  82. # strip down source distribution (save disk space)
  83. find . -type d -name "CVS" -print | xargs rm -rf
  84. find . -type d -name "macbuild" -print | xargs rm -rf
  85. find . -type f -name ".cvsignore" -print | xargs rm -f
  86. find . -type f -name "makefile.win" -print | xargs rm -f
  87. find . -type f -name "MANIFEST" -print | xargs rm -f
  88. rm -rf build/package
  89. %build
  90. # determine X11 paths
  91. x11_libdir=`%{l_rc} --query x11_libdir`
  92. x11_incdir=`%{l_rc} --query x11_incdir`
  93. # determine build flags
  94. CC="%{l_cc}"
  95. CXX="%{l_cxx}"
  96. CFLAGS="%{l_cflags} %{l_cppflags} -I${x11_incdir}"
  97. CXXFLAGS="%{l_cxxflags} -Wno-deprecated %{l_cppflags} -I${x11_incdir}"
  98. CPPFLAGS="%{l_cppflags glib} -I${x11_incdir}"
  99. LDFLAGS="-L`pwd`/dist/bin -L`pwd`/dist/lib -L`pwd`/dist/lib/components"
  100. LDFLAGS="$LDFLAGS %{l_ldflags} -L${x11_libdir}"
  101. GLIB_CONFIG="%{l_prefix}/bin/glib-config"
  102. GTK_CONFIG="%{l_prefix}/bin/gtk-config"
  103. LIBIDL_CONFIG="%{l_prefix}/bin/libIDL-config"
  104. PERL="%{l_prefix}/bin/perl"
  105. MOZILLA_OFFICIAL=1
  106. BUILD_OFFICIAL=1
  107. MOZ_PHOENIX=1
  108. export CC CXX CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
  109. export GLIB_CONFIG GTK_CONFIG LIBIDL_CONFIG
  110. export MOZILLA_OFFICIAL BUILD_OFFICIAL
  111. export MOZ_PHOENIX
  112. # binutils ld(1) doesn't properly link with Solaris dynamic libc(3)
  113. touch config.cache
  114. case "%{l_platform -t}" in
  115. *-sunos* )
  116. # force to use the system link editor
  117. echo "ac_cv_prog_LD=/usr/ccs/bin/ld" >config.cache
  118. LD=/usr/ccs/bin/ld
  119. export LD
  120. # correct hard coded LD variables
  121. %{l_shtool} subst \
  122. -e 's;^\(LD[^=]*\)= *$(CC);\1=/usr/ccs/bin/ld;' \
  123. config/config.mk
  124. # final link of firefox-bin(1) needs explicit libgcc
  125. libgccpath=`gcc -print-search-dirs \
  126. | grep '^install' \
  127. | %{l_shtool} subst -e 's;^install: \(.*\)$;\1;'`
  128. %{l_shtool} subst \
  129. -e "s;\(LDFLAGS += -L\)@l_gccinst@;\1$libgccpath;" \
  130. embedding/browser/gtk/tests/Makefile.in \
  131. browser/app/Makefile.in
  132. ;;
  133. esac
  134. # specify custom extensions, leaving out the broken 'typeaheadfind'
  135. custext="cookie,wallet,content-packs,xml-rpc,xmlextras,help,p3p,pref"
  136. custext="${custext},transformiix,venkman,inspector,irc,universalchardet"
  137. custext="${custext},webservices,spellcheck,gnomevfs,negotiateauth"
  138. custext="${custext},xmlterm,datetime,finger,cview,layout-debug,tasks"
  139. # configure source
  140. ./configure \
  141. --cache-file=./config.cache \
  142. --prefix=%{l_prefix} \
  143. --libdir=%{l_prefix}/lib/firefox \
  144. --with-default-mozilla-five-home=%{l_prefix}/lib/firefox \
  145. --includedir=%{l_prefix}/include/firefox \
  146. --with-x \
  147. --x-includes=`%{l_rc} --query x11_incdir` \
  148. --x-libraries=`%{l_rc} --query x11_libdir` \
  149. --enable-default-toolkit=gtk \
  150. --enable-toolkit-gtk \
  151. --disable-toolkit-qt \
  152. --disable-toolkit-xlib \
  153. --with-gtk-prefix=%{l_prefix} \
  154. --with-glib-prefix=%{l_prefix} \
  155. --with-libIDL-prefix=%{l_prefix} \
  156. --with-system-jpeg=%{l_prefix} \
  157. --with-system-png=%{l_prefix} \
  158. --with-system-zlib=%{l_prefix} \
  159. --with-ft-prefix=%{l_prefix} \
  160. --with-user-appdir=.firefox \
  161. --enable-extensions="$custext" \
  162. --enable-jsd \
  163. --enable-crypto \
  164. --enable-chrome-format=jar \
  165. %if "%{with_svg}" == "yes"
  166. --enable-svg \
  167. --enable-svg-renderer-cairo \
  168. %else
  169. --disable-svg \
  170. %endif
  171. --enable-static \
  172. --enable-strip \
  173. %if "%{with_optimize}" == "yes"
  174. --enable-optimize="-O2" \
  175. %else
  176. --disable-optimize \
  177. %endif
  178. --disable-mailnews \
  179. --disable-composer \
  180. --disable-xft \
  181. --disable-freetype2 \
  182. --disable-xinerama \
  183. --disable-shared \
  184. --disable-tests \
  185. --disable-ldap \
  186. --disable-accessibility \
  187. --disable-debug \
  188. --disable-dtd-debug \
  189. --disable-pedantic \
  190. --disable-auto-deps \
  191. --disable-md \
  192. --disable-cpp-exceptions \
  193. --disable-cpp-rtti \
  194. --disable-xterm-updates \
  195. --disable-elf-dynstr-gc \
  196. --disable-installer \
  197. --disable-profilesharing \
  198. --enable-single-profile \
  199. --with-pthreads
  200. # build program
  201. %{l_make} %{l_mflags}
  202. # post adjustments to built program
  203. ( cd dist/bin
  204. # prepare for multi-user usage
  205. LD_LIBRARY_PATH=.; export LD_LIBRARY_PATH
  206. MOZILLA_FIVE_HOME=.; export MOZILLA_FIVE_HOME
  207. ./regxpcom || true
  208. ./regchrome || true
  209. touch chrome/user-skins.rdf chrome/user-locales.rdf
  210. # re-adjust paths to reflect final location
  211. %{l_shtool} subst \
  212. -e "s;`pwd`;%{l_prefix}/lib/firefox;" \
  213. components/xpti.dat components/compreg.dat
  214. # strip down installation tree
  215. find . -type d -depth -print | xargs rmdir >/dev/null 2>&1 || true
  216. rm -f mozilla-config mkdepend nsinstall bloaturls.txt TestGtk* LICENSE README
  217. rm -rf res/samples
  218. # workaround run-time startup problems
  219. mkdir .autoreg >/dev/null 2>&1 || true
  220. ) || exit $?
  221. # generate manual page for startup convenience wrapper
  222. %{l_prefix}/bin/pod2man \
  223. --section=1 --quotes=none \
  224. --release="Mozilla %{version}" --center="%{packager}" \
  225. %{SOURCE firefox.pod} >firefox.1
  226. %install
  227. rm -rf $RPM_BUILD_ROOT
  228. # generate temporary installation tree
  229. %{l_shtool} mkdir -f -p -m 755 \
  230. $RPM_BUILD_ROOT%{l_prefix}/bin \
  231. $RPM_BUILD_ROOT%{l_prefix}/lib/firefox \
  232. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  233. # move files into temporary installation tree
  234. ( cd dist/bin && %{l_tar} -chf - . ) |\
  235. ( cd $RPM_BUILD_ROOT%{l_prefix}/lib/firefox && %{l_tar} -xf - ) || exit $?
  236. # add initialization files
  237. ( cd $RPM_BUILD_ROOT%{l_prefix}/lib && \
  238. %{l_tar} -xf %{SOURCE firefox-init.tar.gz} && \
  239. rm -f firefox/README
  240. ) || exit $?
  241. # add startup convenience wrapper
  242. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  243. %{SOURCE firefox.sh} $RPM_BUILD_ROOT%{l_prefix}/bin/firefox
  244. %{l_shtool} install -c -m 644 \
  245. firefox.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  246. # determine installation files
  247. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  248. %files -f files
  249. %clean
  250. rm -rf $RPM_BUILD_ROOT