#! /bin/sh
# perl-5.005-base.postinst - call after dpkg has unpacked
# written by Darren Stalder (whooptidoo!)
# $Id: base.postinst,v 1.4 1999/07/06 14:17:37 torin Exp torin $
#

set -e

case "$1" in
    configure)
	(cd /usr/bin; test -f perl-5.005.dist && (mv -f perl-5.005.dist perl-5.005))
	test -L /usr/bin/perl || rm -f /usr/bin/perl
	# handle old disk installs that used parts of Perl w/o dpkg.
	rm -f /usr/lib/perl5/IO/Handle.pm /usr/lib/perl5/DynaLoader.pm

	# from Raphael Hertzog <rhertzog@hrnet.fr>
	# perl isn't installed yet, so update-alternatives needs to be run 'by hand'
	update=`which update-alternatives`
	perl-5.005 ${update} --install /usr/bin/perl perl /usr/bin/perl-5.005 5005
	# In case update-alternatives changes the permission again
	chmod 0755 /usr/bin/perl-5.005

	# install compatibility symlink for the move from FSSTD to FHS
	if [ -d /usr/doc ]; then
	    if [ ! -e /usr/doc/perl-5.005-base -a -d /usr/share/doc/perl-5.005-base ]; then
                ln -s ../share/doc/perl-5.005-base /usr/doc/perl-5.005-base
	    fi
	fi
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

exit 0

#
# end of perl-5.005-base.postinst
