summarylogtreecommitdiffstats
path: root/courier-mta.install
diff options
context:
space:
mode:
authorNeil Romig2017-08-13 10:50:45 +0100
committerNeil Romig2017-08-13 10:50:45 +0100
commitf5439d7414ea7556236f3194fa5c636e31cae62a (patch)
treed0101009e9f228a4081e28b9f1c6dc9074868c15 /courier-mta.install
parent045f9f7b7004ccb7ed267dd0633dcdd2ab4f75bd (diff)
downloadaur-f5439d7414ea7556236f3194fa5c636e31cae62a.tar.gz
Tidy PKGBUILD and install script, introduce use of sysconftool, add mkdhparams, stop using pacman for backup, revert to openssl (matching courier-authlib), other minor tweaks
Diffstat (limited to 'courier-mta.install')
-rw-r--r--courier-mta.install52
1 files changed, 19 insertions, 33 deletions
diff --git a/courier-mta.install b/courier-mta.install
index 43cf7038da1a..51b49200ddc1 100644
--- a/courier-mta.install
+++ b/courier-mta.install
@@ -1,46 +1,32 @@
-# arg 1: the new package version
post_install() {
- cat << EOM
- --> if you are using LDAP services to provide lookup in sqwebmail or aliases
- --> then you have to install:
- libldap
-EOM
- # create the *.dat files
+ #set up the /var/run directory
+ systemd-tmpfiles --create /usr/lib/tmpfiles.d/courier-mta.conf
+
+ # perform all the tasks required of a standard Courier install
+ echo Performing install-configure...
+ /usr/lib/courier/sysconftool /etc/courier/*.dist > /etc/courier/upgrade-$1.log
+ echo ...output saved to /etc/courier/upgrade-$1.log
+ echo "Do not forget to choose an account to receive postmaster mail."
makealiases
makesmtpaccess
+ /usr/bin/mkdhparams
}
pre_upgrade() {
- pre_remove $1
-}
-
-# arg 1: the new package version
-# arg 2: the old package version
-post_upgrade() {
- post_install $1
+ # the file courier-imapd.conf is renamed to courier-mta.conf for version 0.77.0-2
+ [ "$1" != "0.77.0-2" ] && rm -f /usr/lib/tmpfiles.d/courier-imapd.conf
}
-
pre_remove() {
- # manual backup, since courier is always processing the whole directory
- # - so it would process "system" AND "system.pacsave" -> bad
- [ ! -d /etc/courier/_backup ] && mkdir /etc/courier/_backup
- cp /etc/courier/aliases/system /etc/courier/_backup/aliases.system
- cp /etc/courier/smtpaccess/default /etc/courier/_backup/smtpaccess.default
+ # there may be many files not part of the original installation that would be useful to save
+ # so save the whole configuration directory rather than try to list all possibilities
+ # in backup(). Also avoids creation of .pacsave files in alias and smtpaccess directories that
+ # process all files
+ mv -f /etc/courier /etc/courier-$1
cat << EOM
- --> the /etc/courier/aliases/system and the /etc/courier/smtpaccess/default
- --> files have been backed up to /etc/courier/_backup since the *.pacsave
- --> files cannot stay in place. Read about couriers alias handling from the
- --> documentation!
+ --> /etc/courier has been saved as /etc/courier-$1
EOM
-}
-# arg 1: the old package version
-post_remove() {
- /bin/true
+ # clean up the /run and /var/spool directories
+ systemd-tmpfiles --remove /usr/lib/tmpfiles.d/courier-mta.conf
}
-
-op=$1
-shift
-
-$op $*