wok-undigest view firefox/receipt @ rev 948

firefox: reducing log size
author Dominique Corbex <domcox@slitaz.org>
date Mon Mar 11 22:28:27 2013 +0100 (2013-03-11)
parents bb288d01b7cc
children 8415d97792e4
line source
1 # SliTaz package receipt.
3 PACKAGE="firefox"
4 VERSION="17.0.3esr"
5 CATEGORY="network"
6 SHORT_DESC="User friendly, secure and fast web browser."
7 MAINTAINER="pankso@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.source.tar.bz2"
9 WEB_SITE="http://www.mozilla.org/firefox"
10 WGET_URL="ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/$VERSION/source/$TARBALL"
11 TAGS="browser"
13 DEPENDS="gtk+ sqlite dbus dbus-glib glib jpeg xorg-libX11 xorg-libXdamage \
14 alsa-lib xorg-libXt libevent libvpx pango nss sqlite mozilla-common \
15 gstreamer gst-plugins-base"
16 BUILD_DEPENDS="zip libIDL coreutils findutils wireless_tools-dev \
17 perl python yasm alsa-lib-dev mesa-dev libevent-dev libvpx-dev dbus-dev \
18 dbus-glib-dev gtk+-dev glib-dev pango-dev nss-dev sqlite-dev tar gzip \
19 gstreamer-dev gst-plugins-base-dev"
21 # Rules to configure and make the package.
22 #
23 # A long compile time... dont forget to build libidl before and check the
24 # .mozconfig file from the stuff and the stuff/README document.
25 #
26 # WARNING: 1GB RAM minimum. Additional RAM will significantly decrease
27 # build time.
28 # At least 2.5 GB free disk space
30 compile_rules()
31 {
32 cd $src
33 # load mozconfig
34 cp -a $stuff/mozconfig $src
36 # build firefox and create a firefox tarball
37 # reducing log size: hide c++, nsinstall, python, Exception (Bug#696763) msgs
38 make -f client.mk | egrep -v "c++|nsinstall|python|Exception" &&
39 make -C obj-firefox/browser/installer
41 # install
42 # locate tarball
43 local tarball tarpath fn1 fn2
44 tarpath=$src/obj-firefox/dist
45 fn1="$tarpath/firefox-${VERSION%esr}.en-US.linux-$ARCH.tar.bz2"
46 fn2="$tarpath/firefox-${VERSION%esr}.en-US.linux-$(uname -m).tar.bz2"
47 [ -e "$fn1" ] && tarball="$fn1" && echo "$ARCH tarball found"
48 [ -e "$fn2" ] && tarball="$fn2" && echo "$(uname -m) tarball found"
49 [ -z "$tarball" ] && echo "ERROR: tarball not found" && exit 1
50 # extract tarball
51 mkdir -p $install/usr/lib/firefox-$VERSION &&
52 tar -xvf $tarball -C $install/usr/lib/firefox-$VERSION \
53 --strip-components=1 &&
54 chown -R -v root:root $install/usr/lib/firefox-$VERSION &&
55 chmod -v 755 $install/usr/lib/firefox-$VERSION/libxpcom.so &&
56 # install symlink in /usr/bin
57 mkdir -p $install/usr/bin &&
58 ln -sf ../lib/firefox-$VERSION/firefox $install/usr/bin &&
59 # install symlink for plugins
60 mkdir -p $install/usr/lib/mozilla/plugins &&
61 ln -sf ../mozilla/plugins $install/usr/lib/firefox-$VERSION
62 }
64 # Rules to gen a SliTaz package suitable for Tazpkg.
65 genpkg_rules()
66 {
67 # program
68 printf "Installing program.."
69 mkdir -p $fs/usr/lib &&
70 cp -a $install/usr/lib/$PACKAGE-$VERSION $fs/usr/lib &&
71 cp -a $install/usr/lib/mozilla $fs/usr/lib &&
72 cp -a $install/usr/bin $fs/usr
73 status
75 # search Plugin (by: oddball)
76 printf "Installing SliTaz search plugins.."
77 cp -a $stuff/searchplugins $fs/usr/lib/$PACKAGE-$VERSION
78 status
80 # prefs
81 printf "Installing SliTaz preferences.."
82 mkdir -p $fs/usr/lib/$PACKAGE-$VERSION/distribution &&
83 cp -a $stuff/distribution.ini $fs/usr/lib/$PACKAGE-$VERSION/distribution
84 status
86 # mozilla-common files
87 # dictionaries
88 printf "Installing common dictionnaries.."
89 rm -rf $fs/usr/lib/$PACKAGE-$VERSION/dictionaries &&
90 ln -sf ../mozilla-common-$VERSION/dictionaries \
91 $fs/usr/lib/$PACKAGE-$VERSION/dictionaries
92 status
93 # plugin-container
94 printf "Installing common plugin-container"
95 rm -f $fs/usr/lib/$PACKAGE-$VERSION/plugin-container &&
96 ln -sf ../mozilla-common-$VERSION/plugin-container \
97 $fs/usr/lib/$PACKAGE-$VERSION/plugin-container
98 status
99 # mozilla-xremote-client
100 printf "Installing common mozilla-xremote-client"
101 rm -f $fs/usr/lib/$PACKAGE-$VERSION/mozilla-xremote-client &&
102 ln -sf ../mozilla-common-$VERSION/mozilla-xremote-client \
103 $fs/usr/lib/$PACKAGE-$VERSION/mozilla-xremote-client
104 status
105 # components/libdbusservice.so
106 # components/libmozgnome.so
107 for file in libdbusservice.so libmozgnome.so; do
108 printf "Installing common components/$file"
109 rm -f $fs/usr/lib/$PACKAGE-$VERSION/components/$file &&
110 ln -sf ../../mozilla-common-$VERSION/components/$file \
111 $fs/usr/lib/$PACKAGE-$VERSION/components/$file
112 status
113 done
114 # chrome.manifest
115 printf "Installing common chrome.manifest"
116 rm -f $fs/usr/lib/$PACKAGE-$VERSION/chrome.manifest &&
117 ln -sf ../mozilla-common-$VERSION/chrome.manifest \
118 $fs/usr/lib/$PACKAGE-$VERSION/chrome.manifest
119 status
121 # run-mozilla.sh
122 printf "Installing common run-mozilla.sh"
123 rm -f $fs/usr/lib/$PACKAGE-$VERSION/run-mozilla.sh &&
124 ln -sf ../mozilla-common-$VERSION/run-mozilla.sh \
125 $fs/usr/lib/$PACKAGE-$VERSION/run-mozilla.sh
126 status
128 # libmozalloc.so
129 printf "Installing common libmozalloc.so"
130 rm -f $fs/usr/lib/$PACKAGE-$VERSION/libmozalloc.so &&
131 ln -sf ../mozilla-common-$VERSION/libmozalloc.so \
132 $fs/usr/lib/$PACKAGE-$VERSION/libmozalloc.so
133 status
135 chown -R root.root $fs
136 }
138 # Pre - Post install command to set default locale.
139 pre_install()
140 {
141 local root="$1"
142 # backup plugins
143 mkdir /tmp/firefox-plugins-$$
144 cp -a $root/usr/lib/firefox/plugins/* /tmp/firefox-plugins-$$ 2> /dev/null
145 # remove old libs and configs
146 rm -rf $root/usr/lib/firefox/plugins
147 rm -rf $root/usr/lib/firefox/dictionaries
148 }
150 post_install()
151 {
152 local root="$1"
153 # restore plugins
154 for i in /tmp/firefox-plugins-$$/* ; do
155 [ -e $i ] || continue
156 [ -e /usr/lib/firefox/plugins/$(basename $i) ] && continue
157 cp -a $i /usr/lib/firefox/plugins/
158 done
159 rm -rf /tmp/firefox-plugins-$$
160 }