#!/bin/sh

. /usr/share/debconf/confmodule

if [ -f /usr/share/dbconfig-common/dpkg/postinst.pgsql ]; then
	. /usr/share/dbconfig-common/dpkg/postinst.pgsql
	dbc_go whatwhat $@

	if test -f /etc/dbconfig-common/whatwhat.conf; then
	    cat <<EOF > /var/cache/turbogears/whatwhat/prod.cfg
sqlobject.dburi="postgres://${dbc_dbuser}:${dbc_dbpass}@localhost:5432/${dbc_dbname}?cache="
EOF
	fi
fi

# Automatically added by dh_installinit
if [ -x "/etc/init.d/whatwhat" ]; then
	update-rc.d whatwhat defaults >/dev/null
	if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
		invoke-rc.d whatwhat start || exit $?
	else
		/etc/init.d/whatwhat start || exit $?
	fi
fi
# End automatically added section
# Automatically added by dh_pysupport
if [ "$1" = "configure" ] && which update-python-modules >/dev/null 2>&1; then
	update-python-modules -i /usr/share/python-support/whatwhat
fi
# End automatically added section

