#! /bin/bash -e
#
# postinst script for Debian python packages.
# Written 1998 by Gregor Hoffleit <flight@debian.org>.
#

PACKAGE=gnue-common
DIRLIST="/usr/lib/gnue/lib/python/gnue"

case "$1" in
  configure|abort-upgrade|abort-remove|abort-deconfigure)

    # byte-compile the Python source files
    for i in $DIRLIST ; do
	/usr/bin/python2.1 /usr/lib/python2.1/compileall.py -q $i
    done

    # If we don't have a connections.conf, create one from the template
    if [ ! -f /etc/gnue/connections.conf ]; then
	cp /etc/gnue/sample.connections.conf /etc/gnue/connections.conf
    fi
    ;;

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

#DEBHELPER#

exit 0
