1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-12 03:00:28 +00:00
freebsd-ports/www/mozex/pkg-install.xpi
Thierry Thomas b69efdeb14 Fix plist.
Reported by:	Kris / pointyhat.
2005-01-20 22:23:18 +00:00

64 lines
1.5 KiB
Bash

#!/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