#! /usr/bin/perl


#
# See how we were called
#
$action = $ARGV[0];
exit 0 unless (($action eq "install" && $#ARGV > 0 ) || ($action eq "configure"));


#
# Gather some useful information
#
$mail_gid = (getgrnam ("mail"))[2];
$mail_gid = 8 unless $mail_gid;


#
# Find the tmp directory
#
if ( "$ENV{'TMPDIR'}" ne "") {
    $tmp = $ENV{'TMPDIR'};
} else {
    $tmp = "/tmp";
}


#
# Upgrades between different versions of this package are not allowed
#
if ( -f "/usr/lib/==PACKAGE==/netscape" && ! -f "/usr/doc/==PACKAGE==/Version-==VERSION==" ) {
    print "- This release is for a different version of netscape than the one installed.\n";
    print "  Please 'dpkg --purge ==PACKAGE====VERSION==' and reinstall this package.  You will\n";
    print "  need the original v==VERSION== communicator source archive from Netscape to\n";
    print "  do this.  Place the source archive in $tmp.\n";
    exit 1;
}


#
# Fix mistakes from previous releases
#
chmod 02775,		"/var/spool/mail";
chown 0, $mail_gid,	"/usr/lib/netscape/movemail";
chmod 02755,		"/usr/lib/netscape/movemail";


## local variables:
## tab-width: 8
## end:
