postinst is in spamassassin 3.4.1-8build1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | #!/bin/sh
set -e
if [ "$1" = "triggered" ] && [ "$2" = "perl-major-upgrade" ]; then
echo "OK, restarting spamd due to trigger"
invoke-rc.d spamassassin restart
fi
if [ "$1" = "configure" ]; then
# If a new install, or an upgrade from 3.3.2-2 or earlier...
if ! getent passwd debian-spamd > /dev/null ; then
adduser --system --group --shell /bin/sh --disabled-password \
--home /var/lib/spamassassin debian-spamd
else
mkdir -p /var/lib/spamassassin
fi
OWNER=$(stat -c '%U' /var/lib/spamassassin)
GROUP=$(stat -c '%G' /var/lib/spamassassin)
# Lets debian-spamd claim ownership of spamassassin updates on upgrades,
# unless the user has overridden.
if ! dpkg-statoverride --list /var/lib/spamassassin/* >/dev/null && \
[ "$OWNER:$GROUP" != "debian-spamd:debian-spamd" ]; then
chown -R debian-spamd:debian-spamd /var/lib/spamassassin
OWNER=debian-spamd
GROUP=debian-spamd
fi
test -d /var/lib/spamassassin/sa-update-keys || \
install -d -o $OWNER -g $GROUP -m 700 /var/lib/spamassassin/sa-update-keys
# If gnupg is not available when spamassassin is installed, but
# is subsequently made available, you'll need to execute
# `dpkg-reconfigure spamassassin` in order to enable sa-update
# functionality.
if command -v gpg > /dev/null; then
su - $OWNER -c "sa-update \
--gpghomedir /var/lib/spamassassin/sa-update-keys \
--import /usr/share/spamassassin/GPG.KEY"
fi
fi
# Automatically added by dh_systemd_enable/11.1.4ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if deb-systemd-helper debian-installed 'spamassassin.service'; then
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask 'spamassassin.service' >/dev/null || true
if deb-systemd-helper --quiet was-enabled 'spamassassin.service'; then
# Create new symlinks, if any.
deb-systemd-helper enable 'spamassassin.service' >/dev/null || true
fi
fi
# Update the statefile to add new symlinks (if any), which need to be cleaned
# up on purge. Also remove old symlinks.
deb-systemd-helper update-state 'spamassassin.service' >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installinit/11.1.4ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -x "/etc/init.d/spamassassin" ]; then
update-rc.d spamassassin defaults 19 21 >/dev/null || exit 1
fi
fi
# End automatically added section
if [ "$1" = "configure" ] && [ -n "$2" ]; then
if deb-systemd-helper was-enabled spamassassin.service > /dev/null; then
invoke-rc.d spamassassin restart
fi
fi
|