Manage /etc/sgml
 - create in postinstall, if necessary
 - remove in postrm purge, if empty
--- a/autoscripts/postinst-sgmlcatalog
+++ b/autoscripts/postinst-sgmlcatalog
@@ -1,4 +1,10 @@
 if [ "$1" = "configure" ]; then
+
+	if [ ! -d /etc/sgml ] ;
+	then
+		install -d -m755 /etc/sgml
+	fi
+
 	rm -f #CENTRALCAT#
 	for ordcat in #ORDCATS#; do
 		update-catalog --quiet --add #CENTRALCAT# ${ordcat}
--- a/autoscripts/postrm-sgmlcatalog
+++ b/autoscripts/postrm-sgmlcatalog
@@ -1,3 +1,5 @@
 if [ "$1" = "purge" ]; then
 	rm -f #CENTRALCAT# #CENTRALCAT#.old
+
+	[ -d /etc/sgml ] && rmdir --ignore-fail-on-non-empty /etc/sgml
 fi
--- a/dh_installcatalogs
+++ b/dh_installcatalogs
@@ -92,10 +92,6 @@
 	if (@sgmlinstalled) {
 		addsubstvar($package, "misc:Depends", "sgml-base", ">= $sgmlbasever");
 
-		if (! -d "$tmpdir/etc/sgml") {
-			doit("install","-d","-m755","$tmpdir/etc/sgml");
-		}
-
 		if (! $dh{NOSCRIPTS}) {
 			my $ordcats = join(" ", @sgmlinstalled);
 			my $centralcat = "/etc/sgml/$package.cat";
