From 9b5080da9228d71649fb3979e9ee0164e013c880 Mon Sep 17 00:00:00 2001 From: Andreas Beckmann Date: Tue, 22 Oct 2013 00:42:22 +0200 Subject: move all control file templates to debian/ --- debian/build/debian/libmilter-dev.dirs.in | 4 - debian/build/debian/libmilter-dev.links.in | 2 - debian/build/debian/libmilter-dev.preinst.in | 14 -- debian/build/debian/libmilter.dirs.in | 2 - debian/build/debian/libmilter.preinst.in | 14 -- debian/build/debian/rmail.dirs.in | 3 - debian/build/debian/rmail.preinst.in | 14 -- debian/build/debian/sendmail-base.dirs.in | 56 ----- debian/build/debian/sendmail-base.postinst.in | 116 ---------- debian/build/debian/sendmail-base.postrm.in | 113 --------- debian/build/debian/sendmail-base.preinst.in | 59 ----- debian/build/debian/sendmail-base.prerm.in | 138 ----------- debian/build/debian/sendmail-bin.dirs.in | 12 - debian/build/debian/sendmail-bin.postinst.in | 320 -------------------------- debian/build/debian/sendmail-bin.postrm.in | 88 ------- debian/build/debian/sendmail-bin.preinst.in | 52 ----- debian/build/debian/sendmail-bin.prerm.in | 90 -------- debian/build/debian/sendmail-bin.suid.in | 2 - debian/build/debian/sendmail-cf.dirs.in | 11 - debian/build/debian/sendmail-cf.postrm.in | 52 ----- debian/build/debian/sendmail-cf.preinst.in | 14 -- debian/build/debian/sendmail-doc.dirs.in | 5 - debian/build/debian/sendmail-doc.preinst.in | 28 --- debian/build/debian/sendmail.cron.daily.in | 101 -------- debian/build/debian/sendmail.dirs.in | 1 - debian/build/debian/sendmail.init.d.in | 41 ---- debian/build/debian/sensible-mda.dirs.in | 3 - debian/build/debian/sensible-mda.preinst.in | 14 -- debian/changelog | 2 + debian/configure.ac | 73 +++--- debian/libmilter-dev.dirs.in | 4 + debian/libmilter-dev.links.in | 2 + debian/libmilter-dev.preinst.in | 14 ++ debian/libmilter.dirs.in | 2 + debian/libmilter.preinst.in | 14 ++ debian/rmail.dirs.in | 3 + debian/rmail.preinst.in | 14 ++ debian/sendmail-base.dirs.in | 56 +++++ debian/sendmail-base.postinst.in | 116 ++++++++++ debian/sendmail-base.postrm.in | 113 +++++++++ debian/sendmail-base.preinst.in | 59 +++++ debian/sendmail-base.prerm.in | 138 +++++++++++ debian/sendmail-bin.dirs.in | 12 + debian/sendmail-bin.postinst.in | 320 ++++++++++++++++++++++++++ debian/sendmail-bin.postrm.in | 88 +++++++ debian/sendmail-bin.preinst.in | 52 +++++ debian/sendmail-bin.prerm.in | 90 ++++++++ debian/sendmail-bin.suid.in | 2 + debian/sendmail-cf.dirs.in | 11 + debian/sendmail-cf.postrm.in | 52 +++++ debian/sendmail-cf.preinst.in | 14 ++ debian/sendmail-doc.dirs.in | 5 + debian/sendmail-doc.preinst.in | 28 +++ debian/sendmail.cron.daily.in | 101 ++++++++ debian/sendmail.dirs.in | 1 + debian/sendmail.init.d.in | 41 ++++ debian/sensible-mda.dirs.in | 3 + debian/sensible-mda.preinst.in | 14 ++ 58 files changed, 1399 insertions(+), 1414 deletions(-) delete mode 100644 debian/build/debian/libmilter-dev.dirs.in delete mode 100644 debian/build/debian/libmilter-dev.links.in delete mode 100644 debian/build/debian/libmilter-dev.preinst.in delete mode 100644 debian/build/debian/libmilter.dirs.in delete mode 100644 debian/build/debian/libmilter.preinst.in delete mode 100644 debian/build/debian/rmail.dirs.in delete mode 100644 debian/build/debian/rmail.preinst.in delete mode 100644 debian/build/debian/sendmail-base.dirs.in delete mode 100644 debian/build/debian/sendmail-base.postinst.in delete mode 100644 debian/build/debian/sendmail-base.postrm.in delete mode 100644 debian/build/debian/sendmail-base.preinst.in delete mode 100644 debian/build/debian/sendmail-base.prerm.in delete mode 100644 debian/build/debian/sendmail-bin.dirs.in delete mode 100644 debian/build/debian/sendmail-bin.postinst.in delete mode 100644 debian/build/debian/sendmail-bin.postrm.in delete mode 100644 debian/build/debian/sendmail-bin.preinst.in delete mode 100644 debian/build/debian/sendmail-bin.prerm.in delete mode 100644 debian/build/debian/sendmail-bin.suid.in delete mode 100644 debian/build/debian/sendmail-cf.dirs.in delete mode 100644 debian/build/debian/sendmail-cf.postrm.in delete mode 100644 debian/build/debian/sendmail-cf.preinst.in delete mode 100644 debian/build/debian/sendmail-doc.dirs.in delete mode 100644 debian/build/debian/sendmail-doc.preinst.in delete mode 100644 debian/build/debian/sendmail.cron.daily.in delete mode 100644 debian/build/debian/sendmail.dirs.in delete mode 100644 debian/build/debian/sendmail.init.d.in delete mode 100644 debian/build/debian/sensible-mda.dirs.in delete mode 100644 debian/build/debian/sensible-mda.preinst.in create mode 100644 debian/libmilter-dev.dirs.in create mode 100644 debian/libmilter-dev.links.in create mode 100644 debian/libmilter-dev.preinst.in create mode 100644 debian/libmilter.dirs.in create mode 100644 debian/libmilter.preinst.in create mode 100644 debian/rmail.dirs.in create mode 100644 debian/rmail.preinst.in create mode 100644 debian/sendmail-base.dirs.in create mode 100644 debian/sendmail-base.postinst.in create mode 100644 debian/sendmail-base.postrm.in create mode 100644 debian/sendmail-base.preinst.in create mode 100644 debian/sendmail-base.prerm.in create mode 100644 debian/sendmail-bin.dirs.in create mode 100644 debian/sendmail-bin.postinst.in create mode 100644 debian/sendmail-bin.postrm.in create mode 100644 debian/sendmail-bin.preinst.in create mode 100644 debian/sendmail-bin.prerm.in create mode 100644 debian/sendmail-bin.suid.in create mode 100644 debian/sendmail-cf.dirs.in create mode 100644 debian/sendmail-cf.postrm.in create mode 100644 debian/sendmail-cf.preinst.in create mode 100644 debian/sendmail-doc.dirs.in create mode 100644 debian/sendmail-doc.preinst.in create mode 100644 debian/sendmail.cron.daily.in create mode 100644 debian/sendmail.dirs.in create mode 100644 debian/sendmail.init.d.in create mode 100644 debian/sensible-mda.dirs.in create mode 100644 debian/sensible-mda.preinst.in diff --git a/debian/build/debian/libmilter-dev.dirs.in b/debian/build/debian/libmilter-dev.dirs.in deleted file mode 100644 index fabd44a..0000000 --- a/debian/build/debian/libmilter-dev.dirs.in +++ /dev/null @@ -1,4 +0,0 @@ -.@includedir@/libmilter -.@libdir@ -.@libdir@/libmilter -.@docdir@/libmilter-dev diff --git a/debian/build/debian/libmilter-dev.links.in b/debian/build/debian/libmilter-dev.links.in deleted file mode 100644 index 43a454e..0000000 --- a/debian/build/debian/libmilter-dev.links.in +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib/libmilter.so.@sm_libmilter_version@ usr/lib/libmilter/libmilter.so.@sm_libmilter_version@ -usr/lib/libmilter/libmilter.so.@sm_libmilter_version@ usr/lib/libmilter/libmilter.so diff --git a/debian/build/debian/libmilter-dev.preinst.in b/debian/build/debian/libmilter-dev.preinst.in deleted file mode 100644 index f132076..0000000 --- a/debian/build/debian/libmilter-dev.preinst.in +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -set -e - -PACKAGE=libmilter-dev; - -if [ -L @docdir@/$PACKAGE ]; then - # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail - rm @docdir@/$PACKAGE -fi -if [ -L /usr/share/bug/$PACKAGE ]; then - rm /usr/share/bug/$PACKAGE -fi - -#DEBHELPER# diff --git a/debian/build/debian/libmilter.dirs.in b/debian/build/debian/libmilter.dirs.in deleted file mode 100644 index 2176d5c..0000000 --- a/debian/build/debian/libmilter.dirs.in +++ /dev/null @@ -1,2 +0,0 @@ -.@libdir@/libmilter -.@docdir@/libmilter@sm_libmilter_version@ diff --git a/debian/build/debian/libmilter.preinst.in b/debian/build/debian/libmilter.preinst.in deleted file mode 100644 index 03731bf..0000000 --- a/debian/build/debian/libmilter.preinst.in +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -set -e - -PACKAGE=libmilter@sm_libmilter_version@; - -if [ -L @docdir@/$PACKAGE ]; then - # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail - rm @docdir@/$PACKAGE -fi -if [ -L /usr/share/bug/$PACKAGE ]; then - rm /usr/share/bug/$PACKAGE -fi - -#DEBHELPER# diff --git a/debian/build/debian/rmail.dirs.in b/debian/build/debian/rmail.dirs.in deleted file mode 100644 index a2aeebb..0000000 --- a/debian/build/debian/rmail.dirs.in +++ /dev/null @@ -1,3 +0,0 @@ -.@sbindir@ -.@mandir@ -.@mandir@/man8 diff --git a/debian/build/debian/rmail.preinst.in b/debian/build/debian/rmail.preinst.in deleted file mode 100644 index f1aa978..0000000 --- a/debian/build/debian/rmail.preinst.in +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -set -e - -PACKAGE=rmail; - -if [ -L @docdir@/$PACKAGE ]; then - # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail - rm @docdir@/$PACKAGE -fi -if [ -L /usr/share/bug/$PACKAGE ]; then - rm /usr/share/bug/$PACKAGE -fi - -#DEBHELPER# diff --git a/debian/build/debian/sendmail-base.dirs.in b/debian/build/debian/sendmail-base.dirs.in deleted file mode 100644 index 951b1a2..0000000 --- a/debian/build/debian/sendmail-base.dirs.in +++ /dev/null @@ -1,56 +0,0 @@ -.@sysconfdir@/cron.d -.@sysconfdir@/cron.daily -.@sysconfdir@/default -.@sysconfdir@/dhcp -.@sysconfdir@/dhcp/dhclient-exit-hooks.d -.@sysconfdir@/logcheck -.@sysconfdir@/logcheck/ignore.d.paranoid -.@sysconfdir@/logcheck/ignore.d.server -.@sysconfdir@/logcheck/ignore.d.workstation -.@sysconfdir@/logcheck/violations.ignore.d -.@sysconfdir@/logrotate.d -.@sysconfdir@/mail -.@sysconfdir@/mail/m4 -.@sysconfdir@/mail/peers -.@sysconfdir@/mail/smrsh -.@sysconfdir@/mail/sasl -.@sysconfdir@/mail/tls -.@sysconfdir@/network -.@sysconfdir@/network/if-down.d -.@sysconfdir@/network/if-post-down.d -.@sysconfdir@/network/if-up.d -.@sysconfdir@/pam.d -.@sysconfdir@/ppp/ip-down.d -.@sysconfdir@/ppp/ip-up.d -.@sysconfdir@/resolvconf -.@sysconfdir@/resolvconf/update-libc.d -.@bindir@ -.@sbindir@ -.@docdir@/sendmail-base -.@mandir@ -.@mandir@/man1 -.@mandir@/man8 -.@datadir@/sendmail -.@datadir@/sendmail/examples -.@datadir@/sendmail/examples/db -.@datadir@/sendmail/examples/dhcp -.@datadir@/sendmail/examples/dhcp/dhclient-exit-hooks.d -.@datadir@/sendmail/examples/ppp -.@datadir@/sendmail/examples/ppp/ip-down.d -.@datadir@/sendmail/examples/ppp/ip-up.d -.@datadir@/sendmail/examples/ldap -.@datadir@/sendmail/examples/logcheck -.@datadir@/sendmail/examples/logcheck/ignore.d.paranoid -.@datadir@/sendmail/examples/logcheck/ignore.d.server -.@datadir@/sendmail/examples/logcheck/ignore.d.workstation -.@datadir@/sendmail/examples/logcheck/violations.ignore.d -.@datadir@/sendmail/examples/milter -.@datadir@/sendmail/examples/network -.@datadir@/sendmail/examples/network/if-down.d -.@datadir@/sendmail/examples/network/if-post-down.d -.@datadir@/sendmail/examples/network/if-up.d -.@datadir@/sendmail/examples/pam.d -.@datadir@/sendmail/examples/resolvconf -.@datadir@/sendmail/examples/resolvconf/update-libc.d -.@datadir@/sendmail/examples/sasl -.@datadir@/sendmail/examples/tls diff --git a/debian/build/debian/sendmail-base.postinst.in b/debian/build/debian/sendmail-base.postinst.in deleted file mode 100644 index 769e441..0000000 --- a/debian/build/debian/sendmail-base.postinst.in +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -e -# -# Debian post installation script -# -# Install of already installed package: -# 1) old-prerm upgrade new-version -# *) new-prerm failed-upgrade old-version -# *) old-postinst abort-upgrade new-version -# -# If a `conflicting' package is being removed at the same time: -# 1) forall packages depending on conflicting package and --auto-deconfigure -# deconfigured's-prerm deconfigure \ -# in-favour package-being-installed version \ -# removing conflicting-package version -# *) deconfigured's-postinst abort-deconfigure \ -# in-favour package-being-installed-but-failed version \ -# removing conflicting-package version -# 2) To prepare for removal of the conflicting package -# conflictor's-prerm remove \ -# in-favour package new-version -# *) conflictor's-postinst abort-remove \ -# in-favour package new-version -# -# Configuration of package: -# postinst configure most-recently-configured-version -# -set -e; - -PACKAGE=sendmail-base; - -# do we have debconf? -if [ -f /usr/share/debconf/confmodule ]; then - DEBCONF=true; - #. /usr/share/debconf/confmodule; - #db_stop; # For testing -else - DEBCONF=''; - fi; - -case "$1" in - configure) - #----------------------------------------------------------- - if [ "$2" = "" ]; then - :; - #echo " "; - #echo "A new sendmail user, welcome!"; - fi; - - #----------------------------------------------------------- - # Tell users about new and interesting things... - if [ -x @datadir@/sendmail/update_notices ]; then - @datadir@/sendmail/update_notices $2; - fi; - - #----------------------------------------------------------- - # Create group/user smmta/smmsp iff needed - touch @sysconfdir@/mail/tsmmta; - if ! chown root:smmta @sysconfdir@/mail/tsmmta 2>/dev/null; then - addgroup --system --quiet smmta; - fi; - if ! chown smmta:smmta @sysconfdir@/mail/tsmmta 2>/dev/null; then - adduser --system --ingroup smmta --home "/var/lib/sendmail" \ - --disabled-password \ - --quiet --gecos 'Mail Transfer Agent' smmta; - fi; - rm @sysconfdir@/mail/tsmmta; - touch @sysconfdir@/mail/tsmmsp; - if ! chown root:smmsp @sysconfdir@/mail/tsmmsp 2>/dev/null; then - addgroup --system --quiet smmsp; - fi; - if ! chown smmsp:smmsp @sysconfdir@/mail/tsmmsp 2>/dev/null; then - adduser --system --ingroup smmsp --home "/var/lib/sendmail" \ - --disabled-password \ - --quiet --gecos 'Mail Submission Program' smmsp; - fi; - rm @sysconfdir@/mail/tsmmsp; - - #----------------------------------------------------------- - # With a dynamic uid/gid, have to set appropriate ownership herein - chown root:smmsp @sysconfdir@/mail/sasl; - chown root:smmsp @sysconfdir@/mail/tls; - - #----------------------------------------------------------- - # Save the current configuration files in safe place... - if [ -x @sysconfdir@/cron.daily/sendmail ]; then - echo "Saving current /etc/mail/sendmail.mc,cf to /var/backups"; - @sysconfdir@/cron.daily/sendmail || true; - fi; - - #----------------------------------------------------------- - # Make sure inetd.conf has sendmail in it (but disabled) - if [ -x /usr/sbin/update-inetd ]; then - update-inetd --remove "^587"; - update-inetd --group MAIL --add \ - "smtp\tstream\ttcp\tnowait\troot\t@sbindir@/sendmail sendmail -Am -bs"; - update-inetd --group MAIL --add \ - "submission\tstream\ttcp\tnowait\troot\t@sbindir@/sendmail sendmail -Am -bs"; - update-inetd --group MAIL --add \ - "smtps\tstream\ttcp\tnowait\troot\t@sbindir@/sendmail sendmail -Am -bs"; - update-inetd --group MAIL --multi --disable smtp,smtps,submission; - fi; - - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - exit 0; - ;; - - *) - echo "$PACKAGE postinst called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; - -#DEBHELPER# -exit 0; diff --git a/debian/build/debian/sendmail-base.postrm.in b/debian/build/debian/sendmail-base.postrm.in deleted file mode 100644 index 5a68568..0000000 --- a/debian/build/debian/sendmail-base.postrm.in +++ /dev/null @@ -1,113 +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-base; - -case "$1" in - remove) - if [ ! -z "$2" ]; then - echo "Removing $PACKAGE $2 $3($4)"; - fi; - - if [ -x /usr/sbin/update-inetd ]; then - update-inetd --remove "^smtp"; - update-inetd --remove "^smtps"; - update-inetd --remove "^submission"; - fi; - ;; - - purge) - # Currently, dh_installdebconf doesn't do db_stop... ensure it is done! - if [ "$1" = "purge" ] && [ -e /usr/share/debconf/confmodule ]; then - # Source debconf library. - . /usr/share/debconf/confmodule; - # Make sure we're done - #db_stop; - # Remove my changes to the db. - db_purge; - fi; - - # Remove user/group smmsp - if [ -x /usr/sbin/deluser ]; then - deluser --quiet smmta || true; - deluser --quiet smmsp || true; - fi; - userdel smmta 2>/dev/null || true; - groupdel smmta 2>/dev/null || true; - userdel smmsp 2>/dev/null || true; - groupdel smmsp 2>/dev/null || true; - - # Purge those files installed in other package directories - rm -f @libdir@/lib/sasl/Sendmail.conf; - rm -f @sysconfdir@/certs/sendmail.pem; - rm -f @datadir@/bug/sendmail*; - rmdir --ignore-fail-on-non-empty @datadir@/bug; - rm -f @sysconfdir@/logrotate.d/sendmail; - rmdir --ignore-fail-on-non-empty @sysconfdir@/logrotate.d; - rm -f @sysconfdir@/logcheck/violations.ignore.d/sendmail; - rmdir --ignore-fail-on-non-empty @sysconfdir@/logcheck/violations.ignore.d; - rmdir --ignore-fail-on-non-empty @sysconfdir@/logcheck; - # Can't touch these as they may be included in slapd.conf - #rm -rf @sysconfdir@/ldap/schema/sendmail.schema; - #rm -rf @sysconfdir@/openldap/sendmail.schema; - #rm -rf @sysconfdir@/umich-ldap/sendmail.schema; - # Purge psuedo conffiles (managed by sendmail) - rm -f @sysconfdir@/mail/sendmail.conf; - # Purge sendmail configuration files - rm -f @sysconfdir@/mail/sendmail.mc \ - @sysconfdir@/mail/submit.mc \ - @sysconfdir@/mail/m4/dialup.m4 \ - @sysconfdir@/mail/m4/provider.m4 \ - @sysconfdir@/mail/local-host-names \ - @sysconfdir@/mail/relay-domains \ - @sysconfdir@/mail/trusted-users \ - @sysconfdir@/mail/default-auth-info \ - @sysconfdir@/mail/access \ - ; - rmdir @sysconfdir@/mail/peers 2>/dev/null || true; - rmdir @sysconfdir@/mail 2>/dev/null || true; - - ;; - - upgrade) - ;; - - failed-upgrade|abort-install|abort-upgrade|disappear) - echo "$1 of $PACKAGE $2"; - ;; - - *) - echo "$PACKAGE postrm called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; - -# NOTE WELL: If we fall through here during purge, update-rc.d will be -# called with remove... and /etc/init.d/$PACKAGE goes away! -#DEBHELPER# - -exit 0; diff --git a/debian/build/debian/sendmail-base.preinst.in b/debian/build/debian/sendmail-base.preinst.in deleted file mode 100644 index 1091ddc..0000000 --- a/debian/build/debian/sendmail-base.preinst.in +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh -e -# -# Debian pre install 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 -# -set -e; - -PACKAGE=sendmail-base; - -if [ -L @docdir@/$PACKAGE ]; then - # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail - rm @docdir@/$PACKAGE -fi -if [ -L /usr/share/bug/$PACKAGE ]; then - rm /usr/share/bug/$PACKAGE -fi - -if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "8.14.4-2.2~"; then - # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail - rm -rf @docdir@/sendmail/examples - rm -f @docdir@/sendmail/Debian-specific.gz - rm -f @docdir@/sendmail/site.config.m4.gz -fi - - -case "$1" in - upgrade) - # Prevent cronjob from running during upgrade... - if [ -f @sysconfdir@/cron.d/sendmail ]; then - echo "#preinst" > @sysconfdir@/cron.d/sendmail; - fi; - - # Move files to new home - if [ -d @sysconfdir@/mail/ssl ]; then - mv -f @sysconfdir@/mail/ssl @sysconfdir@/mail/tls; - fi; - ;; - - install|abort-upgrade) - ;; - - *) - echo "$PACKAGE preinst called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; - -#DEBHELPER# -exit 0; diff --git a/debian/build/debian/sendmail-base.prerm.in b/debian/build/debian/sendmail-base.prerm.in deleted file mode 100644 index 28941ad..0000000 --- a/debian/build/debian/sendmail-base.prerm.in +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/sh -e -# -# Debian pre removal script -# -# Install of already installed package: -# 1) old-prerm upgrade new-version -# *) new-prerm failed-upgrade old-version -# *) old-postinst abort-upgrade new-version -# -# If a `conflicting' package is being removed at the same time: -# 1) forall packages depending on conflicting package and --auto-deconfigure -# deconfigured's-prerm deconfigure \ -# in-favour package-being-installed version \ -# removing conflicting-package version -# *) deconfigured's-postinst abort-deconfigure \ -# in-favour package-being-installed-but-failed version \ -# removing conflicting-package version -# 2) To prepare for removal of the conflicting package -# conflictor's-prerm remove \ -# in-favour package new-version -# *) conflictor's-postinst abort-remove \ -# in-favour package new-version -# -# 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. -# -set -e; - -PACKAGE=sendmail-base; - -case "$1" in - remove) - if [ ! -z "$2" ]; then - echo "Removing $PACKAGE $2 $3($4)"; - fi; - - if [ -x /usr/sbin/update-inetd ]; then - update-inetd --group MAIL --disable smtp,smtps,submission; - fi; - - # Make sure /etc/aliases is left (move it from /etc/mail if needed) - if [ -L @sysconfdir@/mail/aliases ]; then - rm -f @sysconfdir@/mail/aliases; - elif [ -f @sysconfdir@/mail/aliases ] \ - && [ -L /etc/aliases ]; then - mv @sysconfdir@/mail/aliases /etc/aliases; - fi; - - # Remove psuedo conffiles (managed by sendmail) - rm -f @sysconfdir@/cron.d/sendmail; - - # Remove files scattered across the system that - # happened to be created by sendmail - rm -f @libdir@/sasl/Sendmail.conf; - - # Remove those files created by sendmail - rm -rf @localstatedir@/lib/sendmail; - rm -rf @localstatedir@/run/sendmail; - # Note: syslog really owns these files - #rm -f @localstatedir@/log/mail/*; - #rm -f @localstatedir@/log/mail.log; - # Note: these can lead to a loss of mail!!!! - if [ -x @sysconfdir@/init.d/sendmail ]; then - @sysconfdir@/init.d/sendmail clean; - fi; - if [ -L @localstatedir@/spool/mqueue ]; then - rmdir --ignore-fail-on-non-empty \ - `readlink -fn @localstatedir@/spool/mqueue`; - elif [ -d @localstatedir@/spool/mqueue ]; then - rmdir --ignore-fail-on-non-empty \ - @localstatedir@/spool/mqueue; - fi; - if [ -L @localstatedir@/spool/mqueue-client ]; then - rmdir --ignore-fail-on-non-empty \ - `readlink -fn @localstatedir@/spool/mqueue-client`; - elif [ -d @localstatedir@/spool/mqueue-client ]; then - rmdir --ignore-fail-on-non-empty \ - @localstatedir@/spool/mqueue-client; - fi; - - # Remove sendmail built configuration files - rm -f @sysconfdir@/mail/*.db \ - @sysconfdir@/mail/*.dir \ - @sysconfdir@/mail/*.pag; - rm -f @sysconfdir@/mail/sendmail.cf \ - @sysconfdir@/mail/sendmail.cf.old \ - @sysconfdir@/mail/sendmail.cf.errors \ - @sysconfdir@/mail/sendmail.mc.old \ - @sysconfdir@/mail/submit.cf \ - @sysconfdir@/mail/submit.cf.errors \ - @sysconfdir@/mail/submit.mc.old \ - @sysconfdir@/mail/databases \ - @sysconfdir@/mail/Makefile \ - ; - rm -rf @sysconfdir@/mail/smrsh \ - @sysconfdir@/mail/sasl \ - @sysconfdir@/mail/tls; - - # Remove empty files (probably touched databases) - find @sysconfdir@/mail -maxdepth 1 -size 0 | xargs -r rm; - ;; - - upgrade) - # Potentially move the old configuration file to the new name - - # before it gets deleted (for not existing in the new package) - mv -f @sysconfdir@/default/sendmail \ - @sysconfdir@/mail/sendmail.conf 2>/dev/null || true; - - # Prevent cronjob from running during upgrade... - if [ -f /etc/cron.d/sendmail ]; then - echo "#prerm" > @sysconfdir@/cron.d/sendmail; - fi; - ;; - - failed-upgrade) - ;; - - deconfigure) - echo "Deconfigure of $PACKAGE $2 $3($4) $5 $6($7) "; - ;; - - *) - echo "$PACKAGE prerm called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; - -# The @DEBHELPER@ stuff causes problems with upgrades because of the -# length of time that Sendmail is stopped... - -# -# Included for sanity checks -# -#DEBHELPER# -exit 0; diff --git a/debian/build/debian/sendmail-bin.dirs.in b/debian/build/debian/sendmail-bin.dirs.in deleted file mode 100644 index b3b51ed..0000000 --- a/debian/build/debian/sendmail-bin.dirs.in +++ /dev/null @@ -1,12 +0,0 @@ -.@sysconfdir@/cron.daily -.@sysconfdir@/init.d -.@bindir@ -.@sbindir@ -.@libexecdir@ -.@docdir@/sendmail-bin -.@mandir@ -.@mandir@/man1 -.@mandir@/man5 -.@mandir@/man8 -.@localstatedir@/spool/mqueue -.@localstatedir@/spool/mqueue-client diff --git a/debian/build/debian/sendmail-bin.postinst.in b/debian/build/debian/sendmail-bin.postinst.in deleted file mode 100644 index 484c83e..0000000 --- a/debian/build/debian/sendmail-bin.postinst.in +++ /dev/null @@ -1,320 +0,0 @@ -#!/bin/sh -e -# -# Debian post installation script -# -# Install of already installed package: -# 1) old-prerm upgrade new-version -# *) new-prerm failed-upgrade old-version -# *) old-postinst abort-upgrade new-version -# -# If a `conflicting' package is being removed at the same time: -# 1) forall packages depending on conflicting package and --auto-deconfigure -# deconfigured's-prerm deconfigure \ -# in-favour package-being-installed version \ -# removing conflicting-package version -# *) deconfigured's-postinst abort-deconfigure \ -# in-favour package-being-installed-but-failed version \ -# removing conflicting-package version -# 2) To prepare for removal of the conflicting package -# conflictor's-prerm remove \ -# in-favour package new-version -# *) conflictor's-postinst abort-remove \ -# in-favour package new-version -# -# Configuration of package: -# postinst configure most-recently-configured-version -# -set -e; - -PACKAGE=sendmail-bin; - -#----------------------------------------------------------- -#stop(): stop sendmail -stop_mta () { - # Account for varying PIDfile locations of older sendmail packages - if [ -f /var/run/sendmail/mta/sendmail.pid ]; then - start-stop-daemon --stop --oknodo --quiet \ - --pidfile /var/run/sendmail/msp/sendmail.pid > /dev/null; - start-stop-daemon --stop --oknodo --quiet \ - -pidfile /var/run/sendmail/mta/sendmail.pid > /dev/null; - elif [ -f /var/run/sendmail/sendmail.pid ]; then - start-stop-daemon --stop --oknodo --quiet \ - --pidfile /var/run/sendmail/sendmail.pid > /dev/null; - elif [ -f /var/run/sendmail.pid ]; then - start-stop-daemon --stop --oknodo --quiet \ - --pidfile /var/run/sendmail.pid > /dev/null; - fi; - # Since we changed the executable, do one more try - using the old name - if [ -f /var/run/sendmail/mta/sendmail.pid ]; then - start-stop-daemon --stop --oknodo --quiet \ - --pidfile /var/run/sendmail/mta/sendmail.pid > /dev/null; - fi; - start-stop-daemon --stop --oknodo --quiet \ - --name sendmail > /dev/null; - if [ -x @sysconfdir@/init.d/sendmail ]; then - if [ -x /usr/sbin/invoke-rc.d ]; then - /usr/sbin/invoke-rc.d --quiet --force sendmail stop; - else - @sysconfdir@/init.d/sendmail stop; - fi; - fi; - }; - -#----------------------------------------------------------- -#start(): start sendmail -start_mta () { - if [ -x /usr/sbin/invoke-rc.d ]; then - /usr/sbin/invoke-rc.d sendmail start; - else - @sysconfdir@/init.d/sendmail start; - fi; - }; - -#----------------------------------------------------------- -# configure(): save sendmail.cf, call sendmailconfig -configure_mta () { - local enter; - echo -n "Configure now ? (y/N) "; - read yn; - yn=$(echo -n "$yn" | sed -e "s/^\ *//" -e "s/^\t*//"); - test -n "$yn" || yn="N"; - case "$yn" in - [Yy]*) - stop_mta; - @sbindir@/sendmailconfig --no-reload; - start_mta; - ;; - - [Nn]*) - echo ''; - echo "To configure sendmail later, type" \ - "sendmailconfig"; - echo "After configuring sendmail, you can" \ - "start it via @sysconfdir@/init.d/sendmail start"; - echo -n "Press [ENTER] "; - read enter; - ;; - esac; - }; - -# do we have debconf? -if [ -f /usr/share/debconf/confmodule ]; then - DEBCONF=true; - #. /usr/share/debconf/confmodule; - #db_stop; # For testing -else - DEBCONF=''; - fi; - -case "$1" in - configure) - # continue below - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - exit 0; - ;; - - *) - echo "$PACKAGE postinst called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; - -#-------------------------------------------------------------------- -# Continuation of "$1" = "configure" - -# Note: can't use debhelper here because the actions aren't contiguous -#xxxHELPER# - -# Automatically added by dh_installinit -if [ -x "@sysconfdir@/init.d/sendmail" ]; then - update-rc.d -f sendmail remove >/dev/null; - update-rc.d sendmail defaults 21 19 >/dev/null; - #/etc/init.d/sendmail start -fi -# End automatically added section - -#----------------------------------------------------------- -# Create (or update) MTA, MSP alternatives -# This way, we'll be able to install 2 MTAs on the same box :) -update-alternatives \ - --install @sbindir@/sendmail-mta sendmail-mta @libexecdir@/sendmail 25 \ - --slave @mandir@/man8/sendmail-mta.8.gz sendmail-mta.8.gz \ - @mandir@/man8/sendmail.sendmail.8.gz \ - --slave @sbindir@/runq runq @datadir@/sendmail/runq \ - --slave @mandir@/man8/runq.8.gz runq.8.gz \ - @mandir@/man8/runq.sendmail.8.gz \ - --slave @sbindir@/newaliases newaliases \ - @datadir@/sendmail/newaliases \ - --slave @mandir@/man8/newaliases.8.gz newaliases.8.gz \ - @mandir@/man8/newaliases.sendmail.8.gz \ - --slave @bindir@/mailq mailq @datadir@/sendmail/mailq \ - --slave @mandir@/man1/mailq.1.gz mailq.1.gz \ - @mandir@/man1/mailq.sendmail.1.gz \ - --slave @mandir@/man5/aliases.5.gz aliases.5.gz \ - @mandir@/man5/aliases.sendmail.5.gz \ - ; -update-alternatives \ - --install @sbindir@/sendmail-msp sendmail-msp @libexecdir@/sendmail 25 \ - --slave @mandir@/man8/sendmail-msp.8.gz sendmail-msp.8.gz \ - @mandir@/man8/sendmail.sendmail.8.gz \ - --slave @sbindir@/sendmail sendmail @libexecdir@/sendmail \ - --slave @libdir@/sendmail lib.sendmail @libexecdir@/sendmail \ - --slave @mandir@/man8/sendmail.8.gz sendmail.8.gz \ - @mandir@/man8/sendmail.sendmail.8.gz \ - ; - -#----------------------------------------------------------- -# With a dynamic uid/gid, have to set appropriate ownership herein -if command -v suidregister >/dev/null 2>&1 && test -s /etc/suid.conf; then - suidregister -s sendmail @sbindir@/sendmail root smmsp 02755; - suidregister -s sendmail @libexecdir@/mailstats root smmsp 02755; -elif [ -x @sbindir@/sendmail ]; then - chown root:smmsp @libexecdir@/sendmail; - chmod 02755 @libexecdir@/sendmail; - chown root:smmsp @libexecdir@/mailstats; - chmod 02755 @libexecdir@/mailstats; - fi; - -#----------------------------------------------------------- -# Create backups of /etc/mail/{sendmail,submit}.mc -if [ -f @sysconfdir@/mail/sendmail.cf ]; then - echo "Saving old /etc/mail/sendmail.cf" \ - "as /etc/mail/sendmail.cf.old ..."; - cp -f @sysconfdir@/mail/sendmail.cf \ - @sysconfdir@/mail/sendmail.cf.old; - chown root:root @sysconfdir@/mail/sendmail.cf.old; - chmod 0644 @sysconfdir@/mail/sendmail.cf.old; - fi; -if [ -f @sysconfdir@/mail/submit.cf ]; then - cp -f @sysconfdir@/mail/submit.cf \ - @sysconfdir@/mail/submit.cf.old; - chown root:root @sysconfdir@/mail/submit.cf.old; - chmod 0644 @sysconfdir@/mail/submit.cf.old; - fi; - -start_ask=0; - -#----------------------------------------------------------- -# Create /etc/mail/sendmail.mc if it doesn't exist -if [ ! -f @sysconfdir@/mail/sendmail.mc ]; then - cat <<-EOT - - You are doing a new install, or have erased /etc/mail/sendmail.mc. - If you've accidentaly erased /etc/mail/sendmail.mc, check /var/backups. - - I am creating a safe, default sendmail.mc for you and you can - run sendmailconfig later if you need to change the defaults. - - EOT - fi; - -if [ -x @datadir@/sendmail/update_sendmail ]; then - stop_mta; - echo "Updating sendmail environment ..."; - @datadir@/sendmail/update_sendmail || true; - start_mta; - fi; -exit 0; - - -#----------------------------------------------------------- -# See if we can do this automagically... -cat <<-EOT - -It is a good idea to regenerate the sendmail configuration -file with each new spin of the sendmail package. - -But, if you hand edit sendmail.cf instead of making changes through -sendmail.mc, then you want to say no, save your old sendmail.cf, run -sendmailconfig, then migrate your changes into the new version. - -EOT -echo -n "Automagically regenerate the sendmail.cf configuration file? (Y/n) "; -read yn; -yn=$(echo -n "$yn" | sed -e "s/^\ *//" -e "s/^\t*//"); -test -n "$yn" || yn="Y"; -case "$yn" in - [Yy]*) - if [ -f @sysconfdir@/mail/sendmail.cf ]; then - echo "Saving old /etc/mail/sendmail.cf" \ - "as /etc/mail/sendmail.cf.old ..."; - cp -f @sysconfdir@/mail/sendmail.cf \ - @sysconfdir@/mail/sendmail.cf.old; - chown root:root @sysconfdir@/mail/sendmail.cf.old; - chmod 0644 @sysconfdir@/mail/sendmail.cf.old; - fi; - if [ -f @sysconfdir@/mail/submit.cf ]; then - cp -f @sysconfdir@/mail/submit.cf \ - @sysconfdir@/mail/submit.cf.old; - chown root:root @sysconfdir@/mail/submit.cf.old; - chmod 0644 @sysconfdir@/mail/submit.cf.old; - fi; - if [ -x @datadir@/sendmail/update_sendmail ]; then - stop_mta; - echo "Updating sendmail environment ..."; - @datadir@/sendmail/update_sendmail || true; - fi; - ;; - - [Nn]*) - cat <<-EOT - - Your files (sendmail.mc,cf, etc) have *not* been altered. - - *** Warning *** Warning *** Warning *** Warning *** Warning *** Warning *** - - There have been changes in - * Paths of some databases and executables - * FEATUREs, DOMAIN, includes - * Internal Database storage - - These changes were *NOT* made for you ... And will not be - until you run sendmailconfig! - - Until you update /etc/mail/sendmail.cf via sendmailconfig, - you should expect to have problems running sendmail! - - "Well, a pet peeve of mine is people who directly edit the - .cf file instead of using the m4 configuration files. - Don't do it! [laughs] I treat the .cf file as a binary - file - you should too." - -- Eric Allman 1999/10/18 - - *** Warning *** Warning *** Warning *** Warning *** Warning *** Warning *** - - EOT - echo "Do you wish to run sendmailconfig now, or later"; - start_ask=0; - configure_mta; - case "$yn" in - [Yy]*) - cat <<-EOT - - Do you wish to start sendmail with the new sendmail.cf, - or do you wish to delay until you can merge any changes - from your older sendmail.cf.old? - EOT - start_ask=1; - start_mta; - ;; - esac; - exit 0; - esac; - -#----------------------------------------------------------- -# If we're still here, we're going the automagic path... -# Now, liberal application of smoke and mirrors -if [ -f @sysconfdir@/mail/sendmail.mc ]; then - start_ask=1; - start_mta; - fi; - -exit 0; - -#----------------------------------------------------------- -# -# List herein (for reference) what debhelper would've done: -#DEBHELPER# -exit 0; diff --git a/debian/build/debian/sendmail-bin.postrm.in b/debian/build/debian/sendmail-bin.postrm.in deleted file mode 100644 index 4fafe4e..0000000 --- a/debian/build/debian/sendmail-bin.postrm.in +++ /dev/null @@ -1,88 +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-bin; - -case "$1" in - remove) - if [ ! -z "$2" ]; then - echo "Removing $PACKAGE $2 $3($4)"; - if [ "$PACKAGE" = 'sendmail' ] && [ "$3" = 'sendmail-tls' ] || \ - [ "$PACKAGE" = 'sendmail-tls' ] && [ "$3" = 'sendmail' ]; then - echo '...Nothing to do...'; - exit 0; - fi; - fi; - ;; - - purge) - # If postrm is called *AND* there are no files, exit quickly - # (This is a *GROSS* hack... beter use the test below) - #if [ ! -s `echo "$0" | sed -e 's/postrm$/list/'` ]; then - # echo "Purging replaced package $PACKAGE, nothing to do..."; - # exit 0; - # fi; - - # We're *really* purging; neither sendmail nor sendmail-tls - # is currently installed - if [ -f @libexecdir@/sendmail ]; then - echo "Purging replaced package $PACKAGE, nothing to do..."; - exit 0; - fi; - - # Currently, dh_installdebconf doesn't do db_stop... ensure it is done! - if [ "$1" = "purge" ] && [ -e /usr/share/debconf/confmodule ]; then - # Source debconf library. - . /usr/share/debconf/confmodule; - # Make sure we're done - #db_stop; - # Remove my changes to the db. - db_purge; - fi; - - rm -f @sysconfdir@/mail/sendmail.cf.old - rm -f @sysconfdir@/mail/submit.cf.old - ;; - - upgrade) - ;; - - failed-upgrade|abort-install|abort-upgrade|disappear) - echo "$1 of $PACKAGE $2"; - ;; - - *) - echo "$PACKAGE postrm called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; - -# NOTE WELL: If we fall through here during purge, update-rc.d will be -# called with remove... and /etc/init.d/$PACKAGE goes away! -#DEBHELPER# - -exit 0; diff --git a/debian/build/debian/sendmail-bin.preinst.in b/debian/build/debian/sendmail-bin.preinst.in deleted file mode 100644 index b45a775..0000000 --- a/debian/build/debian/sendmail-bin.preinst.in +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -e -# -# Debian pre install 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 -# -set -e; - -PACKAGE=sendmail-bin; - -# do we have debconf? -if [ -f /usr/share/debconf/confmodule ]; then - DEBCONF=true; - . /usr/share/debconf/confmodule; -else - DEBCONF=''; - fi; - -case "$1" in - install) - ;; - - upgrade) - # DPKG doesn't overwrite directories with symlinks... - rm -rf @libdir@/sendmail 2>/dev/null || true; - - # Prevent cronjob from running during upgrade... - if [ -f /etc/cron.d/sendmail ]; then - echo "#preinst" > @sysconfdir@/cron.d/sendmail; - fi; - ;; - - abort-upgrade) - ;; - - *) - echo "$PACKAGE preinst called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; - -#DEBHELPER# -exit 0; diff --git a/debian/build/debian/sendmail-bin.prerm.in b/debian/build/debian/sendmail-bin.prerm.in deleted file mode 100644 index a478620..0000000 --- a/debian/build/debian/sendmail-bin.prerm.in +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/sh -e -# -# Debian pre removal script -# -# Install of already installed package: -# 1) old-prerm upgrade new-version -# *) new-prerm failed-upgrade old-version -# *) old-postinst abort-upgrade new-version -# -# If a `conflicting' package is being removed at the same time: -# 1) forall packages depending on conflicting package and --auto-deconfigure -# deconfigured's-prerm deconfigure \ -# in-favour package-being-installed version \ -# removing conflicting-package version -# *) deconfigured's-postinst abort-deconfigure \ -# in-favour package-being-installed-but-failed version \ -# removing conflicting-package version -# 2) To prepare for removal of the conflicting package -# conflictor's-prerm remove \ -# in-favour package new-version -# *) conflictor's-postinst abort-remove \ -# in-favour package new-version -# -# 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. -# -set -e; - -PACKAGE=sendmail-bin; - -case "$1" in - remove) - if [ ! -z "$2" ]; then - echo "Removing $PACKAGE $2 $3($4)"; - if [ "$PACKAGE" = 'sendmail' ] && [ "$3" = 'sendmail-tls' ] || \ - [ "$PACKAGE" = 'sendmail-tls' ] && [ "$3" = 'sendmail' ]; then - echo '...Nothing to do...'; - exit 0; - fi; - fi; - # Remove alternatives for MTA, MSP - update-alternatives --remove sendmail-mta @libexecdir@/sendmail; - update-alternatives --remove sendmail-msp @libexecdir@/sendmail; - if [ -x @sysconfdir@/init.d/sendmail ] && \ - [ -x @datadir@/sendmail/sendmail ]; then - if [ -x /usr/sbin/invoke-rc.d ]; then - /usr/sbin/invoke-rc.d --quiet --force sendmail stop; - else - @sysconfdir@/init.d/sendmail stop; - fi; - fi; - # Prevent cronjob from running during upgrade... - if [ -f /etc/cron.d/sendmail ]; then - rm -f @sysconfdir@/cron.d/sendmail; - fi; - ;; - - upgrade) - # Prevent cronjob from running during upgrade... - if [ -f /etc/cron.d/sendmail ]; then - echo "#prerm" > @sysconfdir@/cron.d/sendmail; - fi; - - # NOTE NOTE NOTE NOTE NOTE - # If we fall through to DEBHELPER, sendmail will be stopped - # much earlier than necessary !!! - exit 0; - ;; - - failed-upgrade) - ;; - - deconfigure) - echo "Deconfigure of $PACKAGE $2 $3($4) $5 $6($7) "; - ;; - - *) - echo "$PACKAGE prerm called with unknown argument \`$1'" >&2; - exit 1; - ;; - esac; - -# -# Included for sanity checks -# -#DEBHELPER# -exit 0; diff --git a/debian/build/debian/sendmail-bin.suid.in b/debian/build/debian/sendmail-bin.suid.in deleted file mode 100644 index 32469ca..0000000 --- a/debian/build/debian/sendmail-bin.suid.in +++ /dev/null @@ -1,2 +0,0 @@ -@sbindir@/sendmail -@libexecdir@/mailstats diff --git a/debian/build/debian/sendmail-cf.dirs.in b/debian/build/debian/sendmail-cf.dirs.in deleted file mode 100644 index 837ffae..0000000 --- a/debian/build/debian/sendmail-cf.dirs.in +++ /dev/null @@ -1,11 +0,0 @@ -.@docdir@/sendmail-cf -.@datadir@/sendmail/cf -.@datadir@/sendmail/cf/cf -.@datadir@/sendmail/cf/debian -.@datadir@/sendmail/cf/domain -.@datadir@/sendmail/cf/feature -.@datadir@/sendmail/cf/hack -.@datadir@/sendmail/cf/m4 -.@datadir@/sendmail/cf/mailer -.@datadir@/sendmail/cf/ostype -.@datadir@/sendmail/cf/sh diff --git a/debian/build/debian/sendmail-cf.postrm.in b/debian/build/debian/sendmail-cf.postrm.in deleted file mode 100644 index 606ec49..0000000 --- a/debian/build/debian/sendmail-cf.postrm.in +++ /dev/null @@ -1,52 +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-cf; - -case "$1" in - remove) - # Make sure the data directory is *clean* - rm -rf @datadir@/sendmail/cf - ;; - - 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 --git a/debian/build/debian/sendmail-cf.preinst.in b/debian/build/debian/sendmail-cf.preinst.in deleted file mode 100644 index d81e779..0000000 --- a/debian/build/debian/sendmail-cf.preinst.in +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -set -e - -PACKAGE=sendmail-cf; - -if [ -L @docdir@/$PACKAGE ]; then - # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail - rm @docdir@/$PACKAGE -fi -if [ -L /usr/share/bug/$PACKAGE ]; then - rm /usr/share/bug/$PACKAGE -fi - -#DEBHELPER# diff --git a/debian/build/debian/sendmail-doc.dirs.in b/debian/build/debian/sendmail-doc.dirs.in deleted file mode 100644 index b078e7f..0000000 --- a/debian/build/debian/sendmail-doc.dirs.in +++ /dev/null @@ -1,5 +0,0 @@ -.@docdir@/sendmail-doc -.@docdir@/sendmail-doc/libmilter -.@docdir@/sendmail-doc/libmilter/html -.@docdir@/sendmail-doc/op -.@docdir@/sendmail-doc/sendmail diff --git a/debian/build/debian/sendmail-doc.preinst.in b/debian/build/debian/sendmail-doc.preinst.in deleted file mode 100644 index 6f2724a..0000000 --- a/debian/build/debian/sendmail-doc.preinst.in +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -set -e - -PACKAGE=sendmail-doc; - -if [ -L @docdir@/$PACKAGE ]; then - # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail - rm @docdir@/$PACKAGE -fi -if [ -L /usr/share/bug/$PACKAGE ]; then - rm /usr/share/bug/$PACKAGE -fi - -if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "8.14.4-2.2~"; then - # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail - rm -rf @docdir@/sendmail/libmilter/ - rm -rf @docdir@/sendmail/op/ - rm -rf @docdir@/sendmail/sendmail/ - rm -f @docdir@/sendmail/Debian-specific.gz - rm -f @docdir@/sendmail/KNOWNBUGS.gz - rm -f @docdir@/sendmail/README.Debian.sendmail-doc - rm -f @docdir@/sendmail/cf.README.gz - rm -f @docdir@/sendmail/faq.txt.gz - rm -f @docdir@/sendmail/site.config.m4.gz - rm -f @docdir@/sendmail/smrsh.README.gz -fi - -#DEBHELPER# diff --git a/debian/build/debian/sendmail.cron.daily.in b/debian/build/debian/sendmail.cron.daily.in deleted file mode 100644 index 131f9a2..0000000 --- a/debian/build/debian/sendmail.cron.daily.in +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/sh -set +e; - -#------------------------------------------------------------------------------ -# Autoconf variables - in a form suitable for sh, perl -# Generated automatically from autoconf.sh.in by configure. -#------------------------------------------------------------------------------ -# Variables for, and by, Autoconf (Don't touch these! edit config step) -PACKAGE_NAME="@PACKAGE_NAME@"; -PACKAGE_VERSION="@PACKAGE_VERSION@"; -prefix="@prefix@"; -exec_prefix="@exec_prefix@"; -bindir="@bindir@"; -sbindir="@sbindir@"; -libexecdir="@libexecdir@"; -datadir="@datadir@"; -sysconfdir="@sysconfdir@"; -sharedstatedir="@sharedstatedir@"; -localstatedir="@localstatedir@"; -libdir="@libdir@"; -includedir="@includedir@"; -infodir="@infodir@"; -mandir="@mandir@"; -docdir="@docdir@"; -srcdir="@srcdir@"; - -copies=2; - -# backup "/etc/mail/sendmail.mc" -if [ -f ${sysconfdir}/mail/sendmail.mc ]; then - if [ ! -f ${localstatedir}/backups/sendmail.mc.bak ]; then - cp -pf ${sysconfdir}/mail/sendmail.mc \ - ${localstatedir}/backups/sendmail.mc.bak; - fi; - if ! cmp -s ${localstatedir}/backups/sendmail.mc.bak \ - ${sysconfdir}/mail/sendmail.mc ; then - cd ${localstatedir}/backups; - /usr/bin/savelog -p -c $copies sendmail.mc.bak > /dev/null; - cp -pf ${sysconfdir}/mail/sendmail.mc \ - ${localstatedir}/backups/sendmail.mc.bak; - fi; - fi; - -# backup "/etc/mail/submit.mc" -if [ -f ${sysconfdir}/mail/submit.mc ]; then - if [ ! -f ${localstatedir}/backups/submit.mc.bak ]; then - cp -pf ${sysconfdir}/mail/submit.mc \ - ${localstatedir}/backups/submit.mc.bak; - fi; - if ! cmp -s ${localstatedir}/backups/submit.mc.bak \ - ${sysconfdir}/mail/submit.mc ; then - cd ${localstatedir}/backups; - /usr/bin/savelog -p -c $copies submit.mc.bak > /dev/null; - cp -pf ${sysconfdir}/mail/submit.mc \ - ${localstatedir}/backups/submit.mc.bak; - fi; - fi; - -# while we're here, might as well do sendmail.cf -if [ -f ${sysconfdir}/mail/sendmail.cf ]; then - if [ ! -f ${localstatedir}/backups/sendmail.cf.bak ]; then - cp -pf ${sysconfdir}/mail/sendmail.cf \ - ${localstatedir}/backups/sendmail.cf.bak; - fi; - if ! cmp -s ${localstatedir}/backups/sendmail.cf.bak \ - ${sysconfdir}/mail/sendmail.cf ; then - cd ${localstatedir}/backups; - # save previous generation only if differences are significant - diff -bBwI "^\#\#\#\#\# " \ - ${localstatedir}/backups/sendmail.cf.bak \ - ${sysconfdir}/mail/sendmail.cf > /dev/null; - if [ $? -ne 0 ]; then - /usr/bin/savelog -p -c $copies sendmail.cf.bak \ - > /dev/null; - fi; - cp -pf ${sysconfdir}/mail/sendmail.cf \ - ${localstatedir}/backups/sendmail.cf.bak; - fi; - fi; - -# while we're here, might as well do submit.cf -if [ -f ${sysconfdir}/mail/submit.cf ]; then - if [ ! -f ${localstatedir}/backups/submit.cf.bak ]; then - cp -pf ${sysconfdir}/mail/submit.cf \ - ${localstatedir}/backups/submit.cf.bak; - fi; - if ! cmp -s ${localstatedir}/backups/submit.cf.bak \ - ${sysconfdir}/mail/submit.cf ; then - cd ${localstatedir}/backups; - # save previous generation only if differences are significant - diff -bBwI "^\#\#\#\#\# " \ - ${localstatedir}/backups/submit.cf.bak \ - ${sysconfdir}/mail/submit.cf > /dev/null; - if [ $? -ne 0 ]; then - /usr/bin/savelog -p -c $copies submit.cf.bak \ - > /dev/null; - fi; - cp -pf ${sysconfdir}/mail/submit.cf \ - ${localstatedir}/backups/submit.cf.bak; - fi; - fi; diff --git a/debian/build/debian/sendmail.dirs.in b/debian/build/debian/sendmail.dirs.in deleted file mode 100644 index 2e2d8f5..0000000 --- a/debian/build/debian/sendmail.dirs.in +++ /dev/null @@ -1 +0,0 @@ -.@docdir@/sendmail diff --git a/debian/build/debian/sendmail.init.d.in b/debian/build/debian/sendmail.init.d.in deleted file mode 100644 index 49caef3..0000000 --- a/debian/build/debian/sendmail.init.d.in +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: sendmail -# Required-Start: $remote_fs $network $syslog -# Required-Stop: $remote_fs $network $syslog -# Should-Start: $named -# Should-Stop: $named -# Default-Start: 2 3 4 5 -# Default-Stop: 1 -# Short-Description: powerful, efficient, and scalable Mail Transport Agent -# Description: Sendmail is an alternative Mail Transport Agent (MTA) -# for Debian. It is suitable for handling sophisticated -# mail configurations, although this means that its -# configuration can also be complex. Fortunately, simple -# thing can be done easily, and complex thing are possible, -# even if not easily understood ;) Sendmail is the *ONLY* -# MTA with a Turing complete language to control *ALL* -# aspects of delivery! -### END INIT INFO - -# Author: Marc-Christian Petersen - -PATH=/bin:/usr/bin:/sbin:/usr/sbin -DESC="Mail Transport Agent (MTA)" -NAME=sendmail -DAEMON=/usr/sbin/$NAME -DAEMON_ARGS="" -SCRIPTNAME=/etc/init.d/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/sendmail ] && . /etc/default/sendmail - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -. /lib/lsb/init-functions - diff --git a/debian/build/debian/sensible-mda.dirs.in b/debian/build/debian/sensible-mda.dirs.in deleted file mode 100644 index a2aeebb..0000000 --- a/debian/build/debian/sensible-mda.dirs.in +++ /dev/null @@ -1,3 +0,0 @@ -.@sbindir@ -.@mandir@ -.@mandir@/man8 diff --git a/debian/build/debian/sensible-mda.preinst.in b/debian/build/debian/sensible-mda.preinst.in deleted file mode 100644 index 118bf17..0000000 --- a/debian/build/debian/sensible-mda.preinst.in +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -set -e - -PACKAGE=sensible-mda; - -if [ -L @docdir@/$PACKAGE ]; then - # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail - rm @docdir@/$PACKAGE -fi -if [ -L /usr/share/bug/$PACKAGE ]; then - rm /usr/share/bug/$PACKAGE -fi - -#DEBHELPER# diff --git a/debian/changelog b/debian/changelog index 33208d9..6a80fe8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,8 @@ sendmail (8.14.4-4.2) UNRELEASED; urgency=low * debian/configure.ac: Fix libdb-dev autodetection. * Simplify managing the bug control files. * Let dh_lintian install the overrides. + * Simplify managing generated control files by placing the templates + directly in debian/. -- Andreas Beckmann Sat, 19 Oct 2013 02:41:51 +0200 diff --git a/debian/configure.ac b/debian/configure.ac index 80178fd..5212aa6 100644 --- a/debian/configure.ac +++ b/debian/configure.ac @@ -1681,52 +1681,35 @@ AC_CONFIG_FILES([build/debian/control.m4],[ m4 ./build/debian/control.m4 > ./build/debian/control; cp ./build/debian/control ./;]) dnl AC_CONFIG_FILES([rules:./build/rules.in], [chmod a+x ./rules]) -AC_CONFIG_FILES([libmilter${sm_libmilter_version}.dirs:./build/debian/libmilter.dirs.in]) +AC_CONFIG_FILES([libmilter${sm_libmilter_version}.dirs:libmilter.dirs.in]) AC_CONFIG_FILES([libmilter${sm_libmilter_version}.lintian-overrides:libmilter.lintian-overrides.in]) -AC_CONFIG_FILES([libmilter${sm_libmilter_version}.preinst:./build/debian/libmilter.preinst.in], - [chmod a+x ./libmilter${sm_libmilter_version}.preinst]) -AC_CONFIG_FILES([libmilter-dev.dirs:./build/debian/libmilter-dev.dirs.in]) -AC_CONFIG_FILES([libmilter-dev.links:./build/debian/libmilter-dev.links.in]) -AC_CONFIG_FILES([libmilter-dev.preinst:./build/debian/libmilter-dev.preinst.in], - [chmod a+x ./libmilter-dev.preinst]) -AC_CONFIG_FILES([rmail.dirs:./build/debian/rmail.dirs.in]) -AC_CONFIG_FILES([rmail.preinst:./build/debian/rmail.preinst.in], - [chmod a+x ./rmail.preinst]) -AC_CONFIG_FILES([sendmail.dirs:./build/debian/sendmail.dirs.in]) -AC_CONFIG_FILES([sendmail-base.dirs:./build/debian/sendmail-base.dirs.in]) -AC_CONFIG_FILES([sendmail-base.postinst:./build/debian/sendmail-base.postinst.in], - [chmod a+x ./sendmail-base.postinst]) -AC_CONFIG_FILES([sendmail-base.postrm:./build/debian/sendmail-base.postrm.in], - [chmod a+x ./sendmail-base.postrm]) -AC_CONFIG_FILES([sendmail-base.preinst:./build/debian/sendmail-base.preinst.in], - [chmod a+x ./sendmail-base.preinst]) -AC_CONFIG_FILES([sendmail-base.prerm:./build/debian/sendmail-base.prerm.in], - [chmod a+x ./sendmail-base.prerm]) -AC_CONFIG_FILES([sendmail-doc.dirs:./build/debian/sendmail-doc.dirs.in]) -AC_CONFIG_FILES([sendmail-doc.preinst:./build/debian/sendmail-doc.preinst.in], - [chmod a+x ./sendmail-doc.preinst]) -AC_CONFIG_FILES([sendmail-cf.dirs:./build/debian/sendmail-cf.dirs.in]) -AC_CONFIG_FILES([sendmail-cf.postrm:./build/debian/sendmail-cf.postrm.in], - [chmod a+x ./sendmail-cf.postrm]) -AC_CONFIG_FILES([sendmail-cf.preinst:./build/debian/sendmail-cf.preinst.in], - [chmod a+x ./sendmail-cf.preinst]) -AC_CONFIG_FILES([sendmail.cron.daily:./build/debian/sendmail.cron.daily.in], - [chmod a+x ./sendmail.cron.daily]) -AC_CONFIG_FILES([sendmail-bin.dirs:./build/debian/sendmail-bin.dirs.in]) -AC_CONFIG_FILES([sendmail.init.d:./build/debian/sendmail.init.d.in:./local/sendmail.in], - [chmod a+x ./sendmail.init.d]) -AC_CONFIG_FILES([sendmail-bin.postinst:./build/debian/sendmail-bin.postinst.in], - [chmod a+x ./sendmail-bin.postinst]) -AC_CONFIG_FILES([sendmail-bin.postrm:./build/debian/sendmail-bin.postrm.in], - [chmod a+x ./sendmail-bin.postrm]) -AC_CONFIG_FILES([sendmail-bin.preinst:./build/debian/sendmail-bin.preinst.in], - [chmod a+x ./sendmail-bin.preinst]) -AC_CONFIG_FILES([sendmail-bin.prerm:./build/debian/sendmail-bin.prerm.in], - [chmod a+x ./sendmail-bin.prerm]) -AC_CONFIG_FILES([sendmail-bin.suid:./build/debian/sendmail-bin.suid.in]) -AC_CONFIG_FILES([sensible-mda.dirs:./build/debian/sensible-mda.dirs.in]) -AC_CONFIG_FILES([sensible-mda.preinst:./build/debian/sensible-mda.preinst.in], - [chmod a+x ./sensible-mda.preinst]) +AC_CONFIG_FILES([libmilter${sm_libmilter_version}.preinst:libmilter.preinst.in]) +AC_CONFIG_FILES([libmilter-dev.dirs]) +AC_CONFIG_FILES([libmilter-dev.links]) +AC_CONFIG_FILES([libmilter-dev.preinst]) +AC_CONFIG_FILES([rmail.dirs]) +AC_CONFIG_FILES([rmail.preinst]) +AC_CONFIG_FILES([sendmail.dirs]) +AC_CONFIG_FILES([sendmail-base.dirs]) +AC_CONFIG_FILES([sendmail-base.postinst]) +AC_CONFIG_FILES([sendmail-base.postrm]) +AC_CONFIG_FILES([sendmail-base.preinst]) +AC_CONFIG_FILES([sendmail-base.prerm]) +AC_CONFIG_FILES([sendmail-doc.dirs]) +AC_CONFIG_FILES([sendmail-doc.preinst]) +AC_CONFIG_FILES([sendmail-cf.dirs]) +AC_CONFIG_FILES([sendmail-cf.postrm]) +AC_CONFIG_FILES([sendmail-cf.preinst]) +AC_CONFIG_FILES([sendmail.cron.daily]) +AC_CONFIG_FILES([sendmail-bin.dirs]) +AC_CONFIG_FILES([sendmail.init.d:sendmail.init.d.in:local/sendmail.in]) +AC_CONFIG_FILES([sendmail-bin.postinst]) +AC_CONFIG_FILES([sendmail-bin.postrm]) +AC_CONFIG_FILES([sendmail-bin.preinst]) +AC_CONFIG_FILES([sendmail-bin.prerm]) +AC_CONFIG_FILES([sendmail-bin.suid]) +AC_CONFIG_FILES([sensible-mda.dirs]) +AC_CONFIG_FILES([sensible-mda.preinst]) AC_CONFIG_FILES([bug-control]) AC_CONFIG_FILES([bug-script]) AC_CONFIG_FILES([cf/Makefile]) diff --git a/debian/libmilter-dev.dirs.in b/debian/libmilter-dev.dirs.in new file mode 100644 index 0000000..fabd44a --- /dev/null +++ b/debian/libmilter-dev.dirs.in @@ -0,0 +1,4 @@ +.@includedir@/libmilter +.@libdir@ +.@libdir@/libmilter +.@docdir@/libmilter-dev diff --git a/debian/libmilter-dev.links.in b/debian/libmilter-dev.links.in new file mode 100644 index 0000000..43a454e --- /dev/null +++ b/debian/libmilter-dev.links.in @@ -0,0 +1,2 @@ +usr/lib/libmilter.so.@sm_libmilter_version@ usr/lib/libmilter/libmilter.so.@sm_libmilter_version@ +usr/lib/libmilter/libmilter.so.@sm_libmilter_version@ usr/lib/libmilter/libmilter.so diff --git a/debian/libmilter-dev.preinst.in b/debian/libmilter-dev.preinst.in new file mode 100644 index 0000000..f132076 --- /dev/null +++ b/debian/libmilter-dev.preinst.in @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + +PACKAGE=libmilter-dev; + +if [ -L @docdir@/$PACKAGE ]; then + # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail + rm @docdir@/$PACKAGE +fi +if [ -L /usr/share/bug/$PACKAGE ]; then + rm /usr/share/bug/$PACKAGE +fi + +#DEBHELPER# diff --git a/debian/libmilter.dirs.in b/debian/libmilter.dirs.in new file mode 100644 index 0000000..2176d5c --- /dev/null +++ b/debian/libmilter.dirs.in @@ -0,0 +1,2 @@ +.@libdir@/libmilter +.@docdir@/libmilter@sm_libmilter_version@ diff --git a/debian/libmilter.preinst.in b/debian/libmilter.preinst.in new file mode 100644 index 0000000..03731bf --- /dev/null +++ b/debian/libmilter.preinst.in @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + +PACKAGE=libmilter@sm_libmilter_version@; + +if [ -L @docdir@/$PACKAGE ]; then + # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail + rm @docdir@/$PACKAGE +fi +if [ -L /usr/share/bug/$PACKAGE ]; then + rm /usr/share/bug/$PACKAGE +fi + +#DEBHELPER# diff --git a/debian/rmail.dirs.in b/debian/rmail.dirs.in new file mode 100644 index 0000000..a2aeebb --- /dev/null +++ b/debian/rmail.dirs.in @@ -0,0 +1,3 @@ +.@sbindir@ +.@mandir@ +.@mandir@/man8 diff --git a/debian/rmail.preinst.in b/debian/rmail.preinst.in new file mode 100644 index 0000000..f1aa978 --- /dev/null +++ b/debian/rmail.preinst.in @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + +PACKAGE=rmail; + +if [ -L @docdir@/$PACKAGE ]; then + # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail + rm @docdir@/$PACKAGE +fi +if [ -L /usr/share/bug/$PACKAGE ]; then + rm /usr/share/bug/$PACKAGE +fi + +#DEBHELPER# diff --git a/debian/sendmail-base.dirs.in b/debian/sendmail-base.dirs.in new file mode 100644 index 0000000..951b1a2 --- /dev/null +++ b/debian/sendmail-base.dirs.in @@ -0,0 +1,56 @@ +.@sysconfdir@/cron.d +.@sysconfdir@/cron.daily +.@sysconfdir@/default +.@sysconfdir@/dhcp +.@sysconfdir@/dhcp/dhclient-exit-hooks.d +.@sysconfdir@/logcheck +.@sysconfdir@/logcheck/ignore.d.paranoid +.@sysconfdir@/logcheck/ignore.d.server +.@sysconfdir@/logcheck/ignore.d.workstation +.@sysconfdir@/logcheck/violations.ignore.d +.@sysconfdir@/logrotate.d +.@sysconfdir@/mail +.@sysconfdir@/mail/m4 +.@sysconfdir@/mail/peers +.@sysconfdir@/mail/smrsh +.@sysconfdir@/mail/sasl +.@sysconfdir@/mail/tls +.@sysconfdir@/network +.@sysconfdir@/network/if-down.d +.@sysconfdir@/network/if-post-down.d +.@sysconfdir@/network/if-up.d +.@sysconfdir@/pam.d +.@sysconfdir@/ppp/ip-down.d +.@sysconfdir@/ppp/ip-up.d +.@sysconfdir@/resolvconf +.@sysconfdir@/resolvconf/update-libc.d +.@bindir@ +.@sbindir@ +.@docdir@/sendmail-base +.@mandir@ +.@mandir@/man1 +.@mandir@/man8 +.@datadir@/sendmail +.@datadir@/sendmail/examples +.@datadir@/sendmail/examples/db +.@datadir@/sendmail/examples/dhcp +.@datadir@/sendmail/examples/dhcp/dhclient-exit-hooks.d +.@datadir@/sendmail/examples/ppp +.@datadir@/sendmail/examples/ppp/ip-down.d +.@datadir@/sendmail/examples/ppp/ip-up.d +.@datadir@/sendmail/examples/ldap +.@datadir@/sendmail/examples/logcheck +.@datadir@/sendmail/examples/logcheck/ignore.d.paranoid +.@datadir@/sendmail/examples/logcheck/ignore.d.server +.@datadir@/sendmail/examples/logcheck/ignore.d.workstation +.@datadir@/sendmail/examples/logcheck/violations.ignore.d +.@datadir@/sendmail/examples/milter +.@datadir@/sendmail/examples/network +.@datadir@/sendmail/examples/network/if-down.d +.@datadir@/sendmail/examples/network/if-post-down.d +.@datadir@/sendmail/examples/network/if-up.d +.@datadir@/sendmail/examples/pam.d +.@datadir@/sendmail/examples/resolvconf +.@datadir@/sendmail/examples/resolvconf/update-libc.d +.@datadir@/sendmail/examples/sasl +.@datadir@/sendmail/examples/tls diff --git a/debian/sendmail-base.postinst.in b/debian/sendmail-base.postinst.in new file mode 100644 index 0000000..769e441 --- /dev/null +++ b/debian/sendmail-base.postinst.in @@ -0,0 +1,116 @@ +#!/bin/sh -e +# +# Debian post installation script +# +# Install of already installed package: +# 1) old-prerm upgrade new-version +# *) new-prerm failed-upgrade old-version +# *) old-postinst abort-upgrade new-version +# +# If a `conflicting' package is being removed at the same time: +# 1) forall packages depending on conflicting package and --auto-deconfigure +# deconfigured's-prerm deconfigure \ +# in-favour package-being-installed version \ +# removing conflicting-package version +# *) deconfigured's-postinst abort-deconfigure \ +# in-favour package-being-installed-but-failed version \ +# removing conflicting-package version +# 2) To prepare for removal of the conflicting package +# conflictor's-prerm remove \ +# in-favour package new-version +# *) conflictor's-postinst abort-remove \ +# in-favour package new-version +# +# Configuration of package: +# postinst configure most-recently-configured-version +# +set -e; + +PACKAGE=sendmail-base; + +# do we have debconf? +if [ -f /usr/share/debconf/confmodule ]; then + DEBCONF=true; + #. /usr/share/debconf/confmodule; + #db_stop; # For testing +else + DEBCONF=''; + fi; + +case "$1" in + configure) + #----------------------------------------------------------- + if [ "$2" = "" ]; then + :; + #echo " "; + #echo "A new sendmail user, welcome!"; + fi; + + #----------------------------------------------------------- + # Tell users about new and interesting things... + if [ -x @datadir@/sendmail/update_notices ]; then + @datadir@/sendmail/update_notices $2; + fi; + + #----------------------------------------------------------- + # Create group/user smmta/smmsp iff needed + touch @sysconfdir@/mail/tsmmta; + if ! chown root:smmta @sysconfdir@/mail/tsmmta 2>/dev/null; then + addgroup --system --quiet smmta; + fi; + if ! chown smmta:smmta @sysconfdir@/mail/tsmmta 2>/dev/null; then + adduser --system --ingroup smmta --home "/var/lib/sendmail" \ + --disabled-password \ + --quiet --gecos 'Mail Transfer Agent' smmta; + fi; + rm @sysconfdir@/mail/tsmmta; + touch @sysconfdir@/mail/tsmmsp; + if ! chown root:smmsp @sysconfdir@/mail/tsmmsp 2>/dev/null; then + addgroup --system --quiet smmsp; + fi; + if ! chown smmsp:smmsp @sysconfdir@/mail/tsmmsp 2>/dev/null; then + adduser --system --ingroup smmsp --home "/var/lib/sendmail" \ + --disabled-password \ + --quiet --gecos 'Mail Submission Program' smmsp; + fi; + rm @sysconfdir@/mail/tsmmsp; + + #----------------------------------------------------------- + # With a dynamic uid/gid, have to set appropriate ownership herein + chown root:smmsp @sysconfdir@/mail/sasl; + chown root:smmsp @sysconfdir@/mail/tls; + + #----------------------------------------------------------- + # Save the current configuration files in safe place... + if [ -x @sysconfdir@/cron.daily/sendmail ]; then + echo "Saving current /etc/mail/sendmail.mc,cf to /var/backups"; + @sysconfdir@/cron.daily/sendmail || true; + fi; + + #----------------------------------------------------------- + # Make sure inetd.conf has sendmail in it (but disabled) + if [ -x /usr/sbin/update-inetd ]; then + update-inetd --remove "^587"; + update-inetd --group MAIL --add \ + "smtp\tstream\ttcp\tnowait\troot\t@sbindir@/sendmail sendmail -Am -bs"; + update-inetd --group MAIL --add \ + "submission\tstream\ttcp\tnowait\troot\t@sbindir@/sendmail sendmail -Am -bs"; + update-inetd --group MAIL --add \ + "smtps\tstream\ttcp\tnowait\troot\t@sbindir@/sendmail sendmail -Am -bs"; + update-inetd --group MAIL --multi --disable smtp,smtps,submission; + fi; + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + exit 0; + ;; + + *) + echo "$PACKAGE postinst called with unknown argument \`$1'" >&2; + exit 1; + ;; + esac; + +#DEBHELPER# +exit 0; diff --git a/debian/sendmail-base.postrm.in b/debian/sendmail-base.postrm.in new file mode 100644 index 0000000..5a68568 --- /dev/null +++ b/debian/sendmail-base.postrm.in @@ -0,0 +1,113 @@ +#!/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-base; + +case "$1" in + remove) + if [ ! -z "$2" ]; then + echo "Removing $PACKAGE $2 $3($4)"; + fi; + + if [ -x /usr/sbin/update-inetd ]; then + update-inetd --remove "^smtp"; + update-inetd --remove "^smtps"; + update-inetd --remove "^submission"; + fi; + ;; + + purge) + # Currently, dh_installdebconf doesn't do db_stop... ensure it is done! + if [ "$1" = "purge" ] && [ -e /usr/share/debconf/confmodule ]; then + # Source debconf library. + . /usr/share/debconf/confmodule; + # Make sure we're done + #db_stop; + # Remove my changes to the db. + db_purge; + fi; + + # Remove user/group smmsp + if [ -x /usr/sbin/deluser ]; then + deluser --quiet smmta || true; + deluser --quiet smmsp || true; + fi; + userdel smmta 2>/dev/null || true; + groupdel smmta 2>/dev/null || true; + userdel smmsp 2>/dev/null || true; + groupdel smmsp 2>/dev/null || true; + + # Purge those files installed in other package directories + rm -f @libdir@/lib/sasl/Sendmail.conf; + rm -f @sysconfdir@/certs/sendmail.pem; + rm -f @datadir@/bug/sendmail*; + rmdir --ignore-fail-on-non-empty @datadir@/bug; + rm -f @sysconfdir@/logrotate.d/sendmail; + rmdir --ignore-fail-on-non-empty @sysconfdir@/logrotate.d; + rm -f @sysconfdir@/logcheck/violations.ignore.d/sendmail; + rmdir --ignore-fail-on-non-empty @sysconfdir@/logcheck/violations.ignore.d; + rmdir --ignore-fail-on-non-empty @sysconfdir@/logcheck; + # Can't touch these as they may be included in slapd.conf + #rm -rf @sysconfdir@/ldap/schema/sendmail.schema; + #rm -rf @sysconfdir@/openldap/sendmail.schema; + #rm -rf @sysconfdir@/umich-ldap/sendmail.schema; + # Purge psuedo conffiles (managed by sendmail) + rm -f @sysconfdir@/mail/sendmail.conf; + # Purge sendmail configuration files + rm -f @sysconfdir@/mail/sendmail.mc \ + @sysconfdir@/mail/submit.mc \ + @sysconfdir@/mail/m4/dialup.m4 \ + @sysconfdir@/mail/m4/provider.m4 \ + @sysconfdir@/mail/local-host-names \ + @sysconfdir@/mail/relay-domains \ + @sysconfdir@/mail/trusted-users \ + @sysconfdir@/mail/default-auth-info \ + @sysconfdir@/mail/access \ + ; + rmdir @sysconfdir@/mail/peers 2>/dev/null || true; + rmdir @sysconfdir@/mail 2>/dev/null || true; + + ;; + + upgrade) + ;; + + failed-upgrade|abort-install|abort-upgrade|disappear) + echo "$1 of $PACKAGE $2"; + ;; + + *) + echo "$PACKAGE postrm called with unknown argument \`$1'" >&2; + exit 1; + ;; + esac; + +# NOTE WELL: If we fall through here during purge, update-rc.d will be +# called with remove... and /etc/init.d/$PACKAGE goes away! +#DEBHELPER# + +exit 0; diff --git a/debian/sendmail-base.preinst.in b/debian/sendmail-base.preinst.in new file mode 100644 index 0000000..1091ddc --- /dev/null +++ b/debian/sendmail-base.preinst.in @@ -0,0 +1,59 @@ +#!/bin/sh -e +# +# Debian pre install 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 +# +set -e; + +PACKAGE=sendmail-base; + +if [ -L @docdir@/$PACKAGE ]; then + # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail + rm @docdir@/$PACKAGE +fi +if [ -L /usr/share/bug/$PACKAGE ]; then + rm /usr/share/bug/$PACKAGE +fi + +if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "8.14.4-2.2~"; then + # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail + rm -rf @docdir@/sendmail/examples + rm -f @docdir@/sendmail/Debian-specific.gz + rm -f @docdir@/sendmail/site.config.m4.gz +fi + + +case "$1" in + upgrade) + # Prevent cronjob from running during upgrade... + if [ -f @sysconfdir@/cron.d/sendmail ]; then + echo "#preinst" > @sysconfdir@/cron.d/sendmail; + fi; + + # Move files to new home + if [ -d @sysconfdir@/mail/ssl ]; then + mv -f @sysconfdir@/mail/ssl @sysconfdir@/mail/tls; + fi; + ;; + + install|abort-upgrade) + ;; + + *) + echo "$PACKAGE preinst called with unknown argument \`$1'" >&2; + exit 1; + ;; + esac; + +#DEBHELPER# +exit 0; diff --git a/debian/sendmail-base.prerm.in b/debian/sendmail-base.prerm.in new file mode 100644 index 0000000..28941ad --- /dev/null +++ b/debian/sendmail-base.prerm.in @@ -0,0 +1,138 @@ +#!/bin/sh -e +# +# Debian pre removal script +# +# Install of already installed package: +# 1) old-prerm upgrade new-version +# *) new-prerm failed-upgrade old-version +# *) old-postinst abort-upgrade new-version +# +# If a `conflicting' package is being removed at the same time: +# 1) forall packages depending on conflicting package and --auto-deconfigure +# deconfigured's-prerm deconfigure \ +# in-favour package-being-installed version \ +# removing conflicting-package version +# *) deconfigured's-postinst abort-deconfigure \ +# in-favour package-being-installed-but-failed version \ +# removing conflicting-package version +# 2) To prepare for removal of the conflicting package +# conflictor's-prerm remove \ +# in-favour package new-version +# *) conflictor's-postinst abort-remove \ +# in-favour package new-version +# +# 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. +# +set -e; + +PACKAGE=sendmail-base; + +case "$1" in + remove) + if [ ! -z "$2" ]; then + echo "Removing $PACKAGE $2 $3($4)"; + fi; + + if [ -x /usr/sbin/update-inetd ]; then + update-inetd --group MAIL --disable smtp,smtps,submission; + fi; + + # Make sure /etc/aliases is left (move it from /etc/mail if needed) + if [ -L @sysconfdir@/mail/aliases ]; then + rm -f @sysconfdir@/mail/aliases; + elif [ -f @sysconfdir@/mail/aliases ] \ + && [ -L /etc/aliases ]; then + mv @sysconfdir@/mail/aliases /etc/aliases; + fi; + + # Remove psuedo conffiles (managed by sendmail) + rm -f @sysconfdir@/cron.d/sendmail; + + # Remove files scattered across the system that + # happened to be created by sendmail + rm -f @libdir@/sasl/Sendmail.conf; + + # Remove those files created by sendmail + rm -rf @localstatedir@/lib/sendmail; + rm -rf @localstatedir@/run/sendmail; + # Note: syslog really owns these files + #rm -f @localstatedir@/log/mail/*; + #rm -f @localstatedir@/log/mail.log; + # Note: these can lead to a loss of mail!!!! + if [ -x @sysconfdir@/init.d/sendmail ]; then + @sysconfdir@/init.d/sendmail clean; + fi; + if [ -L @localstatedir@/spool/mqueue ]; then + rmdir --ignore-fail-on-non-empty \ + `readlink -fn @localstatedir@/spool/mqueue`; + elif [ -d @localstatedir@/spool/mqueue ]; then + rmdir --ignore-fail-on-non-empty \ + @localstatedir@/spool/mqueue; + fi; + if [ -L @localstatedir@/spool/mqueue-client ]; then + rmdir --ignore-fail-on-non-empty \ + `readlink -fn @localstatedir@/spool/mqueue-client`; + elif [ -d @localstatedir@/spool/mqueue-client ]; then + rmdir --ignore-fail-on-non-empty \ + @localstatedir@/spool/mqueue-client; + fi; + + # Remove sendmail built configuration files + rm -f @sysconfdir@/mail/*.db \ + @sysconfdir@/mail/*.dir \ + @sysconfdir@/mail/*.pag; + rm -f @sysconfdir@/mail/sendmail.cf \ + @sysconfdir@/mail/sendmail.cf.old \ + @sysconfdir@/mail/sendmail.cf.errors \ + @sysconfdir@/mail/sendmail.mc.old \ + @sysconfdir@/mail/submit.cf \ + @sysconfdir@/mail/submit.cf.errors \ + @sysconfdir@/mail/submit.mc.old \ + @sysconfdir@/mail/databases \ + @sysconfdir@/mail/Makefile \ + ; + rm -rf @sysconfdir@/mail/smrsh \ + @sysconfdir@/mail/sasl \ + @sysconfdir@/mail/tls; + + # Remove empty files (probably touched databases) + find @sysconfdir@/mail -maxdepth 1 -size 0 | xargs -r rm; + ;; + + upgrade) + # Potentially move the old configuration file to the new name - + # before it gets deleted (for not existing in the new package) + mv -f @sysconfdir@/default/sendmail \ + @sysconfdir@/mail/sendmail.conf 2>/dev/null || true; + + # Prevent cronjob from running during upgrade... + if [ -f /etc/cron.d/sendmail ]; then + echo "#prerm" > @sysconfdir@/cron.d/sendmail; + fi; + ;; + + failed-upgrade) + ;; + + deconfigure) + echo "Deconfigure of $PACKAGE $2 $3($4) $5 $6($7) "; + ;; + + *) + echo "$PACKAGE prerm called with unknown argument \`$1'" >&2; + exit 1; + ;; + esac; + +# The @DEBHELPER@ stuff causes problems with upgrades because of the +# length of time that Sendmail is stopped... + +# +# Included for sanity checks +# +#DEBHELPER# +exit 0; diff --git a/debian/sendmail-bin.dirs.in b/debian/sendmail-bin.dirs.in new file mode 100644 index 0000000..b3b51ed --- /dev/null +++ b/debian/sendmail-bin.dirs.in @@ -0,0 +1,12 @@ +.@sysconfdir@/cron.daily +.@sysconfdir@/init.d +.@bindir@ +.@sbindir@ +.@libexecdir@ +.@docdir@/sendmail-bin +.@mandir@ +.@mandir@/man1 +.@mandir@/man5 +.@mandir@/man8 +.@localstatedir@/spool/mqueue +.@localstatedir@/spool/mqueue-client diff --git a/debian/sendmail-bin.postinst.in b/debian/sendmail-bin.postinst.in new file mode 100644 index 0000000..484c83e --- /dev/null +++ b/debian/sendmail-bin.postinst.in @@ -0,0 +1,320 @@ +#!/bin/sh -e +# +# Debian post installation script +# +# Install of already installed package: +# 1) old-prerm upgrade new-version +# *) new-prerm failed-upgrade old-version +# *) old-postinst abort-upgrade new-version +# +# If a `conflicting' package is being removed at the same time: +# 1) forall packages depending on conflicting package and --auto-deconfigure +# deconfigured's-prerm deconfigure \ +# in-favour package-being-installed version \ +# removing conflicting-package version +# *) deconfigured's-postinst abort-deconfigure \ +# in-favour package-being-installed-but-failed version \ +# removing conflicting-package version +# 2) To prepare for removal of the conflicting package +# conflictor's-prerm remove \ +# in-favour package new-version +# *) conflictor's-postinst abort-remove \ +# in-favour package new-version +# +# Configuration of package: +# postinst configure most-recently-configured-version +# +set -e; + +PACKAGE=sendmail-bin; + +#----------------------------------------------------------- +#stop(): stop sendmail +stop_mta () { + # Account for varying PIDfile locations of older sendmail packages + if [ -f /var/run/sendmail/mta/sendmail.pid ]; then + start-stop-daemon --stop --oknodo --quiet \ + --pidfile /var/run/sendmail/msp/sendmail.pid > /dev/null; + start-stop-daemon --stop --oknodo --quiet \ + -pidfile /var/run/sendmail/mta/sendmail.pid > /dev/null; + elif [ -f /var/run/sendmail/sendmail.pid ]; then + start-stop-daemon --stop --oknodo --quiet \ + --pidfile /var/run/sendmail/sendmail.pid > /dev/null; + elif [ -f /var/run/sendmail.pid ]; then + start-stop-daemon --stop --oknodo --quiet \ + --pidfile /var/run/sendmail.pid > /dev/null; + fi; + # Since we changed the executable, do one more try - using the old name + if [ -f /var/run/sendmail/mta/sendmail.pid ]; then + start-stop-daemon --stop --oknodo --quiet \ + --pidfile /var/run/sendmail/mta/sendmail.pid > /dev/null; + fi; + start-stop-daemon --stop --oknodo --quiet \ + --name sendmail > /dev/null; + if [ -x @sysconfdir@/init.d/sendmail ]; then + if [ -x /usr/sbin/invoke-rc.d ]; then + /usr/sbin/invoke-rc.d --quiet --force sendmail stop; + else + @sysconfdir@/init.d/sendmail stop; + fi; + fi; + }; + +#----------------------------------------------------------- +#start(): start sendmail +start_mta () { + if [ -x /usr/sbin/invoke-rc.d ]; then + /usr/sbin/invoke-rc.d sendmail start; + else + @sysconfdir@/init.d/sendmail start; + fi; + }; + +#----------------------------------------------------------- +# configure(): save sendmail.cf, call sendmailconfig +configure_mta () { + local enter; + echo -n "Configure now ? (y/N) "; + read yn; + yn=$(echo -n "$yn" | sed -e "s/^\ *//" -e "s/^\t*//"); + test -n "$yn" || yn="N"; + case "$yn" in + [Yy]*) + stop_mta; + @sbindir@/sendmailconfig --no-reload; + start_mta; + ;; + + [Nn]*) + echo ''; + echo "To configure sendmail later, type" \ + "sendmailconfig"; + echo "After configuring sendmail, you can" \ + "start it via @sysconfdir@/init.d/sendmail start"; + echo -n "Press [ENTER] "; + read enter; + ;; + esac; + }; + +# do we have debconf? +if [ -f /usr/share/debconf/confmodule ]; then + DEBCONF=true; + #. /usr/share/debconf/confmodule; + #db_stop; # For testing +else + DEBCONF=''; + fi; + +case "$1" in + configure) + # continue below + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + exit 0; + ;; + + *) + echo "$PACKAGE postinst called with unknown argument \`$1'" >&2; + exit 1; + ;; + esac; + +#-------------------------------------------------------------------- +# Continuation of "$1" = "configure" + +# Note: can't use debhelper here because the actions aren't contiguous +#xxxHELPER# + +# Automatically added by dh_installinit +if [ -x "@sysconfdir@/init.d/sendmail" ]; then + update-rc.d -f sendmail remove >/dev/null; + update-rc.d sendmail defaults 21 19 >/dev/null; + #/etc/init.d/sendmail start +fi +# End automatically added section + +#----------------------------------------------------------- +# Create (or update) MTA, MSP alternatives +# This way, we'll be able to install 2 MTAs on the same box :) +update-alternatives \ + --install @sbindir@/sendmail-mta sendmail-mta @libexecdir@/sendmail 25 \ + --slave @mandir@/man8/sendmail-mta.8.gz sendmail-mta.8.gz \ + @mandir@/man8/sendmail.sendmail.8.gz \ + --slave @sbindir@/runq runq @datadir@/sendmail/runq \ + --slave @mandir@/man8/runq.8.gz runq.8.gz \ + @mandir@/man8/runq.sendmail.8.gz \ + --slave @sbindir@/newaliases newaliases \ + @datadir@/sendmail/newaliases \ + --slave @mandir@/man8/newaliases.8.gz newaliases.8.gz \ + @mandir@/man8/newaliases.sendmail.8.gz \ + --slave @bindir@/mailq mailq @datadir@/sendmail/mailq \ + --slave @mandir@/man1/mailq.1.gz mailq.1.gz \ + @mandir@/man1/mailq.sendmail.1.gz \ + --slave @mandir@/man5/aliases.5.gz aliases.5.gz \ + @mandir@/man5/aliases.sendmail.5.gz \ + ; +update-alternatives \ + --install @sbindir@/sendmail-msp sendmail-msp @libexecdir@/sendmail 25 \ + --slave @mandir@/man8/sendmail-msp.8.gz sendmail-msp.8.gz \ + @mandir@/man8/sendmail.sendmail.8.gz \ + --slave @sbindir@/sendmail sendmail @libexecdir@/sendmail \ + --slave @libdir@/sendmail lib.sendmail @libexecdir@/sendmail \ + --slave @mandir@/man8/sendmail.8.gz sendmail.8.gz \ + @mandir@/man8/sendmail.sendmail.8.gz \ + ; + +#----------------------------------------------------------- +# With a dynamic uid/gid, have to set appropriate ownership herein +if command -v suidregister >/dev/null 2>&1 && test -s /etc/suid.conf; then + suidregister -s sendmail @sbindir@/sendmail root smmsp 02755; + suidregister -s sendmail @libexecdir@/mailstats root smmsp 02755; +elif [ -x @sbindir@/sendmail ]; then + chown root:smmsp @libexecdir@/sendmail; + chmod 02755 @libexecdir@/sendmail; + chown root:smmsp @libexecdir@/mailstats; + chmod 02755 @libexecdir@/mailstats; + fi; + +#----------------------------------------------------------- +# Create backups of /etc/mail/{sendmail,submit}.mc +if [ -f @sysconfdir@/mail/sendmail.cf ]; then + echo "Saving old /etc/mail/sendmail.cf" \ + "as /etc/mail/sendmail.cf.old ..."; + cp -f @sysconfdir@/mail/sendmail.cf \ + @sysconfdir@/mail/sendmail.cf.old; + chown root:root @sysconfdir@/mail/sendmail.cf.old; + chmod 0644 @sysconfdir@/mail/sendmail.cf.old; + fi; +if [ -f @sysconfdir@/mail/submit.cf ]; then + cp -f @sysconfdir@/mail/submit.cf \ + @sysconfdir@/mail/submit.cf.old; + chown root:root @sysconfdir@/mail/submit.cf.old; + chmod 0644 @sysconfdir@/mail/submit.cf.old; + fi; + +start_ask=0; + +#----------------------------------------------------------- +# Create /etc/mail/sendmail.mc if it doesn't exist +if [ ! -f @sysconfdir@/mail/sendmail.mc ]; then + cat <<-EOT + + You are doing a new install, or have erased /etc/mail/sendmail.mc. + If you've accidentaly erased /etc/mail/sendmail.mc, check /var/backups. + + I am creating a safe, default sendmail.mc for you and you can + run sendmailconfig later if you need to change the defaults. + + EOT + fi; + +if [ -x @datadir@/sendmail/update_sendmail ]; then + stop_mta; + echo "Updating sendmail environment ..."; + @datadir@/sendmail/update_sendmail || true; + start_mta; + fi; +exit 0; + + +#----------------------------------------------------------- +# See if we can do this automagically... +cat <<-EOT + +It is a good idea to regenerate the sendmail configuration +file with each new spin of the sendmail package. + +But, if you hand edit sendmail.cf instead of making changes through +sendmail.mc, then you want to say no, save your old sendmail.cf, run +sendmailconfig, then migrate your changes into the new version. + +EOT +echo -n "Automagically regenerate the sendmail.cf configuration file? (Y/n) "; +read yn; +yn=$(echo -n "$yn" | sed -e "s/^\ *//" -e "s/^\t*//"); +test -n "$yn" || yn="Y"; +case "$yn" in + [Yy]*) + if [ -f @sysconfdir@/mail/sendmail.cf ]; then + echo "Saving old /etc/mail/sendmail.cf" \ + "as /etc/mail/sendmail.cf.old ..."; + cp -f @sysconfdir@/mail/sendmail.cf \ + @sysconfdir@/mail/sendmail.cf.old; + chown root:root @sysconfdir@/mail/sendmail.cf.old; + chmod 0644 @sysconfdir@/mail/sendmail.cf.old; + fi; + if [ -f @sysconfdir@/mail/submit.cf ]; then + cp -f @sysconfdir@/mail/submit.cf \ + @sysconfdir@/mail/submit.cf.old; + chown root:root @sysconfdir@/mail/submit.cf.old; + chmod 0644 @sysconfdir@/mail/submit.cf.old; + fi; + if [ -x @datadir@/sendmail/update_sendmail ]; then + stop_mta; + echo "Updating sendmail environment ..."; + @datadir@/sendmail/update_sendmail || true; + fi; + ;; + + [Nn]*) + cat <<-EOT + + Your files (sendmail.mc,cf, etc) have *not* been altered. + + *** Warning *** Warning *** Warning *** Warning *** Warning *** Warning *** + + There have been changes in + * Paths of some databases and executables + * FEATUREs, DOMAIN, includes + * Internal Database storage + + These changes were *NOT* made for you ... And will not be + until you run sendmailconfig! + + Until you update /etc/mail/sendmail.cf via sendmailconfig, + you should expect to have problems running sendmail! + + "Well, a pet peeve of mine is people who directly edit the + .cf file instead of using the m4 configuration files. + Don't do it! [laughs] I treat the .cf file as a binary + file - you should too." + -- Eric Allman 1999/10/18 + + *** Warning *** Warning *** Warning *** Warning *** Warning *** Warning *** + + EOT + echo "Do you wish to run sendmailconfig now, or later"; + start_ask=0; + configure_mta; + case "$yn" in + [Yy]*) + cat <<-EOT + + Do you wish to start sendmail with the new sendmail.cf, + or do you wish to delay until you can merge any changes + from your older sendmail.cf.old? + EOT + start_ask=1; + start_mta; + ;; + esac; + exit 0; + esac; + +#----------------------------------------------------------- +# If we're still here, we're going the automagic path... +# Now, liberal application of smoke and mirrors +if [ -f @sysconfdir@/mail/sendmail.mc ]; then + start_ask=1; + start_mta; + fi; + +exit 0; + +#----------------------------------------------------------- +# +# List herein (for reference) what debhelper would've done: +#DEBHELPER# +exit 0; diff --git a/debian/sendmail-bin.postrm.in b/debian/sendmail-bin.postrm.in new file mode 100644 index 0000000..4fafe4e --- /dev/null +++ b/debian/sendmail-bin.postrm.in @@ -0,0 +1,88 @@ +#!/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-bin; + +case "$1" in + remove) + if [ ! -z "$2" ]; then + echo "Removing $PACKAGE $2 $3($4)"; + if [ "$PACKAGE" = 'sendmail' ] && [ "$3" = 'sendmail-tls' ] || \ + [ "$PACKAGE" = 'sendmail-tls' ] && [ "$3" = 'sendmail' ]; then + echo '...Nothing to do...'; + exit 0; + fi; + fi; + ;; + + purge) + # If postrm is called *AND* there are no files, exit quickly + # (This is a *GROSS* hack... beter use the test below) + #if [ ! -s `echo "$0" | sed -e 's/postrm$/list/'` ]; then + # echo "Purging replaced package $PACKAGE, nothing to do..."; + # exit 0; + # fi; + + # We're *really* purging; neither sendmail nor sendmail-tls + # is currently installed + if [ -f @libexecdir@/sendmail ]; then + echo "Purging replaced package $PACKAGE, nothing to do..."; + exit 0; + fi; + + # Currently, dh_installdebconf doesn't do db_stop... ensure it is done! + if [ "$1" = "purge" ] && [ -e /usr/share/debconf/confmodule ]; then + # Source debconf library. + . /usr/share/debconf/confmodule; + # Make sure we're done + #db_stop; + # Remove my changes to the db. + db_purge; + fi; + + rm -f @sysconfdir@/mail/sendmail.cf.old + rm -f @sysconfdir@/mail/submit.cf.old + ;; + + upgrade) + ;; + + failed-upgrade|abort-install|abort-upgrade|disappear) + echo "$1 of $PACKAGE $2"; + ;; + + *) + echo "$PACKAGE postrm called with unknown argument \`$1'" >&2; + exit 1; + ;; + esac; + +# NOTE WELL: If we fall through here during purge, update-rc.d will be +# called with remove... and /etc/init.d/$PACKAGE goes away! +#DEBHELPER# + +exit 0; diff --git a/debian/sendmail-bin.preinst.in b/debian/sendmail-bin.preinst.in new file mode 100644 index 0000000..b45a775 --- /dev/null +++ b/debian/sendmail-bin.preinst.in @@ -0,0 +1,52 @@ +#!/bin/sh -e +# +# Debian pre install 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 +# +set -e; + +PACKAGE=sendmail-bin; + +# do we have debconf? +if [ -f /usr/share/debconf/confmodule ]; then + DEBCONF=true; + . /usr/share/debconf/confmodule; +else + DEBCONF=''; + fi; + +case "$1" in + install) + ;; + + upgrade) + # DPKG doesn't overwrite directories with symlinks... + rm -rf @libdir@/sendmail 2>/dev/null || true; + + # Prevent cronjob from running during upgrade... + if [ -f /etc/cron.d/sendmail ]; then + echo "#preinst" > @sysconfdir@/cron.d/sendmail; + fi; + ;; + + abort-upgrade) + ;; + + *) + echo "$PACKAGE preinst called with unknown argument \`$1'" >&2; + exit 1; + ;; + esac; + +#DEBHELPER# +exit 0; diff --git a/debian/sendmail-bin.prerm.in b/debian/sendmail-bin.prerm.in new file mode 100644 index 0000000..a478620 --- /dev/null +++ b/debian/sendmail-bin.prerm.in @@ -0,0 +1,90 @@ +#!/bin/sh -e +# +# Debian pre removal script +# +# Install of already installed package: +# 1) old-prerm upgrade new-version +# *) new-prerm failed-upgrade old-version +# *) old-postinst abort-upgrade new-version +# +# If a `conflicting' package is being removed at the same time: +# 1) forall packages depending on conflicting package and --auto-deconfigure +# deconfigured's-prerm deconfigure \ +# in-favour package-being-installed version \ +# removing conflicting-package version +# *) deconfigured's-postinst abort-deconfigure \ +# in-favour package-being-installed-but-failed version \ +# removing conflicting-package version +# 2) To prepare for removal of the conflicting package +# conflictor's-prerm remove \ +# in-favour package new-version +# *) conflictor's-postinst abort-remove \ +# in-favour package new-version +# +# 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. +# +set -e; + +PACKAGE=sendmail-bin; + +case "$1" in + remove) + if [ ! -z "$2" ]; then + echo "Removing $PACKAGE $2 $3($4)"; + if [ "$PACKAGE" = 'sendmail' ] && [ "$3" = 'sendmail-tls' ] || \ + [ "$PACKAGE" = 'sendmail-tls' ] && [ "$3" = 'sendmail' ]; then + echo '...Nothing to do...'; + exit 0; + fi; + fi; + # Remove alternatives for MTA, MSP + update-alternatives --remove sendmail-mta @libexecdir@/sendmail; + update-alternatives --remove sendmail-msp @libexecdir@/sendmail; + if [ -x @sysconfdir@/init.d/sendmail ] && \ + [ -x @datadir@/sendmail/sendmail ]; then + if [ -x /usr/sbin/invoke-rc.d ]; then + /usr/sbin/invoke-rc.d --quiet --force sendmail stop; + else + @sysconfdir@/init.d/sendmail stop; + fi; + fi; + # Prevent cronjob from running during upgrade... + if [ -f /etc/cron.d/sendmail ]; then + rm -f @sysconfdir@/cron.d/sendmail; + fi; + ;; + + upgrade) + # Prevent cronjob from running during upgrade... + if [ -f /etc/cron.d/sendmail ]; then + echo "#prerm" > @sysconfdir@/cron.d/sendmail; + fi; + + # NOTE NOTE NOTE NOTE NOTE + # If we fall through to DEBHELPER, sendmail will be stopped + # much earlier than necessary !!! + exit 0; + ;; + + failed-upgrade) + ;; + + deconfigure) + echo "Deconfigure of $PACKAGE $2 $3($4) $5 $6($7) "; + ;; + + *) + echo "$PACKAGE prerm called with unknown argument \`$1'" >&2; + exit 1; + ;; + esac; + +# +# Included for sanity checks +# +#DEBHELPER# +exit 0; diff --git a/debian/sendmail-bin.suid.in b/debian/sendmail-bin.suid.in new file mode 100644 index 0000000..32469ca --- /dev/null +++ b/debian/sendmail-bin.suid.in @@ -0,0 +1,2 @@ +@sbindir@/sendmail +@libexecdir@/mailstats diff --git a/debian/sendmail-cf.dirs.in b/debian/sendmail-cf.dirs.in new file mode 100644 index 0000000..837ffae --- /dev/null +++ b/debian/sendmail-cf.dirs.in @@ -0,0 +1,11 @@ +.@docdir@/sendmail-cf +.@datadir@/sendmail/cf +.@datadir@/sendmail/cf/cf +.@datadir@/sendmail/cf/debian +.@datadir@/sendmail/cf/domain +.@datadir@/sendmail/cf/feature +.@datadir@/sendmail/cf/hack +.@datadir@/sendmail/cf/m4 +.@datadir@/sendmail/cf/mailer +.@datadir@/sendmail/cf/ostype +.@datadir@/sendmail/cf/sh diff --git a/debian/sendmail-cf.postrm.in b/debian/sendmail-cf.postrm.in new file mode 100644 index 0000000..606ec49 --- /dev/null +++ b/debian/sendmail-cf.postrm.in @@ -0,0 +1,52 @@ +#!/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-cf; + +case "$1" in + remove) + # Make sure the data directory is *clean* + rm -rf @datadir@/sendmail/cf + ;; + + 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 --git a/debian/sendmail-cf.preinst.in b/debian/sendmail-cf.preinst.in new file mode 100644 index 0000000..d81e779 --- /dev/null +++ b/debian/sendmail-cf.preinst.in @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + +PACKAGE=sendmail-cf; + +if [ -L @docdir@/$PACKAGE ]; then + # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail + rm @docdir@/$PACKAGE +fi +if [ -L /usr/share/bug/$PACKAGE ]; then + rm /usr/share/bug/$PACKAGE +fi + +#DEBHELPER# diff --git a/debian/sendmail-doc.dirs.in b/debian/sendmail-doc.dirs.in new file mode 100644 index 0000000..b078e7f --- /dev/null +++ b/debian/sendmail-doc.dirs.in @@ -0,0 +1,5 @@ +.@docdir@/sendmail-doc +.@docdir@/sendmail-doc/libmilter +.@docdir@/sendmail-doc/libmilter/html +.@docdir@/sendmail-doc/op +.@docdir@/sendmail-doc/sendmail diff --git a/debian/sendmail-doc.preinst.in b/debian/sendmail-doc.preinst.in new file mode 100644 index 0000000..6f2724a --- /dev/null +++ b/debian/sendmail-doc.preinst.in @@ -0,0 +1,28 @@ +#!/bin/sh +set -e + +PACKAGE=sendmail-doc; + +if [ -L @docdir@/$PACKAGE ]; then + # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail + rm @docdir@/$PACKAGE +fi +if [ -L /usr/share/bug/$PACKAGE ]; then + rm /usr/share/bug/$PACKAGE +fi + +if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "8.14.4-2.2~"; then + # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail + rm -rf @docdir@/sendmail/libmilter/ + rm -rf @docdir@/sendmail/op/ + rm -rf @docdir@/sendmail/sendmail/ + rm -f @docdir@/sendmail/Debian-specific.gz + rm -f @docdir@/sendmail/KNOWNBUGS.gz + rm -f @docdir@/sendmail/README.Debian.sendmail-doc + rm -f @docdir@/sendmail/cf.README.gz + rm -f @docdir@/sendmail/faq.txt.gz + rm -f @docdir@/sendmail/site.config.m4.gz + rm -f @docdir@/sendmail/smrsh.README.gz +fi + +#DEBHELPER# diff --git a/debian/sendmail.cron.daily.in b/debian/sendmail.cron.daily.in new file mode 100644 index 0000000..131f9a2 --- /dev/null +++ b/debian/sendmail.cron.daily.in @@ -0,0 +1,101 @@ +#!/bin/sh +set +e; + +#------------------------------------------------------------------------------ +# Autoconf variables - in a form suitable for sh, perl +# Generated automatically from autoconf.sh.in by configure. +#------------------------------------------------------------------------------ +# Variables for, and by, Autoconf (Don't touch these! edit config step) +PACKAGE_NAME="@PACKAGE_NAME@"; +PACKAGE_VERSION="@PACKAGE_VERSION@"; +prefix="@prefix@"; +exec_prefix="@exec_prefix@"; +bindir="@bindir@"; +sbindir="@sbindir@"; +libexecdir="@libexecdir@"; +datadir="@datadir@"; +sysconfdir="@sysconfdir@"; +sharedstatedir="@sharedstatedir@"; +localstatedir="@localstatedir@"; +libdir="@libdir@"; +includedir="@includedir@"; +infodir="@infodir@"; +mandir="@mandir@"; +docdir="@docdir@"; +srcdir="@srcdir@"; + +copies=2; + +# backup "/etc/mail/sendmail.mc" +if [ -f ${sysconfdir}/mail/sendmail.mc ]; then + if [ ! -f ${localstatedir}/backups/sendmail.mc.bak ]; then + cp -pf ${sysconfdir}/mail/sendmail.mc \ + ${localstatedir}/backups/sendmail.mc.bak; + fi; + if ! cmp -s ${localstatedir}/backups/sendmail.mc.bak \ + ${sysconfdir}/mail/sendmail.mc ; then + cd ${localstatedir}/backups; + /usr/bin/savelog -p -c $copies sendmail.mc.bak > /dev/null; + cp -pf ${sysconfdir}/mail/sendmail.mc \ + ${localstatedir}/backups/sendmail.mc.bak; + fi; + fi; + +# backup "/etc/mail/submit.mc" +if [ -f ${sysconfdir}/mail/submit.mc ]; then + if [ ! -f ${localstatedir}/backups/submit.mc.bak ]; then + cp -pf ${sysconfdir}/mail/submit.mc \ + ${localstatedir}/backups/submit.mc.bak; + fi; + if ! cmp -s ${localstatedir}/backups/submit.mc.bak \ + ${sysconfdir}/mail/submit.mc ; then + cd ${localstatedir}/backups; + /usr/bin/savelog -p -c $copies submit.mc.bak > /dev/null; + cp -pf ${sysconfdir}/mail/submit.mc \ + ${localstatedir}/backups/submit.mc.bak; + fi; + fi; + +# while we're here, might as well do sendmail.cf +if [ -f ${sysconfdir}/mail/sendmail.cf ]; then + if [ ! -f ${localstatedir}/backups/sendmail.cf.bak ]; then + cp -pf ${sysconfdir}/mail/sendmail.cf \ + ${localstatedir}/backups/sendmail.cf.bak; + fi; + if ! cmp -s ${localstatedir}/backups/sendmail.cf.bak \ + ${sysconfdir}/mail/sendmail.cf ; then + cd ${localstatedir}/backups; + # save previous generation only if differences are significant + diff -bBwI "^\#\#\#\#\# " \ + ${localstatedir}/backups/sendmail.cf.bak \ + ${sysconfdir}/mail/sendmail.cf > /dev/null; + if [ $? -ne 0 ]; then + /usr/bin/savelog -p -c $copies sendmail.cf.bak \ + > /dev/null; + fi; + cp -pf ${sysconfdir}/mail/sendmail.cf \ + ${localstatedir}/backups/sendmail.cf.bak; + fi; + fi; + +# while we're here, might as well do submit.cf +if [ -f ${sysconfdir}/mail/submit.cf ]; then + if [ ! -f ${localstatedir}/backups/submit.cf.bak ]; then + cp -pf ${sysconfdir}/mail/submit.cf \ + ${localstatedir}/backups/submit.cf.bak; + fi; + if ! cmp -s ${localstatedir}/backups/submit.cf.bak \ + ${sysconfdir}/mail/submit.cf ; then + cd ${localstatedir}/backups; + # save previous generation only if differences are significant + diff -bBwI "^\#\#\#\#\# " \ + ${localstatedir}/backups/submit.cf.bak \ + ${sysconfdir}/mail/submit.cf > /dev/null; + if [ $? -ne 0 ]; then + /usr/bin/savelog -p -c $copies submit.cf.bak \ + > /dev/null; + fi; + cp -pf ${sysconfdir}/mail/submit.cf \ + ${localstatedir}/backups/submit.cf.bak; + fi; + fi; diff --git a/debian/sendmail.dirs.in b/debian/sendmail.dirs.in new file mode 100644 index 0000000..2e2d8f5 --- /dev/null +++ b/debian/sendmail.dirs.in @@ -0,0 +1 @@ +.@docdir@/sendmail diff --git a/debian/sendmail.init.d.in b/debian/sendmail.init.d.in new file mode 100644 index 0000000..49caef3 --- /dev/null +++ b/debian/sendmail.init.d.in @@ -0,0 +1,41 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: sendmail +# Required-Start: $remote_fs $network $syslog +# Required-Stop: $remote_fs $network $syslog +# Should-Start: $named +# Should-Stop: $named +# Default-Start: 2 3 4 5 +# Default-Stop: 1 +# Short-Description: powerful, efficient, and scalable Mail Transport Agent +# Description: Sendmail is an alternative Mail Transport Agent (MTA) +# for Debian. It is suitable for handling sophisticated +# mail configurations, although this means that its +# configuration can also be complex. Fortunately, simple +# thing can be done easily, and complex thing are possible, +# even if not easily understood ;) Sendmail is the *ONLY* +# MTA with a Turing complete language to control *ALL* +# aspects of delivery! +### END INIT INFO + +# Author: Marc-Christian Petersen + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +DESC="Mail Transport Agent (MTA)" +NAME=sendmail +DAEMON=/usr/sbin/$NAME +DAEMON_ARGS="" +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Read configuration variable file if it is present +[ -r /etc/default/sendmail ] && . /etc/default/sendmail + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +. /lib/lsb/init-functions + diff --git a/debian/sensible-mda.dirs.in b/debian/sensible-mda.dirs.in new file mode 100644 index 0000000..a2aeebb --- /dev/null +++ b/debian/sensible-mda.dirs.in @@ -0,0 +1,3 @@ +.@sbindir@ +.@mandir@ +.@mandir@/man8 diff --git a/debian/sensible-mda.preinst.in b/debian/sensible-mda.preinst.in new file mode 100644 index 0000000..118bf17 --- /dev/null +++ b/debian/sensible-mda.preinst.in @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + +PACKAGE=sensible-mda; + +if [ -L @docdir@/$PACKAGE ]; then + # /usr/share/doc/$PACKAGE was a symlink to /usr/share/doc/sendmail + rm @docdir@/$PACKAGE +fi +if [ -L /usr/share/bug/$PACKAGE ]; then + rm /usr/share/bug/$PACKAGE +fi + +#DEBHELPER# -- cgit v1.2.3