Magellan Linux

Contents of /trunk/extras/mozilla-firefox/mozilla-firefox-3.5-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2864 - (show annotations) (download)
Sun Jul 12 16:44:07 2009 UTC (15 years, 2 months ago) by niro
File size: 9436 byte(s)
-rebuild, use new msetpref() function from mozilla.sminc and disbaled app.autoupdate in the default config too
1 # $Id$
2
3 PNAME="mozilla-firefox"
4 PVER="3.5"
5 PBUILD="r3"
6
7 PCATEGORIE="net-www"
8 STATE="unstable"
9
10 DESCRIPTION="Firefox is Mozilla's award-winning next generation web browser."
11 HOMEPAGE="http://www.mozilla.org/products/firefox/"
12
13 DEPEND=">= virtual/java
14 >= x11-libs/libXrender-0.9
15 >= x11-libs/libXcomposite-0.4
16 >= x11-libs/libXt-1
17 >= x11-libs/libXmu-1
18 >= dev-libs/expat-2
19 >= sys-libs/zlib-1.2.3
20 >= media-libs/libmng-1.0.10
21 >= media-libs/fontconfig-2.6
22 >= media-libs/libjpeg-6b
23 >= media-libs/libpng-1.2.34
24 >= dev-libs/glib2-2.20
25 >= dev-libs/libidl-0.8.13
26 >= app-arch/zip-3
27 >= app-arch/unzip-5.52
28 >= x11-libs/pango-1.24
29 >= x11-libs/cairo-1.8
30 >= x11-libs/gtk2+-2.16
31 >= dev-libs/nspr-4.8.0
32 >= dev-libs/nss-3.12.3"
33
34 SDEPEND=">= x11-proto/xineramaproto-1
35 >= x11-proto/compositeproto-0.4
36 >= dev-util/pkgconfig-0.23
37 >= sys-dev/autoconf-4
38 >= sys-dev/automake-3
39 >= sys-apps/sed-4"
40
41 SRCFILE="firefox-${PVER}-source.tar.bz2"
42 XUL_PVER="1.9.1"
43 SRCDIR="${BUILDDIR}/mozilla-${XUL_PVER}"
44
45 sminclude mozilla mtools
46
47 SRC_URI=(
48 ftp://ftp.mozilla.org/pub/mozilla.org/${PNAME/mozilla-/}/releases/${PVER}/source/${SRCFILE}
49 mirror://${PNAME}/${SRCFILE}
50 mirror://${PNAME}/menu/firefox.png
51 mirror://${PNAME}/menu/firefox.desktop
52 mirror://${PNAME}/mozilla-firefox-3.0.6-pkgconfig.patch
53 mirror://${PNAME}/mozilla-firefox-3.5-asneeded.patch
54 mirror://${PNAME}/mozilla-firefox-2.0.0.5-rpath-3.patch
55 mirror://${PNAME}/mozilla-firefox-2.0.0.9-language.patch
56 mirror://${PNAME}/mozilla-firefox-3.5-no-app-updates.patch
57 mirror://${PNAME}/mozilla-firefox-3.5-reload-new-plugins.patch
58 mirror://${PNAME}/mozilla-firefox-3.5-fixed-default-uris.patch
59 )
60
61 UP2DATE="updatecmd ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/source | sed 's:-source::' | lasttarball"
62
63 export MOZ_PHOENIX=1
64
65 # set by configure (plus USE_AUTOCONF=1), but useful for NSPR
66 export MOZILLA_CLIENT=1
67 export BUILD_OPT=1
68 export NO_STATIC_LIB=1
69 export USE_PTHREADS=1
70
71 # now strip optimization from CFLAGS so it doesn't end up in the
72 # compile string
73 export CFLAGS="${CFLAGS/-O*/}"
74 export CXXFLAGS="${CFLAGS}"
75
76 # needed to build without warnings on gcc-3
77 export CXXFLAGS="${CXXFLAGS} -Wno-deprecated"
78
79 src_prepare()
80 {
81 munpack ${SRCFILE} || die
82 cd ${SRCDIR}
83
84 # patches, patches, patches
85
86 # use as-needed with newer binutils
87 # https://bugzilla.mozilla.org/show_bug.cgi?id=311236
88 mpatch mozilla-firefox-3.5-asneeded.patch || die
89
90 # fix pkgconfig pathes
91 mpatch mozilla-firefox-3.0.6-pkgconfig.patch || die
92
93 # fix some compile issues on multilib systems
94 mpatch mozilla-firefox-2.0.0.5-rpath-3.patch || die
95
96 # enable variable languages via environment vars
97 mpatch mozilla-firefox-2.0.0.9-language.patch || die
98
99 # disable auto app updates
100 mpatch mozilla-firefox-3.5-no-app-updates.patch || die
101 # disable auto update in the default config too
102 mpatch mozilla-firefox-3.5-disable-updates-as-default.patch || die
103
104 # auto reload newly installed plugins
105 mpatch mozilla-firefox-3.5-reload-new-plugins.patch || die
106
107 # fix broken default uris
108 mpatch mozilla-firefox-3.5-fixed-default-uris.patch || die
109
110 export WANT_AUTOCONF="2.1"
111 autoconf || die
112 }
113
114 src_compile()
115 {
116 cd ${SRCDIR}
117
118 # setup .mozconfig
119 cp browser/config/mozconfig .mozconfig || die
120
121 # where shall the files go ?
122 mozconf_add --with-default-mozilla-five-home=/usr/$(mlibdir)/mozilla-firefox
123
124 # set optimization level based on CFLAGS
125 if [[ ${ARCH} = x86_64 ]]
126 then
127 # opts may cause segfaults on 64bit arches
128 mozconf_add --enable-optimize=-O1
129 export CFLAGS="${CFLAGS} -fPIC"
130 export CXXFLAGS="${CXXFLAGS} -fPIC"
131 else
132 mozconf_add --enable-optimize=-O2
133 fi
134
135 # enable compat mode for plugins build with gcc2
136 mozconf_add --enable-old-abi-compat-wrappers
137
138 # we don't need the installer
139 mozconf_add --disable-installer
140
141 # issue all warnings demanded by strict ANSI C
142 mozconf_add --disable-pedantic
143
144 # enable crypto support (Personal Security Manager)
145 mozconf_add --enable-crypto
146
147 # want system jpeg, pngm, zlib, nspr and nss
148 mozconf_add --with-system-jpeg
149 # doesn't work atm
150 #mozconf_add --with-system-png
151 mozconf_add --with-system-zlib
152 mozconf_add --with-system-nspr
153 mozconf_add --with-system-nss
154
155 # enable cairo-gtk2 as default
156 mozconf_add --enable-default-toolkit=cairo-gtk2
157
158 # no ipv6 support
159 mozconf_add --enable-ipv6
160
161 # want xinerama
162 mozconf_add --enable-xinerama
163
164 # no xprint ?
165 mozconf_add --disable-xprint
166
167 # >= firefox-1.0.7 should use xft + pango, svg with cairo
168 mozconf_add --disable-freetype2
169 mozconf_add --enable-xft
170 mozconf_add --enable-pango
171 mozconf_add --enable-system-cairo
172 mozconf_add --enable-svg
173 mozconf_add --enable-canvas
174
175 # enable all image encoders
176 mozconf_add --enable-image-encoder=all
177
178 # disable debug build && enable stripping
179 mozconf_add --disable-debug
180 mozconf_add --disable-tests
181 mozconf_add --enable-reorder
182 mozconf_add --enable-strip
183 mozconf_add --enable-strip-libs
184
185 if [[ ${ARCH} = i*86 ]]
186 then
187 # optimze build for x86
188 mozconf_add --enable-elf-dynstr-gc
189 fi
190
191 # both needed to build galeon
192 mozconf_add --enable-oji
193 mozconf_add --enable-mathml
194
195 # enable storage, places and safe-browsing
196 mozconf_add --enable-storage
197 mozconf_add --enable-places
198 mozconf_add --enable-safe-browsing
199
200 # enable default extensions
201 mozconf_add --enable-extensions=default
202
203 # gnome support (needs gnome-vfs)
204 mozconf_add --disable-gnomevfs
205 mozconf_add --enable-extension=-gnomevfs
206
207 # broken with firefox-3.0.10
208 mozconf_add --disable-mochitest
209 mozconf_add --disable-crashreporter
210
211 # resolve multiple --enable-extensions down to one
212 rebuild_extension_list
213
214 # now run configure
215 mconfigure || die
216
217 # removes extraneous CFLAGS
218 # to reduce RAM requirements while compiling
219 mozilla_remove_cflags || die
220
221 mmake || die
222 }
223
224 src_install()
225 {
226 cd ${SRCDIR}
227
228 # needed directories
229 minstalldir /etc/env.d || die
230 minstalldir /usr/bin || die
231 minstalldir /usr/$(mlibdir)/mozilla-firefox/icons || die
232 minstalldir /usr/$(mlibdir)/mozilla-firefox/idl || die
233 minstalldir /usr/$(mlibdir)/mozilla-firefox/include || die
234 minstalldir /usr/$(mlibdir)/nsbrowser/plugins || die
235 minstalldir /usr/$(mlibdir)/pkgconfig || die
236 minstalldir /usr/share/applications || die
237
238 # install binaries
239 cp -RL --no-preserve=links ${SRCDIR}/dist/bin/* \
240 ${BINDIR}/usr/$(mlibdir)/mozilla-firefox || die
241
242 # fix permissions
243 mchown -R root:root /usr/$(mlibdir)/mozilla-firefox || die
244
245 # bins
246 mlink /usr/$(mlibdir)/mozilla-firefox/firefox /usr/bin/firefox || die
247
248 # environment
249 # mozilla-1.7* uses already the env var mozilla_five_home
250 # firefox does not need this, the env var is only to compile
251 # mozilla-based sources
252 echo "MOZILLA_FIVE_HOME=/usr/$(mlibdir)/mozilla-firefox" > ${BINDIR}/etc/env.d/90mozilla-firefox || die
253 echo "LDPATH=/usr/$(mlibdir)/mozilla-firefox" >> ${BINDIR}/etc/env.d/90mozilla-firefox || die
254
255 # vendor information
256 msetpref general.useragent.vendor Magellan-Linux || die
257
258 # disable app.update in default config
259 msetpref app.update.auto false || die
260 msetpref app.update.enabled false || die
261 msetpref app.update.autoInstallEnabled false || die
262
263 # necessary includes and idl files to build against firefox
264 cp -LfR dist/include/* ${BINDIR}/usr/$(mlibdir)/mozilla-firefox/include || die
265 cp -LfR dist/idl/* ${BINDIR}/usr/$(mlibdir)/mozilla-firefox/idl || die
266 # symlink to a missing header
267 mlink /usr/$(mlibdir)/mozilla-firefox/include/necko/nsIURI.h \
268 /usr/$(mlibdir)/mozilla-firefox/include/nsIURI.h || die
269 # pkgconfig files
270 # minstallfile build/unix/\*.pc /usr/$(mlibdir)/pkgconfig || die
271
272 # install icons
273 minstallfile ${SRCDIR}/other-licenses/branding/firefox/mozicon16.xpm \
274 /usr/$(mlibdir)/mozilla-firefox/icons || die
275 minstallfile ${SRCDIR}/other-licenses/branding/firefox/mozicon50.xpm \
276 /usr/$(mlibdir)/mozilla-firefox/icons || die
277
278 # menu entries
279 minstallpixmap firefox.png || die
280 minstallfile -s firefox.desktop /usr/share/applications || die
281
282 # now move all plugins to /usr/lib/nsbrowser/plugins
283 # and symlink them (we need a defined location for the plugins of all browsers)
284 cp -a ${BINDIR}/usr/$(mlibdir)/mozilla-firefox/plugins/* \
285 ${BINDIR}/usr/$(mlibdir)/nsbrowser/plugins || die
286 rm -rf ${BINDIR}/usr/$(mlibdir)/mozilla-firefox/plugins || die
287 mlink /usr/$(mlibdir)/nsbrowser/plugins /usr/$(mlibdir)/mozilla-firefox/plugins || die
288 }
289
290 preinstall()
291 {
292 if [[ -n $(magequery -n mozilla) ]]
293 then
294 echo
295 echo "This version of ${PCATEGORIE}/${PNAME} replaces the mozilla development files"
296 echo "and both packages cannot coexist anymore."
297 echo "net-www/mozilla has no official support from mozilla.com"
298 echo "and will not included in future releases of magellan-linux."
299 echo
300 die "Please uninstall net-www/mozilla first!"
301 fi
302 }
303
304 postinstall()
305 {
306 # update environment; needed for REGXPCOM
307 env-rebuild
308 source ${MROOT}/etc/profile
309
310 # firefoxs mozilla_five_home
311 export MOZILLA_FIVE_HOME="${MROOT}/usr/$(mlibdir)/mozilla-firefox"
312
313 # register firefox
314 echo "Registering Components and Chrome..."
315
316 HOME=~root LD_LIBRARY_PATH=${MOZILLA_FIVE_HOME} ${MOZILLA_FIVE_HOME}/regxpcom
317 # HOME=~root LD_LIBRARY_PATH=${MOZILLA_FIVE_HOME} ${MOZILLA_FIVE_HOME}/regchrome
318
319 # fix permissions of component registry
320 chmod 0644 ${MOZILLA_FIVE_HOME}/components/compreg.dat
321
322 # fix directory permissions
323 find ${MOZILLA_FIVE_HOME}/ -type d -perm 0700 -exec chmod 0755 {} \; || :
324
325 # fix permissions on chrome files
326 find ${MOZILLA_FIVE_HOME}/chrome/ -name '*.rdf' -exec chmod 0644 {} \; || :
327 }

Properties

Name Value
svn:keywords Id