#!/bin/sh
#
# This is the postinst script for the Debian GNU/Linux apmd package
#
# Written by Dirk Eddelbuettel <edd@debian.org>   

# Automatically added by dh_installdocs
if [ "$1" = "configure" ]; then
	if [ -d /usr/doc -a ! -e /usr/doc/apmd -a -d /usr/share/doc/apmd ]; then
		ln -sf ../share/doc/apmd /usr/doc/apmd
	fi
fi
# End automatically added section
# Automatically added by dh_installxaw
if test -x /usr/sbin/update-xaw-wrappers; then
	/usr/sbin/update-xaw-wrappers
fi
for opts in '/usr/bin/xapm xapm /usr/bin/xapm.real'; do
	update-alternatives --quiet --install $opts 25
done	
# End automatically added section


set -e 

if [ ! -e /proc/apm ]
then
    echo    ""
    echo -n "The apmd package requires kernel support which is missing "
    echo    "from the kernel"
    echo -n "that is currently running. You need to recompile your kernel "
    echo    "to use apmd."
    echo    ""
fi

case "$1" in
    configure)
	update-rc.d apmd defaults >/dev/null

	/etc/init.d/apmd start
	;;
    abort-upgrade|abort-remove|abort-deconfigure)
	exit 0
	;;
    *)
	echo "postinst called with unknown argument \`$1'" >&2
	exit 0
	;;
esac




