summaryrefslogtreecommitdiffstats
path: root/www/mozex/pkg-install.xpi
blob: 511847138987dc052df34f711822f4b1150e9329 (plain) (blame)
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
#!/bin/sh
#
# $FreeBSD$
#
# Date created:           Mon Oct 27, 2003
# Whom:               Thierry Thomas (<thierry@pompo.net>)
# Register the extension $1 in the chrome registry for the browser %%GECKO%%.

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/local}

PKG_NAME=${1%%-[0-9._]*}

MOZDIR=$PREFIX/lib/%%GECKO%%
REGXPCOM=$MOZDIR/regxpcom
REGCHROME=$MOZDIR/regchrome

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

        *)
            MODEXT=$PKG_NAME
            ;;
    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