#! /bin/bash -e
#
# Debian postinst script for Python 1.5 hierarchical modules
# Written by Gregor Hoffleit <flight@debian.org>
#
# Modified for gnats2w by Milan Zamazal <pdm@debian.org>

NAME=gnats2w
DIRLIST="/usr/lib/python1.5/site-packages/gnats2w"

case "$1" in
    configure|abort-upgrade|abort-remove|abort-deconfigure)
        for i in $DIRLIST ; do
            python -O /usr/lib/python1.5/compileall.py -q $i
            python /usr/lib/python1.5/compileall.py -q $i
        done

#    	if command -v install-docs >/dev/null 2>&1; then
#    	    install-docs -i /usr/doc/$NAME
#    	fi
    ;;

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

if [ "$1" = configure ]; then
    ln -s /usr/share/doc/gnats2w/online /var/www/gnats2w
fi

if [ "$1" = configure ]; then
  install-info --description='gnats2w.  Yet another Web interface to GNATS' \
	       --section Devel Development --quiet /usr/share/info/gnats2w.info
fi

#DEBHELPER#
