wok-next view firefox/receipt @ rev 8243

Up: slitaz-base-files 4.1.2, tazpkg 4.2.3
author Antoine Bodin <gokhlayeh@slitaz.org>
date Fri Jan 28 23:10:49 2011 +0100 (2011-01-28)
parents fe2cc5e46900
children 51b3d31d7043
line source
1 # SliTaz package receipt.
3 PACKAGE="firefox"
4 VERSION="3.6.13"
5 CATEGORY="network"
6 SHORT_DESC="User friendly, secure and fast web browser."
7 MAINTAINER="pankso@slitaz.org"
8 DEPENDS="gtk+ sqlite dbus dbus-glib glib jpeg xorg-libX11 xorg-libXdamage alsa-lib xorg-libXt libfirefox libnotify"
9 BUILD_DEPENDS="xorg-dev gtk+-dev zip libIDL coreutils findutils xorg-libXft-dev \
10 dbus-dev dbus-glib-dev alsa-lib alsa-lib-dev libnotify-dev wireless_tools-dev perl \
11 python"
12 TARBALL="$PACKAGE-$VERSION.source.tar.bz2"
13 WEB_SITE="http://www.mozilla.org/"
14 WGET_URL="http://releases.mozilla.org/pub/mozilla.org/firefox/releases/$VERSION/source/$TARBALL"
15 CONFIG_FILES="/etc/firefox"
16 TAGS="browser"
18 # Rules to configure and make the package.
19 #
20 # A long compile time... dont forget to build libidl before and check the
21 # .mozconfig file from the stuff and the stuff/README document.
22 #
23 compile_rules()
24 {
25 # Move the mozilla source tree to $PACKAGE-$VERSION to keep variables
26 # and to have a nice clean.
27 mv mozilla-* $PACKAGE-$VERSION 2>/dev/null
28 cp -a stuff/firefox.mozconfig $src/.mozconfig
29 cd $src
30 sed -i 's/xtype/type/' toolkit/mozapps/installer/packager.mk
31 ./configure $CONFIGURE_ARGS &&
32 make -j 4 &&
33 make DESTDIR=$PWD/_pkg install
34 }
36 # Rules to gen a SliTaz package suitable for Tazpkg.
37 genpkg_rules()
38 {
39 mkdir -p $fs/usr/lib/$PACKAGE-$VERSION $fs/usr/share $fs/etc
40 cp -a $_pkg/usr/bin $fs/usr
41 cp -a $_pkg/usr/lib/$PACKAGE-$VERSION $fs/usr/lib
43 # Home page, bookmarks file and branding.
44 cp -a stuff/browserconfig.properties $fs/usr/lib/$PACKAGE-$VERSION
45 cp -a stuff/bookmarks.html \
46 $fs/usr/lib/$PACKAGE-$VERSION/defaults/profile
47 cp -a stuff/firefox-branding.js \
48 $fs/usr/lib/$PACKAGE-$VERSION/defaults/pref/
50 # User preference.
51 cp -a stuff/prefs.js $fs/usr/lib/$PACKAGE-$VERSION/defaults/profile
52 cp -a stuff/userChrome.css \
53 $fs/usr/lib/$PACKAGE-$VERSION/defaults/profile/chrome
55 # Move default config to /etc/firefox (/usr maybe read-only)
56 for i in defaults browserconfig.properties ; do
57 mv -f $fs/usr/lib/$PACKAGE-$VERSION/$i $fs/etc/$PACKAGE
58 done
59 ln -s /etc/$PACKAGE/browserconfig.properties $fs/usr/lib/$PACKAGE-$VERSION
60 ln -s /etc/$PACKAGE $fs/usr/lib/$PACKAGE-$VERSION/defaults
62 # EULA is accepted by SliTaz project.
63 sed -i s:'pref("browser.EULA.3.accepted", false);':'pref("browser.EULA.3.accepted", true);': \
64 $fs/etc/firefox/pref/firefox.js
66 # Locale fr
67 # tar xjf stuff/langpack-fr@firefox.mozilla.org.tar.bz2 \
68 # -C $fs/usr/lib/$PACKAGE-$VERSION/extensions
69 #sed -i "s/maxVersion>3.0../maxVersion>$VERSION/" \
70 # $fs/usr/lib/$PACKAGE-$VERSION/extensions/langpack*/install.rdf
72 # Search Plugin (by: oddball)
73 cp -a stuff/searchplugins $fs/usr/lib/firefox-$VERSION/
74 chown -R root.root $fs
76 # Remove unnecessary files.
77 rm -rf $fs/usr/lib/$PACKAGE-$VERSION/dictionaries/*
78 rm -rf $fs/usr/lib/$PACKAGE-$VERSION/icons
79 # split firefox libs
80 rm -rf $fs/usr/lib/$PACKAGE-$VERSION/*.so
81 #retain big firefox libs
82 cp $_pkg/usr/lib/$PACKAGE-$VERSION/libxul.so \
83 $_pkg/usr/lib/$PACKAGE-$VERSION/libmozjs.so \
84 $fs/usr/lib/$PACKAGE-$VERSION
86 }
88 # Pre - Post install command to set default locale.
89 pre_install()
90 {
91 local root
92 root=$1
93 # Get old plugins
94 mkdir /tmp/firefox-plugins-$$
95 cp -a $root/usr/lib/firefox-*/plugins/* /tmp/firefox-plugins-$$ 2> /dev/null
96 # Remove old libs and configs
97 rm -rf $root/usr/lib/firefox-*/plugins
98 rm -rf $root/usr/lib/firefox-*/dictionaries
99 rm -rf $root/etc/firefox
100 }
101 post_install()
102 {
103 local root
104 root=$1
105 if grep -q "fr_*" $root/etc/locale.conf 2>/dev/null; then
106 sed -i 's/en-US/fr/' \
107 $root/etc/firefox/pref/firefox-l10n.js
108 fi
109 for i in /tmp/firefox-plugins-$$/* ; do
110 [ -e $i ] || continue
111 [ -e /usr/lib/firefox-*/plugins/$(basename $i) ] && continue
112 cp -a $i /usr/lib/firefox-*/plugins/
113 done
114 rm -rf /tmp/firefox-plugins-$$
115 }