#! /bin/sh
# preinst script for apache
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>

case "$1" in
    install|upgrade)

    # See which version was installed.

    if [ "$1" = install -o "$1" = upgrade ] && [ "$2" != "" ]
    then
	if [ ! -d /etc/apache -a -d /etc/httpd ]
	then
	    echo Copying existing configuration from "\`/etc/httpd'" to "\`/etc/apache'..."
	    mkdir -m 755 /etc/apache &&
		(cd /etc/httpd; tar cf - .) | (cd /etc/apache; tar xpf -)
	fi
    fi

    ;;

    abort-upgrade)
    ;;

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

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.



exit 0


