firefox.spec 9.5 KB

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