tags 681147 patch
thanks

Hi,

Directories in /usr/share/doc can only be symlinks for packages
depending on the package they link to. (Policy 12.5)
This source package builds six sets of packages that can all be
installed independently (libmilter1.0.1, rmail, sendmail-base,
sendmail-cf, sendmail-doc, sensible-mda and respective dependencies).
So using symlinks at all is not practicable.

Attached is a debdiff that makes all /usr/share/doc/package directories
real directories with the mandatory files (they were already shipped in
all packages, so there were files in /usr/share/doc/sendmail that were
overwritten by each package). Additional documentation is put into
/usr/share/doc/sendmail-doc and libmilter gets its own README.Debian
into /usr/share/doc/libmilter-dev.

Note that 'debian/rules congfigure' is called during build and rewrites
a lot of stuff in debian/. I don't know why all the generated files that
are rewritten anyway are present in the package, but this minimal patch
only changes the sources of the maintainer scripts.

Best regards,
Tobias Hansen
diff -u sendmail-8.14.4/debian/changelog sendmail-8.14.4/debian/changelog
--- sendmail-8.14.4/debian/changelog
+++ sendmail-8.14.4/debian/changelog
@@ -1,3 +1,20 @@
+sendmail (8.14.4-2.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Directories in /usr/share/doc can only be symlinks for packages
+    depending on the package they link to. (Policy 12.5)
+    This source package builds six sets of packages that can all be
+    installed independently (libmilter1.0.1, rmail, sendmail-base,
+    sendmail-cf, sendmail-doc, sensible-mda and respective dependencies).
+    So using symlinks at all is not practicable.
+    Make all /usr/share/doc/package directories real directories and 
+    ship mandatory files (they were already shipped in all packages).
+    Put additional documentation into /usr/share/doc/sendmail-doc
+    and libmilters README.Debian into /usr/share/doc/libmilter-dev.
+    Closes: #681147
+
+ -- Tobias Hansen <tobias....@gmx.de>  Sun, 12 Aug 2012 12:52:06 +0200
+
 sendmail (8.14.4-2.1) unstable; urgency=low
 
   * Non-maintainer upload
diff -u sendmail-8.14.4/debian/rules sendmail-8.14.4/debian/rules
--- sendmail-8.14.4/debian/rules
+++ sendmail-8.14.4/debian/rules
@@ -372,7 +372,7 @@
        # libmilter-dev package
        if [ -d ${DEB_SRCDIR}/libmilter ]; then \
                $(INSTALL_DATA) debian/README.Debian.libmilter-dev \
-                       ${PKG_DOC}/libmilter/README.Debian; \
+                       
debian/libmilter-dev${docdir}/libmilter-dev/README.Debian; \
                $(INSTALL_DATA) ${DEB_SRCDIR}/libmilter/README \
                        ${PKG_DOC}/libmilter/README; \
                cp -a ${DEB_SRCDIR}/libmilter/docs/* \
diff -u sendmail-8.14.4/debian/README.Debian.libmilter-dev 
sendmail-8.14.4/debian/README.Debian.libmilter-dev
--- sendmail-8.14.4/debian/README.Debian.libmilter-dev
+++ sendmail-8.14.4/debian/README.Debian.libmilter-dev
@@ -9,7 +9,7 @@
 list (comp.mail.sendmail) does help if you have questions/problems.
 
 Everything you'll need to create a milter filter is contained in
-/usr/share/doc/sendmail (for which you need to install sendmail-doc):
+/usr/share/doc/sendmail-doc (for which you need to install sendmail-doc):
 
   - libmilter/README  Document on build/install/config for milter
                       NOTE: see updated make in milter directory
diff -u sendmail-8.14.4/debian/Debian-specific 
sendmail-8.14.4/debian/Debian-specific
--- sendmail-8.14.4/debian/Debian-specific
+++ sendmail-8.14.4/debian/Debian-specific
@@ -1,5 +1,6 @@
-Please take a gander at /usr/share/doc/sendmail/sendmail/README.Debian.gz -
-it has a quick overview of important matters.
+Please take a gander at /usr/share/doc/sendmail-doc/sendmail/README.Debian.gz 
+(for which you need to install sendmail-doc)
+ - it has a quick overview of important matters.
 
 Changes:       Items that cause a functional difference in the way
                sendmail works.
diff -u sendmail-8.14.4/debian/build/debian/libmilter-dev.preinst.in 
sendmail-8.14.4/debian/build/debian/libmilter-dev.preinst.in
--- sendmail-8.14.4/debian/build/debian/libmilter-dev.preinst.in
+++ sendmail-8.14.4/debian/build/debian/libmilter-dev.preinst.in
@@ -18,31 +18,15 @@
 PACKAGE=libmilter-dev;
 
 case "$1" in
-       install)
-               # DPKG doesn't overwrite directories with symlinks...
-               if [ -d @docdir@/$PACKAGE ]; then
-                       rm -rf @docdir@/$PACKAGE;
-                       fi;
-               if [ ! -d @docdir@/sendmail ]; then
-                       mkdir -p @docdir@/sendmail;
-                       chmod a+rx @docdir@/sendmail;
-                       fi;
-               ln -sf sendmail @docdir@/$PACKAGE;
-               ;;
-
        upgrade)
-               # DPKG doesn't overwrite directories with symlinks...
-               if [ -d @docdir@/$PACKAGE ]; then
-                       rm -rf @docdir@/$PACKAGE;
-                       fi;
-               if [ ! -d @docdir@/sendmail ]; then
-                       mkdir -p @docdir@/sendmail;
-                       chmod a+rx @docdir@/sendmail;
+               if dpkg --compare-versions "$2" le "8.14.4-2.1"; then
+                       # /usr/share/doc/$PACKAGE is a symlink to 
/usr/share/doc/sendmail
+                       rm -f @docdir@/$PACKAGE 2>/dev/null || true;
+                       rmdir @docdir@/sendmail 2>/dev/null || true;
                        fi;
-               ln -sf sendmail @docdir@/$PACKAGE;
                ;;
 
-       abort-upgrade)
+       install|abort-upgrade)
                ;;
 
        *)
diff -u sendmail-8.14.4/debian/build/debian/sendmail-bin.dirs.in 
sendmail-8.14.4/debian/build/debian/sendmail-bin.dirs.in
--- sendmail-8.14.4/debian/build/debian/sendmail-bin.dirs.in
+++ sendmail-8.14.4/debian/build/debian/sendmail-bin.dirs.in
@@ -4,7 +4,7 @@
 .@bindir@
 .@sbindir@
 .@libexecdir@
-.@docdir@/sendmail
+.@docdir@/sendmail-bin
 .@mandir@
 .@mandir@/man1
 .@mandir@/man5
diff -u sendmail-8.14.4/debian/build/debian/sendmail-doc.preinst.in 
sendmail-8.14.4/debian/build/debian/sendmail-doc.preinst.in
--- sendmail-8.14.4/debian/build/debian/sendmail-doc.preinst.in
+++ sendmail-8.14.4/debian/build/debian/sendmail-doc.preinst.in
@@ -18,31 +18,15 @@
 PACKAGE=sendmail-doc;
 
 case "$1" in
-       install)
-               # DPKG doesn't overwrite directories with symlinks...
-               if [ -d @docdir@/$PACKAGE ]; then
-                       rm -rf @docdir@/$PACKAGE;
-                       fi;
-               if [ ! -d @docdir@/sendmail ]; then
-                       mkdir -p @docdir@/sendmail;
-                       chmod a+rx @docdir@/sendmail;
-                       fi;
-               ln -sf sendmail @docdir@/$PACKAGE;
-               ;;
-
        upgrade)
-               # DPKG doesn't overwrite directories with symlinks...
-               if [ -d @docdir@/$PACKAGE ]; then
-                       rm -rf @docdir@/$PACKAGE;
-                       fi;
-               if [ ! -d @docdir@/sendmail ]; then
-                       mkdir -p @docdir@/sendmail;
-                       chmod a+rx @docdir@/sendmail;
+               if dpkg --compare-versions "$2" le "8.14.4-2.1"; then
+                       # /usr/share/doc/$PACKAGE is a symlink to 
/usr/share/doc/sendmail
+                       rm -f @docdir@/$PACKAGE 2>/dev/null || true;
+                       rmdir @docdir@/sendmail 2>/dev/null || true;
                        fi;
-               ln -sf sendmail @docdir@/$PACKAGE;
                ;;
 
-       abort-upgrade)
+       install|abort-upgrade)
                ;;
 
        *)
diff -u sendmail-8.14.4/debian/build/debian/rmail.preinst.in 
sendmail-8.14.4/debian/build/debian/rmail.preinst.in
--- sendmail-8.14.4/debian/build/debian/rmail.preinst.in
+++ sendmail-8.14.4/debian/build/debian/rmail.preinst.in
@@ -18,31 +18,15 @@
 PACKAGE=rmail;
 
 case "$1" in
-       install)
-               # DPKG doesn't overwrite directories with symlinks...
-               if [ -d @docdir@/$PACKAGE ]; then
-                       rm -rf @docdir@/$PACKAGE;
-                       fi;
-               if [ ! -d @docdir@/sendmail ]; then
-                       mkdir -p @docdir@/sendmail;
-                       chmod a+rx @docdir@/sendmail;
-                       fi;
-               ln -sf sendmail @docdir@/$PACKAGE;
-               ;;
-
        upgrade)
-               # DPKG doesn't overwrite directories with symlinks...
-               if [ -d @docdir@/$PACKAGE ]; then
-                       rm -rf @docdir@/$PACKAGE;
-                       fi;
-               if [ ! -d @docdir@/sendmail ]; then
-                       mkdir -p @docdir@/sendmail;
-                       chmod a+rx @docdir@/sendmail;
+               if dpkg --compare-versions "$2" le "8.14.4-2.1"; then
+                       # /usr/share/doc/$PACKAGE is a symlink to 
/usr/share/doc/sendmail
+                       rm -f @docdir@/$PACKAGE 2>/dev/null || true;
+                       rmdir @docdir@/sendmail 2>/dev/null || true;
                        fi;
-               ln -sf sendmail @docdir@/$PACKAGE;
                ;;
 
-       abort-upgrade)
+       install|abort-upgrade)
                ;;
 
        *)
reverted:
--- sendmail-8.14.4/debian/build/debian/rmail.postrm.in
+++ sendmail-8.14.4.orig/debian/build/debian/rmail.postrm.in
@@ -1,53 +0,0 @@
-#!/bin/sh -e
-#
-# Debian post removal script
-#
-# Install of already installed package:
-#      1) Upgrade of package:
-#              new-preinst upgrade old-version
-#              *) new-postrm abort-upgrade old-version
-#      2) package had some configuration files from a previous version 
installed
-#              new-preinst install old-version
-#              *) new-postrm abort-install old-version
-#      3) Otherwise (i.e., the package was completely purged)
-#              new-preinst install
-#              *) new-postrm abort-install
-#
-# Removal of a package:
-#      1) prerm remove
-#      2) The package's files are removed (except conffiles).
-#      3) postrm remove
-#      4) All the maintainer scripts except the postrm are removed.
-#      5) The conffiles and any backup files
-#              (~-files, #*# files, %-files, .dpkg-{old,new,tmp}, etc.) are 
removed.
-#      6) postrm purge
-#      7) The package's file list is removed
-#
-set -e;
-
-PACKAGE=rmail;
-
-case "$1" in
-       remove)
-               # /usr/share/doc/$PACKAGE is a symlink to 
/usr/share/doc/sendmail
-               rm -f @docdir@/$PACKAGE 2>/dev/null || true;
-               rmdir @docdir@/sendmail 2>/dev/null || true;
-               ;;
-
-       purge)
-               ;;
-
-       upgrade)
-               ;;
-
-       failed-upgrade|abort-install|abort-upgrade|disappear)
-               ;;
-
-       *)
-               echo "$PACKAGE postrm called with unknown argument \`$1'" >&2;
-               exit 1;
-               ;;
-       esac;
-
-#DEBHELPER#
-exit 0;
reverted:
--- sendmail-8.14.4/debian/build/debian/sendmail-doc.postrm.in
+++ sendmail-8.14.4.orig/debian/build/debian/sendmail-doc.postrm.in
@@ -1,53 +0,0 @@
-#!/bin/sh -e
-#
-# Debian post removal script
-#
-# Install of already installed package:
-#      1) Upgrade of package:
-#              new-preinst upgrade old-version
-#              *) new-postrm abort-upgrade old-version
-#      2) package had some configuration files from a previous version 
installed
-#              new-preinst install old-version
-#              *) new-postrm abort-install old-version
-#      3) Otherwise (i.e., the package was completely purged)
-#              new-preinst install
-#              *) new-postrm abort-install
-#
-# Removal of a package:
-#      1) prerm remove
-#      2) The package's files are removed (except conffiles).
-#      3) postrm remove
-#      4) All the maintainer scripts except the postrm are removed.
-#      5) The conffiles and any backup files
-#              (~-files, #*# files, %-files, .dpkg-{old,new,tmp}, etc.) are 
removed.
-#      6) postrm purge
-#      7) The package's file list is removed
-#
-set -e;
-
-PACKAGE=sendmail-doc;
-
-case "$1" in
-       remove)
-               # /usr/share/doc/$PACKAGE is a symlink to 
/usr/share/doc/sendmail
-               rm -f @docdir@/$PACKAGE 2>/dev/null || true;
-               rmdir @docdir@/sendmail 2>/dev/null || true;
-               ;;
-
-       purge)
-               ;;
-
-       upgrade)
-               ;;
-
-       failed-upgrade|abort-install|abort-upgrade|disappear)
-               ;;
-
-       *)
-               echo "$PACKAGE postrm called with unknown argument \`$1'" >&2;
-               exit 1;
-               ;;
-       esac;
-
-#DEBHELPER#
-exit 0;
reverted:
--- sendmail-8.14.4/debian/build/debian/sensible-mda.postrm.in
+++ sendmail-8.14.4.orig/debian/build/debian/sensible-mda.postrm.in
@@ -1,53 +0,0 @@
-#!/bin/sh -e
-#
-# Debian post removal script
-#
-# Install of already installed package:
-#      1) Upgrade of package:
-#              new-preinst upgrade old-version
-#              *) new-postrm abort-upgrade old-version
-#      2) package had some configuration files from a previous version 
installed
-#              new-preinst install old-version
-#              *) new-postrm abort-install old-version
-#      3) Otherwise (i.e., the package was completely purged)
-#              new-preinst install
-#              *) new-postrm abort-install
-#
-# Removal of a package:
-#      1) prerm remove
-#      2) The package's files are removed (except conffiles).
-#      3) postrm remove
-#      4) All the maintainer scripts except the postrm are removed.
-#      5) The conffiles and any backup files
-#              (~-files, #*# files, %-files, .dpkg-{old,new,tmp}, etc.) are 
removed.
-#      6) postrm purge
-#      7) The package's file list is removed
-#
-set -e;
-
-PACKAGE=sensible-mda;
-
-case "$1" in
-       remove)
-               # /usr/share/doc/$PACKAGE is a symlink to 
/usr/share/doc/sendmail
-               rm -f @docdir@/$PACKAGE 2>/dev/null || true;
-               rmdir @docdir@/sendmail 2>/dev/null || true;
-               ;;
-
-       purge)
-               ;;
-
-       upgrade)
-               ;;
-
-       failed-upgrade|abort-install|abort-upgrade|disappear)
-               ;;
-
-       *)
-               echo "$PACKAGE postrm called with unknown argument \`$1'" >&2;
-               exit 1;
-               ;;
-       esac;
-
-#DEBHELPER#
-exit 0;
diff -u sendmail-8.14.4/debian/build/debian/sendmail-base.preinst.in 
sendmail-8.14.4/debian/build/debian/sendmail-base.preinst.in
--- sendmail-8.14.4/debian/build/debian/sendmail-base.preinst.in
+++ sendmail-8.14.4/debian/build/debian/sendmail-base.preinst.in
@@ -18,29 +18,13 @@
 PACKAGE=sendmail-base;
 
 case "$1" in
-       install)
-               # DPKG doesn't overwrite directories with symlinks...
-               rm -rf @docdir@/sendmail/examples 2>/dev/null || true;
-               if [ -d @docdir@/$PACKAGE ]; then
-                       rm -rf @docdir@/$PACKAGE;
-                       fi;
-               if [ ! -d @docdir@/sendmail ]; then
-                       mkdir -p @docdir@/sendmail;
-                       chmod a+rx @docdir@/sendmail;
-                       fi;
-               ln -sf sendmail @docdir@/$PACKAGE;
-               ;;
-
        upgrade)
-               # DPKG doesn't overwrite directories with symlinks...
-               if [ -d @docdir@/$PACKAGE ]; then
-                       rm -rf @docdir@/$PACKAGE;
-                       fi;
-               if [ ! -d @docdir@/sendmail ]; then
-                       mkdir -p @docdir@/sendmail;
-                       chmod a+rx @docdir@/sendmail;
+               if dpkg --compare-versions "$2" le "8.14.4-2.1"; then
+                       # /usr/share/doc/$PACKAGE is a symlink to 
/usr/share/doc/sendmail
+                       rm -f @docdir@/$PACKAGE 2>/dev/null || true;
+                       rm -rf @docdir@/sendmail/examples 2>/dev/null || true;
+                       rmdir @docdir@/sendmail 2>/dev/null || true;
                        fi;
-               ln -sf sendmail @docdir@/$PACKAGE;
 
                # Prevent cronjob from running during upgrade...
                if [ -f @sysconfdir@/cron.d/sendmail ]; then
@@ -53,7 +37,7 @@
                        fi;
                ;;
 
-       abort-upgrade)
+       install|abort-upgrade)
                ;;
 
        *)
diff -u sendmail-8.14.4/debian/build/debian/libmilter.preinst.in 
sendmail-8.14.4/debian/build/debian/libmilter.preinst.in
--- sendmail-8.14.4/debian/build/debian/libmilter.preinst.in
+++ sendmail-8.14.4/debian/build/debian/libmilter.preinst.in
@@ -18,31 +18,15 @@
 PACKAGE=libmilter@sm_libmilter_version@;
 
 case "$1" in
-       install)
-               # DPKG doesn't overwrite directories with symlinks...
-               if [ -d @docdir@/$PACKAGE ]; then
-                       rm -rf @docdir@/$PACKAGE;
-                       fi;
-               if [ ! -d @docdir@/sendmail ]; then
-                       mkdir -p @docdir@/sendmail;
-                       chmod a+rx @docdir@/sendmail;
-                       fi;
-               ln -sf sendmail @docdir@/$PACKAGE;
-               ;;
-
        upgrade)
-               # DPKG doesn't overwrite directories with symlinks...
-               if [ -d @docdir@/$PACKAGE ]; then
-                       rm -rf @docdir@/$PACKAGE;
-                       fi;
-               if [ ! -d @docdir@/sendmail ]; then
-                       mkdir -p @docdir@/sendmail;
-                       chmod a+rx @docdir@/sendmail;
+               if dpkg --compare-versions "$2" le "8.14.4-2.1"; then
+                       # /usr/share/doc/$PACKAGE is a symlink to 
/usr/share/doc/sendmail
+                       rm -f @docdir@/$PACKAGE 2>/dev/null || true;
+                       rmdir @docdir@/sendmail 2>/dev/null || true;
                        fi;
-               ln -sf sendmail @docdir@/$PACKAGE;
                ;;
 
-       abort-upgrade)
+       install|abort-upgrade)
                ;;
 
        *)
diff -u sendmail-8.14.4/debian/build/debian/sendmail-base.postrm.in 
sendmail-8.14.4/debian/build/debian/sendmail-base.postrm.in
--- sendmail-8.14.4/debian/build/debian/sendmail-base.postrm.in
+++ sendmail-8.14.4/debian/build/debian/sendmail-base.postrm.in
@@ -90,7 +90,6 @@
             ;
         rmdir   @sysconfdir@/mail/peers 2>/dev/null || true;
         rmdir   @sysconfdir@/mail 2>/dev/null || true;
-               rmdir   @docdir@/sendmail 2>/dev/null || true;
 
                ;;
 
diff -u sendmail-8.14.4/debian/build/debian/sendmail-cf.postrm.in 
sendmail-8.14.4/debian/build/debian/sendmail-cf.postrm.in
--- sendmail-8.14.4/debian/build/debian/sendmail-cf.postrm.in
+++ sendmail-8.14.4/debian/build/debian/sendmail-cf.postrm.in
@@ -29,10 +29,6 @@
 
 case "$1" in
        remove)
-               # /usr/share/doc/$PACKAGE is a symlink to 
/usr/share/doc/sendmail
-               rm -f @docdir@/$PACKAGE 2>/dev/null || true;
-               rmdir @docdir@/sendmail 2>/dev/null || true;
-
                # Make sure the data directory is *clean*
                rm -rf @datadir@/sendmail/cf
                ;;
diff -u sendmail-8.14.4/debian/build/debian/sensible-mda.preinst.in 
sendmail-8.14.4/debian/build/debian/sensible-mda.preinst.in
--- sendmail-8.14.4/debian/build/debian/sensible-mda.preinst.in
+++ sendmail-8.14.4/debian/build/debian/sensible-mda.preinst.in
@@ -18,31 +18,15 @@
 PACKAGE=sensible-mda;
 
 case "$1" in
-       install)
-               # DPKG doesn't overwrite directories with symlinks...
-               if [ -d @docdir@/$PACKAGE ]; then
-                       rm -rf @docdir@/$PACKAGE;
-                       fi;
-               if [ ! -d @docdir@/sendmail ]; then
-                       mkdir -p @docdir@/sendmail;
-                       chmod a+rx @docdir@/sendmail;
-                       fi;
-               ln -sf sendmail @docdir@/$PACKAGE;
-               ;;
-
        upgrade)
-               # DPKG doesn't overwrite directories with symlinks...
-               if [ -d @docdir@/$PACKAGE ]; then
-                       rm -rf @docdir@/$PACKAGE;
-                       fi;
-               if [ ! -d @docdir@/sendmail ]; then
-                       mkdir -p @docdir@/sendmail;
-                       chmod a+rx @docdir@/sendmail;
+               if dpkg --compare-versions "$2" le "8.14.4-2.1"; then
+                       # /usr/share/doc/$PACKAGE is a symlink to 
/usr/share/doc/sendmail
+                       rm -f @docdir@/$PACKAGE 2>/dev/null || true;
+                       rmdir @docdir@/sendmail 2>/dev/null || true;
                        fi;
-               ln -sf sendmail @docdir@/$PACKAGE;
                ;;
 
-       abort-upgrade)
+       install|abort-upgrade)
                ;;
 
        *)
reverted:
--- sendmail-8.14.4/debian/build/debian/libmilter-dev.postrm.in
+++ sendmail-8.14.4.orig/debian/build/debian/libmilter-dev.postrm.in
@@ -1,53 +0,0 @@
-#!/bin/sh -e
-#
-# Debian post removal script
-#
-# Install of already installed package:
-#      1) Upgrade of package:
-#              new-preinst upgrade old-version
-#              *) new-postrm abort-upgrade old-version
-#      2) package had some configuration files from a previous version 
installed
-#              new-preinst install old-version
-#              *) new-postrm abort-install old-version
-#      3) Otherwise (i.e., the package was completely purged)
-#              new-preinst install
-#              *) new-postrm abort-install
-#
-# Removal of a package:
-#      1) prerm remove
-#      2) The package's files are removed (except conffiles).
-#      3) postrm remove
-#      4) All the maintainer scripts except the postrm are removed.
-#      5) The conffiles and any backup files
-#              (~-files, #*# files, %-files, .dpkg-{old,new,tmp}, etc.) are 
removed.
-#      6) postrm purge
-#      7) The package's file list is removed
-#
-set -e;
-
-PACKAGE=libmilter-dev;
-
-case "$1" in
-       remove)
-               # /usr/share/doc/$PACKAGE is a symlink to 
/usr/share/doc/sendmail
-               rm -f @docdir@/$PACKAGE 2>/dev/null || true;
-               rmdir @docdir@/sendmail 2>/dev/null || true;
-               ;;
-
-       purge)
-               ;;
-
-       upgrade)
-               ;;
-
-       failed-upgrade|abort-install|abort-upgrade|disappear)
-               ;;
-
-       *)
-               echo "$PACKAGE postrm called with unknown argument \`$1'" >&2;
-               exit 1;
-               ;;
-       esac;
-
-#DEBHELPER#
-exit 0;
reverted:
--- sendmail-8.14.4/debian/build/debian/libmilter.postrm.in
+++ sendmail-8.14.4.orig/debian/build/debian/libmilter.postrm.in
@@ -1,53 +0,0 @@
-#!/bin/sh -e
-#
-# Debian post removal script
-#
-# Install of already installed package:
-#      1) Upgrade of package:
-#              new-preinst upgrade old-version
-#              *) new-postrm abort-upgrade old-version
-#      2) package had some configuration files from a previous version 
installed
-#              new-preinst install old-version
-#              *) new-postrm abort-install old-version
-#      3) Otherwise (i.e., the package was completely purged)
-#              new-preinst install
-#              *) new-postrm abort-install
-#
-# Removal of a package:
-#      1) prerm remove
-#      2) The package's files are removed (except conffiles).
-#      3) postrm remove
-#      4) All the maintainer scripts except the postrm are removed.
-#      5) The conffiles and any backup files
-#              (~-files, #*# files, %-files, .dpkg-{old,new,tmp}, etc.) are 
removed.
-#      6) postrm purge
-#      7) The package's file list is removed
-#
-set -e;
-
-PACKAGE=libmilter@sm_libmilter_version@;
-
-case "$1" in
-       remove)
-               # /usr/share/doc/$PACKAGE is a symlink to 
/usr/share/doc/sendmail
-               rm -f @docdir@/$PACKAGE 2>/dev/null || true;
-               rmdir @docdir@/sendmail 2>/dev/null || true;
-               ;;
-
-       purge)
-               ;;
-
-       upgrade)
-               ;;
-
-       failed-upgrade|abort-install|abort-upgrade|disappear)
-               ;;
-
-       *)
-               echo "$PACKAGE postrm called with unknown argument \`$1'" >&2;
-               exit 1;
-               ;;
-       esac;
-
-#DEBHELPER#
-exit 0;
diff -u sendmail-8.14.4/debian/build/debian/sendmail-cf.preinst.in 
sendmail-8.14.4/debian/build/debian/sendmail-cf.preinst.in
--- sendmail-8.14.4/debian/build/debian/sendmail-cf.preinst.in
+++ sendmail-8.14.4/debian/build/debian/sendmail-cf.preinst.in
@@ -18,31 +18,15 @@
 PACKAGE=sendmail-cf;
 
 case "$1" in
-       install)
-               # DPKG doesn't overwrite directories with symlinks...
-               if [ -d @docdir@/$PACKAGE ]; then
-                       rm -rf @docdir@/$PACKAGE;
-                       fi;
-               if [ ! -d @docdir@/sendmail ]; then
-                       mkdir -p @docdir@/sendmail;
-                       chmod a+rx @docdir@/sendmail;
-                       fi;
-               ln -sf sendmail @docdir@/$PACKAGE;
-               ;;
-
        upgrade)
-               # DPKG doesn't overwrite directories with symlinks...
-               if [ -d @docdir@/$PACKAGE ]; then
-                       rm -rf @docdir@/$PACKAGE;
-                       fi;
-               if [ ! -d @docdir@/sendmail ]; then
-                       mkdir -p @docdir@/sendmail;
-                       chmod a+rx @docdir@/sendmail;
+               if dpkg --compare-versions "$2" le "8.14.4-2.1"; then
+                       # /usr/share/doc/$PACKAGE is a symlink to 
/usr/share/doc/sendmail
+                       rm -f @docdir@/$PACKAGE 2>/dev/null || true;
+                       rmdir @docdir@/sendmail 2>/dev/null || true;
                        fi;
-               ln -sf sendmail @docdir@/$PACKAGE;
                ;;
 
-       abort-upgrade)
+       install|abort-upgrade)
                ;;
 
        *)

Reply via email to