mozilla.spec 9.6 KB

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