%dirs%
usr/share/doc-base
usr/share/info
/usr/share/doc/cfengine-doc
%postinst%
#! /bin/sh -e

case "$1" in
    configure)
        if command -v install-docs >/dev/null 2>&1; then
            echo -n "Registering Cfengine documentation..."
            install-docs -i /usr/share/doc-base/cfengine-tutorial
            install-docs -i /usr/share/doc-base/cfengine-reference
            echo "done."
        fi
	install-info --quiet \
		--description="GNU Cfengine Reference." \
		--section "Admin" '[Aa]dmin.*' \
		/usr/share/info/cfengine-Reference.info.gz
	install-info --quiet \
		--description="GNU Cfengine Tutorial." \
		--section "Admin" '[Aa]dmin.*' \
		/usr/share/info/cfengine-Tutorial.info.gz
    ;;
esac

#DEBHELPER#
%prerm%
#!/bin/sh -e

case "$1" in
    remove|deconfigure|upgrade)
        if command -v install-docs >/dev/null 2>&1; then
            echo -n "Unregistering Cfengine documentation..."
            install-docs -r cfengine-tutorial || true
            install-docs -r cfengine-reference || true
            echo "done."
        fi
	install-info --quiet --remove \
		/usr/share/info/cfengine-Reference.info.gz
	install-info --quiet --remove \
		/usr/share/info/cfengine-Tutorial.info.gz
    ;;
esac

#DEBHELPER#
