mozilla.spec 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. ##
  2. ## mozilla.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: mozilla
  26. Summary: Graphical Internet Communication Frontend
  27. URL: http://www.mozilla.org/
  28. Vendor: The Mozilla Project
  29. Packager: OpenPKG
  30. Distribution: OpenPKG
  31. Class: PLUS
  32. Group: Web
  33. License: MPL
  34. Version: 1.7.6
  35. Release: 20050324
  36. # package options
  37. %option with_optimize yes
  38. %option with_mailnews no
  39. %option with_composer no
  40. %option with_sdk no
  41. # list of sources
  42. Source0: ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla%{version}/source/mozilla-source-%{version}.tar.bz2
  43. Source1: mozilla.sh
  44. Source2: mozilla.pod
  45. Patch0: mozilla.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, cairo, cairo::with_x11 = yes
  54. PreReq: infozip, zlib, openssl, freetype, cairo, cairo::with_x11 = yes
  55. AutoReq: no
  56. AutoReqProv: no
  57. %description
  58. Mozilla is a full-featured Open Source Internet communication
  59. frontend derived from the popular Netscape Communicator. It provides
  60. Web, Mail, News and Chat client services and is designed for
  61. standards compliance, performance and portability.
  62. %track
  63. prog mozilla = {
  64. version = %{version}
  65. url = ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/
  66. regex = mozilla(1\.\d+(\.\d+)*)\b
  67. url = ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla__NEWVER__/src/
  68. regex = mozilla-source-(__VER__)\.tar\.bz2
  69. }
  70. %prep
  71. # display a warning that this package is a beast
  72. ( echo "This package requires about 600 MB of free disk space, 250 MB of RAM"
  73. echo "and 30 minutes real-time to build on a Pentium-4 3.2Ghz class CPU."
  74. echo "So be prepared and patient, please... ;-)"
  75. ) | %{l_rpmtool} msg -b -t notice
  76. # extract source distribution
  77. %setup -q -n mozilla
  78. # patch source distribution
  79. %patch -p0
  80. # strip down source distribution (save disk space)
  81. find . -type d -name "CVS" -print | xargs rm -rf
  82. find . -type d -name "macbuild" -print | xargs rm -rf
  83. find . -type f -name ".cvsignore" -print | xargs rm -f
  84. find . -type f -name "makefile.win" -print | xargs rm -f
  85. find . -type f -name "MANIFEST" -print | xargs rm -f
  86. rm -rf build/package
  87. %build
  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. MOZILLA_OFFICIAL=1
  104. BUILD_OFFICIAL=1
  105. export CC CXX CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
  106. export GLIB_CONFIG GTK_CONFIG LIBIDL_CONFIG
  107. export MOZILLA_OFFICIAL BUILD_OFFICIAL
  108. # configure source
  109. ./configure \
  110. --prefix=%{l_prefix} \
  111. --libdir=%{l_prefix}/lib/mozilla \
  112. --with-default-mozilla-five-home=%{l_prefix}/lib/mozilla \
  113. --includedir=%{l_prefix}/include/mozilla \
  114. --with-x \
  115. --x-includes=`%{l_rc} --query x11_incdir` \
  116. --x-libraries=`%{l_rc} --query x11_libdir` \
  117. --enable-default-toolkit=gtk \
  118. --enable-toolkit-gtk \
  119. --disable-toolkit-qt \
  120. --disable-toolkit-xlib \
  121. --with-gtk-prefix=%{l_prefix} \
  122. --with-glib-prefix=%{l_prefix} \
  123. --with-libIDL-prefix=%{l_prefix} \
  124. --with-system-jpeg=%{l_prefix} \
  125. --with-system-png=%{l_prefix} \
  126. --with-system-zlib=%{l_prefix} \
  127. --with-ft-prefix=%{l_prefix} \
  128. --enable-jsd \
  129. --enable-crypto \
  130. --enable-chrome-format=jar \
  131. --enable-svg \
  132. --enable-svg-renderer-cairo \
  133. --enable-static \
  134. --enable-strip \
  135. %if "%{with_optimize}" == "yes"
  136. --enable-optimize="-O2" \
  137. %else
  138. --disable-optimize \
  139. %endif
  140. %if "%{with_mailnews}" == "yes"
  141. --enable-mailnews \
  142. %else
  143. --disable-mailnews \
  144. %endif
  145. %if "%{with_composer}" == "yes"
  146. --enable-composer \
  147. %else
  148. --disable-composer \
  149. %endif
  150. --disable-xft \
  151. --disable-freetype2 \
  152. --disable-xinerama \
  153. --disable-shared \
  154. --disable-tests \
  155. --disable-ldap \
  156. --disable-accessibility \
  157. --disable-debug \
  158. --disable-dtd-debug \
  159. --disable-pedantic \
  160. --disable-auto-deps \
  161. --disable-md \
  162. --disable-cpp-exceptions \
  163. --disable-cpp-rtti \
  164. --disable-xterm-updates \
  165. --disable-elf-dynstr-gc \
  166. --with-pthreads
  167. # build program
  168. %{l_make} %{l_mflags}
  169. # post adjustments to built program
  170. ( cd dist/bin
  171. # prepare for multi-user usage
  172. LD_LIBRARY_PATH=.; export LD_LIBRARY_PATH
  173. MOZILLA_FIVE_HOME=.; export MOZILLA_FIVE_HOME
  174. ./regxpcom || true
  175. ./regchrome || true
  176. touch chrome/user-skins.rdf chrome/user-locales.rdf
  177. # re-adjust paths to reflect final location
  178. %{l_shtool} subst \
  179. -e "s;`pwd`;%{l_prefix}/lib/mozilla;" \
  180. components/xpti.dat components/compreg.dat
  181. # strip down installation tree
  182. find . -type d -depth -print | xargs rmdir >/dev/null 2>&1 || true
  183. rm -f mozilla-config mkdepend nsinstall bloaturls.txt TestGtk* LICENSE README
  184. rm -rf res/samples
  185. # workaround run-time startup problems
  186. mkdir .autoreg >/dev/null 2>&1 || true
  187. ) || exit $?
  188. # generate manual page for startup convenience wrapper
  189. %{l_prefix}/bin/pod2man \
  190. --section=1 --quotes=none \
  191. --release="Mozilla %{version}" --center="%{packager}" \
  192. %{SOURCE mozilla.pod} >mozilla.1
  193. %install
  194. rm -rf $RPM_BUILD_ROOT
  195. # generate temporary installation tree
  196. %{l_shtool} mkdir -f -p -m 755 \
  197. $RPM_BUILD_ROOT%{l_prefix}/bin \
  198. $RPM_BUILD_ROOT%{l_prefix}/lib/mozilla \
  199. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  200. # move files into temporary installation tree
  201. ( cd dist/bin && %{l_tar} -chf - . ) |\
  202. ( cd $RPM_BUILD_ROOT%{l_prefix}/lib/mozilla && %{l_tar} -xf - ) || exit $?
  203. # install SDK files
  204. %if "%{with_sdk}" == "yes"
  205. %{l_shtool} mkdir -f -p -m 755 \
  206. $RPM_BUILD_ROOT%{l_prefix}/include/mozilla \
  207. $RPM_BUILD_ROOT%{l_prefix}/share/mozilla/idl \
  208. $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
  209. %{l_shtool} install -c -m 755 \
  210. -e "s;-L$RPM_BUILD_ROOT%{l_prefix}[^ ]*;;g" \
  211. build/unix/mozilla-config $RPM_BUILD_ROOT%{l_prefix}/bin/
  212. for name in mozilla-gtkmozembed mozilla-js mozilla-xpcom mozilla-nspr mozilla-nss mozilla-plugin; do
  213. %{l_shtool} install -c -m 644 \
  214. -e 's;include/mozilla/mozilla-%{version};include/mozilla;g' \
  215. -e 's;lib/mozilla/mozilla-%{version};lib/mozilla;g' \
  216. -e "s;-L$RPM_BUILD_ROOT%{l_prefix}[^ ]*;;g" \
  217. build/unix/$name.pc $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/$name.pc
  218. done
  219. ( cd dist/include && %{l_tar} -chf - . ) |\
  220. ( cd $RPM_BUILD_ROOT%{l_prefix}/include/mozilla && %{l_tar} -xf - ) || exit $?
  221. ( cd dist/sdk/lib && %{l_tar} -chf - . ) |\
  222. ( cd $RPM_BUILD_ROOT%{l_prefix}/lib/mozilla && %{l_tar} -xf - ) || exit $?
  223. ( cd dist/sdk/idl && %{l_tar} -chf - . ) |\
  224. ( cd $RPM_BUILD_ROOT%{l_prefix}/share/mozilla/idl && %{l_tar} -xf - ) || exit $?
  225. %endif
  226. # add startup convenience wrapper
  227. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  228. %{SOURCE mozilla.sh} $RPM_BUILD_ROOT%{l_prefix}/bin/mozilla
  229. %{l_shtool} install -c -m 644 \
  230. mozilla.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  231. # determine installation files
  232. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  233. %files -f files
  234. %clean
  235. rm -rf $RPM_BUILD_ROOT