summaryrefslogtreecommitdiffstats
path: root/www/mozex/pkg-install.xpi
blob: cf216dc45c805db33a088d1c075cc4cafd14f08a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
#
# $FreeBSD$
#
# Date created:			  Mon Oct 27, 2003
# Whom:				  Thierry Thomas (<thierry@pompo.net>)
# Register the extension $1 in the chrome registry.

umask 022
PATH=/bin:/usr/bin

[ "x$1" = "x" ] && exit 1
[ "x$2" = "xPRE-INSTALL" ] && exit 0
[ "x$2" = "xDEINSTALL" ] && exit 0

PREFIX=${PKG_PREFIX:-/usr/X11R6}

# If this is an extension for firefox, PKGNAMESUFFIX has been set
PKG_NAME=${1%%-[0-9._]*}
PKG_ROOT=$(echo $PKG_NAME | sed 's/-firefox$//')
if [ $PKG_NAME = $PKG_ROOT ]; then
MOZBIN=mozilla-bin
else
MOZBIN=firefox-bin
fi

MOZDIR=`find $PREFIX/lib -name $MOZBIN -exec dirname {} \; | head -n 1`
REGXPCOM=$MOZDIR/regxpcom
REGCHROME=$MOZDIR/regchrome

if [ "x$2" = "xPOST-DEINSTALL" ]; then
	case $PKG_ROOT in
		fr-mozilla-flp|fr-firefox-flp)
			MODEXT="FR.jar fr-unix.jar"
			;;

		*)
			MODEXT=$PKG_ROOT
			;;
	esac
	# Removing definition of extension $MODEXT
	for mod in $MODEXT; do
		sed -i .bak -e "/$mod/d" $MOZDIR/chrome/installed-chrome.txt
	done
fi

echo "===>  Re-building Chrome's registry..."
rm -rf $MOZDIR/chrome/overlayinfo
rm -f $MOZDIR/chrome/*.rdf
mkdir -p $MOZDIR/chrome/overlayinfo
rm -f $MOZDIR/component.reg

LD_LIBRARY_PATH=$MOZDIR MOZILLA_FIVE_HOME=$MOZDIR $MOZDIR/regxpcom || true
LD_LIBRARY_PATH=$MOZDIR MOZILLA_FIVE_HOME=$MOZDIR $MOZDIR/regchrome || true

if [ -d "$MOZDIR/searchplugins" ]; then
	chmod -R u+w "$MOZDIR/searchplugins"
fi
#touch $MOZDIR/chrome/user-skins.rdf $MOZDIR/chrome/user-locales.rdf

[ "x$2" = "xPOST-INSTALL" ] || rm $MOZDIR/chrome/installed-chrome.txt.bak

exit 0
OpenPOWER on IntegriCloud