[arch-commits] Commit in opensmtpd/trunk (PKGBUILD opensmtpd.install)
Sébastien Luttringer
seblu at nymeria.archlinux.org
Tue Aug 6 15:55:05 UTC 2013
Date: Tuesday, August 6, 2013 @ 17:55:05
Author: seblu
Revision: 95205
Prepare next release
Modified:
opensmtpd/trunk/PKGBUILD
opensmtpd/trunk/opensmtpd.install
-------------------+
PKGBUILD | 34 ++++++++++++++--------------------
opensmtpd.install | 17 +++++++++++------
2 files changed, 25 insertions(+), 26 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2013-08-06 14:56:23 UTC (rev 95204)
+++ PKGBUILD 2013-08-06 15:55:05 UTC (rev 95205)
@@ -2,8 +2,8 @@
# Maintainer: Sébastien Luttringer
pkgname=opensmtpd
-pkgver=5.3.3p1
-pkgrel=2
+pkgver=201307311702p1
+pkgrel=1
pkgdesc='Free implementation of the server-side SMTP protocol'
arch=('i686' 'x86_64')
url='http://www.opensmtpd.org/'
@@ -12,23 +12,18 @@
provides=('smtp-server' 'smtp-forwarder')
conflicts=('smtp-server' 'smtp-forwarder')
backup=('etc/smtpd/smtpd.conf' 'etc/smtpd/aliases')
+options=('emptydirs')
install=opensmtpd.install
source=("http://www.opensmtpd.org/archives/$pkgname-$pkgver.tar.gz"
'smtpd.service'
'smtpd.socket')
-md5sums=('795982f9b0b45c7645f897ba2ead0024'
+md5sums=('25bdf0f590a34f8ee4735d80677bace9'
'a278f272d97a9fe5a8aac784a7c98d67'
'c2c01e9ca78df3f65efe40a7c0e17ee0')
prepare() {
cd $pkgname-$pkgver
sed -i 's,etc/aliases,etc/smtpd/aliases,' smtpd/smtpd.conf
- # regen configure. don't use bootstrap script (doesn't support automake 1.14)
- libtoolize --copy --force
- aclocal -I m4
- autoconf
- autoheader
- automake --foreign --add-missing --copy
}
build() {
@@ -37,14 +32,12 @@
--prefix=/usr \
--sysconfdir=/etc/smtpd \
--sbindir=/usr/bin \
- --libexecdir=/usr/bin \
+ --libexecdir=/usr/lib/smtpd \
--with-maildir=/var/spool/mail \
--with-privsep-path=/var/empty \
--with-sock-dir=/run \
--with-privsep-user=smtpd \
- --with-lookup-user=smtpd \
--with-queue-user=smtpq \
- --with-filter-user=smtpf \
--with-pam
make
}
@@ -56,17 +49,18 @@
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# working directory
cd "$pkgdir"
- install -dm711 var/spool/smtpd
+ # install systemd units
install -Dm644 "$srcdir/smtpd.service" usr/lib/systemd/system/smtpd.service
install -Dm644 "$srcdir/smtpd.socket" usr/lib/systemd/system/smtpd.socket
- # remove duplicate hardlink into a subfolder
- rm -vr usr/bin/opensmtpd
# empty aliases file (used by default config)
- install -Dm644 /dev/null "$pkgdir/etc/smtpd/aliases"
- # fake sendmail binary (used to be smtp-forwarder)
- # use hardlink as upstream does
- cd "$pkgdir/usr/bin"
- ln smtpctl "$pkgdir/usr/bin/sendmail"
+ install -Dm644 /dev/null etc/smtpd/aliases
+ # create pool directory
+ install -dm711 var/spool/smtpd
+ # fix bad symlinks
+ ln -fs smtpctl usr/bin/mailq
+ ln -fs smtpctl usr/bin/sendmail
+ ln -fs makemap usr/bin/newaliases
+ ls -l usr/bin/
}
# vim:set ts=2 sw=2 et:
Modified: opensmtpd.install
===================================================================
--- opensmtpd.install 2013-08-06 14:56:23 UTC (rev 95204)
+++ opensmtpd.install 2013-08-06 15:55:05 UTC (rev 95205)
@@ -3,10 +3,7 @@
# create users
getent passwd smtpd >/dev/null || useradd -d / -u 91 -g 1 smtpd
getent passwd smtpq >/dev/null || useradd -d /var/spool/smtpd -u 92 -g 1 smtpq
- getent passwd smtpf >/dev/null || useradd -d / -u 93 -g 1 smtpf
- # initialise aliase db
- #[[ -e /etc/smtpd/aliases.db ]] || makemap -t aliases /etc/smtpd/aliases
- true
+ :
}
# arg 1: the new package version
@@ -17,13 +14,21 @@
echo 'Configuration files have been moved to /etc/smtpd.'
echo 'New users have been added.'
echo 'Check your configuration!'
+ elif (( $(vercmp $2 5.4) < 0 )); then
+ echo 'User smtpf is no more required. It will be removed!'
+ echo 'Check your configuration!'
+ userdel -f smtpf
fi
}
# arg 1: the old package version
post_remove() {
- for _u in smtpd smtpq smtpf; do userdel -f "$_u"; done
- true
+ userdel -f smtpd
+ userdel -f smtpq
+ if (( $(vercmp $1 5.4) <= 0 )); then
+ userdel -f smtpf
+ fi
+ :
}
# vim:set ts=2 sw=2 et:
More information about the arch-commits
mailing list