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

set -e

case "$1" in
    configure)
	if command -v install-docs > /dev/null 2>&1; then
		install-docs --install /usr/share/doc-base/perl-policy
	fi
	# install compatibility symlink for the move from FSSTD to FHS
	if [ -d /usr/doc ]; then
	    # deal with cruft from bad prerm
	    if [ -d /usr/doc/perl-5.005-doc -a -d /usr/doc/perl-5.005-doc/perl-policy ]; then
	    # these should never fail
		echo "Removing cruft from bad prerm.  Nothing to see.  Move along."
		rm    /usr/doc/perl-5.005-doc/perl-policy/.dhelp || true
		rmdir /usr/doc/perl-5.005-doc/perl-policy /usr/doc/perl-5.005-doc || true
	    fi
	    # end of cruft removal
	    if [ ! -e /usr/doc/perl-5.005-doc -a -d /usr/share/doc/perl-5.005-doc ]; then
                ln -s ../share/doc/perl-5.005-doc /usr/doc/perl-5.005-doc
	    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-doc.postinst
