#!/bin/sh
#
# ident "@(#)postinstall	1.2 07/09/03"

mozdir=$BASEDIR/sfw/lib/mozilla
installedchrometxt=$mozdir/chrome/installed-chrome.txt
chromerdf=$mozdir/chrome/chrome.rdf
overlayinfo=$mozdir/chrome/overlayinfo
compregdat=$mozdir/components/compreg.dat
xptidat=$mozdir/components/xpti.dat

ARCH=`uname -p`

cd $mozdir/chrome

# update installed-chrome.txt
rm -f $installedchrometxt
for i in `ls installed-chrome.txt.*`
do
	if [ -f "$i" ]
	then
		cat $i >> $installedchrometxt
	fi
done
installf $PKGINST $installedchrometxt f 0755 root sys

# update chrome.rdf, overlayinfo, xpti.dat and compreg.dat
/bin/rm -f $chromerdf
/bin/rm -rf $overlayinfo
/bin/rm -f $compregdat
/bin/rm -f $xptidat

if [ -f $installedchrometxt ] ; then
	LD_LIBRARY_PATH=$mozdir/:$mozdir/components
	MOZILLA_FIVE_HOME=$mozdir
	export LD_LIBRARY_PATH MOZILLA_FIVE_HOME
	$MOZILLA_FIVE_HOME/regchrome
fi

installf $PKGINST $chromerdf f 0755 root sys
installf $PKGINST $compregdat f 0755 root sys
installf $PKGINST $xptidat f 0755 root sys
installf -f $PKGINST

exit 0
