#!/bin/bash

# Debconf config script for Drupal

set -e


# Source debconf library
. /usr/share/debconf/confmodule

if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
	# we support mysql and pgsql
	dbc_dbtypes="mysql, pgsql"
	dbc_dbname=drupal5
	dbc_dbuser=drupal5

	# source dbconfig-common stuff
	. /usr/share/dbconfig-common/dpkg/config
	dbc_go drupal5 $@
fi

if [ "$DPKG_DEBUG" = "developer" ]; then
    set -x
fi
 
##################################################
# Begin installation directories definition block#
##################################################
package_name="drupal5"
datadir="/var/lib/${package_name}"
backupdir="${datadir}/backups/"
docdir="/usr/share/doc/${package_name}"
upgradesdir="${docdir}/upgrades"
configdir="/etc/drupal/5"
configfile="${configdir}/conf.php"
includefile="${configdir}/apache.conf"
################################################
# End installation directories definition block #
################################################

########################################################################
# The actual configuration

OLDVERSION="$2"

db_input "high" "${package_name}/webserver" || true
db_go || true

db_stop

exit 0
