#! /usr/bin/perl


#
# 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/X11R6/bin/netscape" && ! -f "/usr/doc/netscape/Version-==VERSION==" ) {
    print "- This release is for a different version of netscape than the one installed.\n";
    print "  Please 'dpkg --purge netscape' and reinstall this package.  You will\n";
    print "  need the original ==VERSION== source archive from Netscape to do this.  Place\n";
    print "  the source archive in $tmp.\n";
    exit 1;
}


#
# Fix mistakes from previous releases
#
unlink "/usr/bin/netscape";
if (-l "/usr/X11") {
    unlink "/usr/X11";
}
chmod 03775,		"/var/spool/mail";
chown 0, $mail_gid,	"/usr/lib/netscape/movemail";
chmod 02755,		"/usr/lib/netscape/movemail";



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