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