#! /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 netscape3' and reinstall this package.\n";
    print "  You will need the original ==VERSION== source archive from Netscape to do\n";
    print "  this.  Place the source archive in $tmp.\n";
    exit 1;
}


#
# Fix mistakes from previous releases
#
chmod 03775,		"/var/spool/mail";
chown 0, $mail_gid,	"/usr/lib/netscape/movemail";
chmod 02755,		"/usr/lib/netscape/movemail";
rename("/usr/doc/netscape/Copyright","/usr/doc/netscape/copyright");
if (-f "/usr/X11R6/lib/X11/app-defaults/Netscape") {
    system "gzip -9 </usr/X11R6/lib/X11/app-defaults/Netscape >/usr/doc/netscape/app-defaults.gz";
    chmod 0644,"/usr/doc/netscape/app-defaults.gz";
    unlink "/usr/X11R6/lib/X11/app-defaults/Netscape";
}


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