diff options
author | Neil Romig | 2017-08-13 10:50:45 +0100 |
---|---|---|
committer | Neil Romig | 2017-08-13 10:50:45 +0100 |
commit | f5439d7414ea7556236f3194fa5c636e31cae62a (patch) | |
tree | d0101009e9f228a4081e28b9f1c6dc9074868c15 | |
parent | 045f9f7b7004ccb7ed267dd0633dcdd2ab4f75bd (diff) | |
download | aur-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
-rw-r--r-- | .SRCINFO | 28 | ||||
-rw-r--r-- | PKGBUILD | 105 | ||||
-rw-r--r-- | courier-mkdhparams.service | 6 | ||||
-rw-r--r-- | courier-mkdhparams.timer | 11 | ||||
-rw-r--r-- | courier-mta.conf | 3 | ||||
-rw-r--r-- | courier-mta.install | 52 |
6 files changed, 94 insertions, 111 deletions
@@ -1,7 +1,7 @@ pkgbase = courier-mta pkgdesc = IMAP(s)/POP3(s) and SMTP Server with ML-manager, webmail and webconfig pkgver = 0.77.0 - pkgrel = 1 + pkgrel = 2 url = http://courier-mta.org install = courier-mta.install arch = i686 @@ -12,14 +12,13 @@ pkgbase = courier-mta makedepends = gnupg makedepends = libldap makedepends = gamin - depends = courier-authlib + depends = courier-authlib>=0.68 depends = gamin depends = gcc-libs depends = gdbm depends = pcre depends = mime-types depends = ca-certificates - depends = gnutls optdepends = libldap provides = smtp-server provides = smtp-forwarder @@ -35,21 +34,6 @@ pkgbase = courier-mta conflicts = ucspi-tcp options = !libtool options = !staticlibs - backup = etc/courier/imapd.cnf - backup = etc/courier/pop3d.cnf - backup = etc/courier/imapd - backup = etc/courier/imapd-ssl - backup = etc/courier/pop3d - backup = etc/courier/pop3d-ssl - backup = etc/courier/courierd - backup = etc/courier/sqwebmaild - backup = etc/courier/esmtpd - backup = etc/courier/esmtpd-ssl - backup = etc/courier/esmtpd.cnf - backup = etc/courier/esmtpd-msa - backup = etc/courier/webadmin/password - backup = etc/courier/esmtpauthclient - backup = etc/conf.d/courier-mta source = http://downloads.sourceforge.net/project/courier/courier/0.77.0/courier-0.77.0.tar.bz2 source = courier-imapd.service source = courier-imapd-ssl.service @@ -59,9 +43,11 @@ pkgbase = courier-mta source = courier-esmtpd-ssl.service source = courier-esmtpd-msa.service source = courier.service + source = courier-mkdhparams.service + source = courier-mkdhparams.timer source = webmaild.service source = courier-courierfilter.service - source = courier-imapd.conf + source = courier-mta.conf sha1sums = 6a79c331e2b2ac771455d4333947bfbc7d381b57 sha1sums = 160f270d8214ac39adc0d1618bc981c59f080adf sha1sums = 71d07d57d3c211abf267be140ffb074ac2492448 @@ -71,9 +57,11 @@ pkgbase = courier-mta sha1sums = e06cdb4014cb4c953dcedf6319eb31cc72a0c867 sha1sums = 315a26f6c74a9a1bbf9fdc1329095a15db0b5fc6 sha1sums = d768b9759a2bca407cf225771c49a83428db2a2c + sha1sums = feb094c689a0c37c68f3b0c7e2b88eb5d572209f + sha1sums = 7c6e687d1cefe3139274b39c659351a503a3adb3 sha1sums = 94703b7bb090754e78710df42f658407a5c0a798 sha1sums = 2c9a51fac9adb1bfb71a9d2b00e417dba4a0c249 - sha1sums = 72b81e3d330486e2e53ba11b498332a7bc7ea37e + sha1sums = b5aa73e428d568b20c8d59ef029e1740e8f9ef34 pkgname = courier-mta @@ -1,4 +1,5 @@ -# Maintainer: Bernd PrĂ¼nster <aur@berndpruenster.org> +# Maintainer: Neil Romig <neilromig@gmail.com> +# Contributor: Bernd PrĂ¼nster <aur@berndpruenster.org> # Contributor: tobias <tobias@archlinux.org> # Contributor: Tobias Kieslich <tobias@justdreams.de> @@ -7,25 +8,17 @@ pkgname=courier-mta pkgver=0.77.0 -pkgrel=1 +pkgrel=2 pkgdesc="IMAP(s)/POP3(s) and SMTP Server with ML-manager, webmail and webconfig" arch=(i686 x86_64) license=('GPL2') -backup=('etc/courier/imapd.cnf' 'etc/courier/pop3d.cnf' \ - 'etc/courier/imapd' 'etc/courier/imapd-ssl' \ - 'etc/courier/pop3d' 'etc/courier/pop3d-ssl' \ - 'etc/courier/courierd' 'etc/courier/sqwebmaild' \ - 'etc/courier/esmtpd' 'etc/courier/esmtpd-ssl' \ - 'etc/courier/esmtpd.cnf' 'etc/courier/esmtpd-msa' \ - 'etc/courier/webadmin/password' 'etc/courier/esmtpauthclient' \ - 'etc/conf.d/courier-mta') url="http://courier-mta.org" -depends=('courier-authlib' 'gamin' 'gcc-libs' 'gdbm' 'pcre' 'mime-types' 'ca-certificates' 'gnutls') +depends=('courier-authlib>=0.68' 'gamin' 'gcc-libs' 'gdbm' 'pcre' 'mime-types' 'ca-certificates') optdepends=('libldap') makedepends=('pam' 'expect' 'gnupg' 'libldap' 'gamin') provides=('smtp-server' 'smtp-forwarder' 'imap-server' 'pop3-server' 'courier-imap' 'courier-maildrop') conflicts=('courier-imap' 'smtp-forwarder' 'smtp-server' 'imap-server' 'courier-maildrop' 'ucspi-tcp') -options=('!libtool' '!staticlibs') +options=(!libtool !staticlibs) install=courier-mta.install source=(http://downloads.sourceforge.net/project/courier/courier/${pkgver}/courier-${pkgver}.tar.bz2 courier-imapd.service @@ -36,21 +29,25 @@ source=(http://downloads.sourceforge.net/project/courier/courier/${pkgver}/couri courier-esmtpd-ssl.service courier-esmtpd-msa.service courier.service + courier-mkdhparams.service + courier-mkdhparams.timer webmaild.service courier-courierfilter.service - courier-imapd.conf) + courier-mta.conf) sha1sums=('6a79c331e2b2ac771455d4333947bfbc7d381b57' - '160f270d8214ac39adc0d1618bc981c59f080adf' - '71d07d57d3c211abf267be140ffb074ac2492448' - '6b06348e019e8883bcac314169e920f156ed1fa4' - '3c6e285fb83aaecab274ea313619cc7a6bf09e05' - '74462efddede8262ec047eb21edada596d38732d' - 'e06cdb4014cb4c953dcedf6319eb31cc72a0c867' - '315a26f6c74a9a1bbf9fdc1329095a15db0b5fc6' - 'd768b9759a2bca407cf225771c49a83428db2a2c' - '94703b7bb090754e78710df42f658407a5c0a798' - '2c9a51fac9adb1bfb71a9d2b00e417dba4a0c249' - '72b81e3d330486e2e53ba11b498332a7bc7ea37e') + '160f270d8214ac39adc0d1618bc981c59f080adf' + '71d07d57d3c211abf267be140ffb074ac2492448' + '6b06348e019e8883bcac314169e920f156ed1fa4' + '3c6e285fb83aaecab274ea313619cc7a6bf09e05' + '74462efddede8262ec047eb21edada596d38732d' + 'e06cdb4014cb4c953dcedf6319eb31cc72a0c867' + '315a26f6c74a9a1bbf9fdc1329095a15db0b5fc6' + 'd768b9759a2bca407cf225771c49a83428db2a2c' + 'feb094c689a0c37c68f3b0c7e2b88eb5d572209f' + '7c6e687d1cefe3139274b39c659351a503a3adb3' + '94703b7bb090754e78710df42f658407a5c0a798' + '2c9a51fac9adb1bfb71a9d2b00e417dba4a0c249' + 'b5aa73e428d568b20c8d59ef029e1740e8f9ef34') build() { cd ${srcdir}/courier-${pkgver} @@ -67,17 +64,14 @@ build() { --enable-workarounds-for-imap-client-bugs \ --enable-mimetypes=/etc/mime.types \ --with-piddir=/var/run/courier \ - --with-locking-method=lockf \ --with-trashquota \ --with-db=gdbm \ - --with-trashquota \ --with-random=/dev/urandom \ --without-ispell \ --with-mailuser=courier \ --with-mailgroup=courier \ --with-certdb=/etc/ssl/certs/ make - make install-perms } package() { @@ -86,54 +80,49 @@ package() { make DESTDIR=${pkgdir} install # install the perftest-script for testings - install -Dm755 courier/perftest1 ${pkgdir}/usr/lib/courier/perftest1 + install -Dm 755 courier/perftest1 ${pkgdir}/usr/lib/courier/perftest1 - # move the .dist files into etc/courier - this mimics "make install-configure" - for distfile in ${pkgdir}/etc/courier/*.dist; do - mv ${distfile} ${pkgdir}/etc/courier/$(basename ${distfile} .dist) - done + # install sysconftool to perform the install-configure step after installation + install -Dm 755 sysconftool ${pkgdir}/usr/lib/courier/sysconftool - # install pam files according to the layout used in Archlinux + # install pam files according to the layout used in Arch linux for pamfile in ${pkgdir}/etc/courier/*.authpam; do sed -i 's|/lib/security/pam_pwdb\.so|pam_unix.so|' ${pamfile} - install -Dm 644 ${pamfile} \ - ${pkgdir}/etc/pam.d/$(basename ${pamfile} .authpam | sed "s/d$//") + install -Dm 644 ${pamfile} ${pkgdir}/etc/pam.d/$(basename ${pamfile} .authpam | sed "s/d$//") rm -f ${pamfile} done - ############################################################################### - # Arch Linux specific tweaks to make things easier for the user - # create passwordfile for webadmin -> standard archwebadmin + # Install systemd service files - sed -i 's|/etc/courier/webadmin/password|$(DESTDIR)/etc/courier/webadmin/password|g' Makefile - yes "archwebadmin" | make DESTDIR=${pkgdir} install-webadmin-password + install -Dm 644 "${srcdir}/courier-imapd.service" "${pkgdir}/usr/lib/systemd/system/courier-imapd.service" + install -Dm 644 "${srcdir}/courier-imapd-ssl.service" "${pkgdir}/usr/lib/systemd/system/courier-imapd-ssl.service" + install -Dm 644 "${srcdir}/courier-pop3d.service" "${pkgdir}/usr/lib/systemd/system/courier-pop3d.service" + install -Dm 644 "${srcdir}/courier-pop3d-ssl.service" "${pkgdir}/usr/lib/systemd/system/courier-pop3d-ssl.service" + install -Dm 644 "${srcdir}/courier-esmtpd.service" "${pkgdir}/usr/lib/systemd/system/courier-esmtpd.service" + install -Dm 644 "${srcdir}/courier-esmtpd-ssl.service" "${pkgdir}/usr/lib/systemd/system/courier-esmtpd-ssl.service" + install -Dm 644 "${srcdir}/courier-esmtpd-msa.service" "${pkgdir}/usr/lib/systemd/system/courier-esmtpd-msa.service" + install -Dm 644 "${srcdir}/courier.service" "${pkgdir}/usr/lib/systemd/system/courier.service" + install -Dm 644 "${srcdir}/courier-courierfilter.service" "${pkgdir}/usr/lib/systemd/system/courier-courierfilter.service" + install -Dm 644 "${srcdir}/webmaild.service" "${pkgdir}/usr/lib/systemd/system/webmaild.service" + install -Dm 644 "${srcdir}/courier-mkdhparams.service" "${pkgdir}/usr/lib/systemd/system/courier-mkdhparams.service" + install -Dm 644 "${srcdir}/courier-mkdhparams.timer" "${pkgdir}/usr/lib/systemd/system/courier-mkdhparams.timer" - # Install systemd service files + # pacman gives an error for /var/run file conflict. Circumvent this by removing the directory + rm -rf ${pkgdir}/var/run - install -Dm 644 "${srcdir}/courier-imapd.service" "${pkgdir}/usr/lib/systemd/system/courier-imapd.service" - install -Dm 644 "${srcdir}/courier-imapd-ssl.service" "${pkgdir}/usr/lib/systemd/system/courier-imapd-ssl.service" - install -Dm 644 "${srcdir}/courier-pop3d.service" "${pkgdir}/usr/lib/systemd/system/courier-pop3d.service" - install -Dm 644 "${srcdir}/courier-pop3d-ssl.service" "${pkgdir}/usr/lib/systemd/system/courier-pop3d-ssl.service" - install -Dm 644 "${srcdir}/courier-esmtpd.service" "${pkgdir}/usr/lib/systemd/system/courier-esmtpd.service" - install -Dm 644 "${srcdir}/courier-esmtpd-ssl.service" "${pkgdir}/usr/lib/systemd/system/courier-esmtpd-ssl.service" - install -Dm 644 "${srcdir}/courier-esmtpd-msa.service" "${pkgdir}/usr/lib/systemd/system/courier-esmtpd-msa.service" - install -Dm 644 "${srcdir}/courier.service" "${pkgdir}/usr/lib/systemd/system/courier.service" - install -Dm 644 "${srcdir}/courier.service" "${pkgdir}/usr/lib/systemd/system/courier.service" - install -Dm 644 "${srcdir}/courier-courierfilter.service" "${pkgdir}/usr/lib/systemd/system/courier-courierfilter.service" - install -Dm 644 "${srcdir}/webmaild.service" "${pkgdir}/usr/lib/systemd/system/webmaild.service" + # Install systemd configuration file which will set up empty /run/courier directory (and clean up after uninstall) - # Install systemd configuration files + install -Dm 644 "$srcdir/courier-mta.conf" "$pkgdir/usr/lib/tmpfiles.d/courier-mta.conf" - install -Dm 644 "$srcdir/courier-imapd.conf" "$pkgdir/usr/lib/tmpfiles.d/courier-imapd.conf" + # create password file for webadmin -> standard archwebadmin - # Do some final fixing up where required + echo archwebadmin > ${pkgdir}/etc/courier/webadmin/password + chown courier:courier ${pkgdir}/etc/courier/webadmin/password + chmod 400 ${pkgdir}/etc/courier/webadmin/password # install the imapd binary as /usr/lib/courier/courierimapd and modify usr/share scripts. # courier-mta by default installs usr/bin/imapd as the binary, usr/share/imapd as script file and usr/sbin/imapd as link to /usr/share/imapd # hence the binary gets overwritten by the link because Arch bin and sbin are same location install -m 755 "${srcdir}/courier-${pkgver}/courier/imapd" "${pkgdir}/usr/lib/courier/courierimapd" sed -i 's/\/usr\/bin\/imapd/\/usr\/lib\/courier\/courierimapd/' "${pkgdir}/usr/share/imapd" "${pkgdir}/usr/share/imapd-ssl" - - rm -r ${pkgdir}/var/run - } diff --git a/courier-mkdhparams.service b/courier-mkdhparams.service new file mode 100644 index 000000000000..1f5e72d2c378 --- /dev/null +++ b/courier-mkdhparams.service @@ -0,0 +1,6 @@ +[Unit] +Description=Generate Diffie Hellman parameters for Courier MTA + +[Service] +Type=oneshot +ExecStart=/usr/bin/mkdhparams diff --git a/courier-mkdhparams.timer b/courier-mkdhparams.timer new file mode 100644 index 000000000000..c44ccb7cdc10 --- /dev/null +++ b/courier-mkdhparams.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Generate Diffie Hellman parameters for Courier MTA + +[Timer] +OnCalendar=monthly +RandomizedDelaySec=3h +Persistent=true + +[Install] +WantedBy=timers.target + diff --git a/courier-mta.conf b/courier-mta.conf new file mode 100644 index 000000000000..5cbd4a892668 --- /dev/null +++ b/courier-mta.conf @@ -0,0 +1,3 @@ +D /run/courier 0755 courier courier +R /run/courier +R /var/spool/courier 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 $* |