[arch-commits] Commit in opensmtpd/trunk (PKGBUILD opensmtpd.install)

Sébastien Luttringer seblu at nymeria.archlinux.org
Thu Jun 27 02:40:55 UTC 2013


    Date: Thursday, June 27, 2013 @ 04:40:55
  Author: seblu
Revision: 93171

- bump upstream version.
- add 3 users (FS#34835).
- remove creation of alias db. Empty db file display syntax error in smptd.conf
- move config files from /etc to /etc/smtpd.
- remove virtual and secret files. Let users handle them.
- call autotools manually since configure is no more provided and automake 1.14 is badly detected by bootstrap

Modified:
  opensmtpd/trunk/PKGBUILD
  opensmtpd/trunk/opensmtpd.install

-------------------+
 PKGBUILD          |   49 +++++++++++++++++++++++++++++--------------------
 opensmtpd.install |   18 ++++++++++++++----
 2 files changed, 43 insertions(+), 24 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2013-06-27 01:34:18 UTC (rev 93170)
+++ PKGBUILD	2013-06-27 02:40:55 UTC (rev 93171)
@@ -2,8 +2,8 @@
 # Maintainer: Sébastien Luttringer
 
 pkgname=opensmtpd
-pkgver=5.3.2p1
-pkgrel=2
+pkgver=5.3.3p1
+pkgrel=0.1
 pkgdesc='Free implementation of the server-side SMTP protocol'
 arch=('i686' 'x86_64')
 url='http://www.opensmtpd.org/'
@@ -11,29 +11,40 @@
 depends=('libevent')
 provides=('smtp-server' 'smtp-forwarder')
 conflicts=('smtp-server' 'smtp-forwarder')
-backup=('etc/smtpd.conf' 'etc/aliases' 'etc/virtual' 'etc/secrets')
+backup=('etc/smtpd/smtpd.conf' 'etc/smtpd/aliases')
 install=opensmtpd.install
 source=("http://www.opensmtpd.org/archives/$pkgname-$pkgver.tar.gz"
         'smtpd.service'
         'smtpd.socket')
-md5sums=('8fc513dd632461f70e433103d75dbf50'
-         'a278f272d97a9fe5a8aac784a7c98d67'
+md5sums=('795982f9b0b45c7645f897ba2ead0024'
+         '1281bab5adfdccb55d57f929c02eed19'
          '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() {
   cd $pkgname-$pkgver
-  ./bootstrap
   ./configure \
     --prefix=/usr \
-    --sysconfdir=/etc \
+    --sysconfdir=/etc/smtpd \
     --sbindir=/usr/bin \
     --libexecdir=/usr/bin \
     --with-maildir=/var/spool/mail \
     --with-privsep-path=/var/empty \
     --with-sock-dir=/run \
-    --with-privsep-user=mail \
-    --with-filter-user=mail \
-    --with-queue-user=mail \
+    --with-privsep-user=smtpd \
+    --with-lookup-user=smtpd \
+    --with-queue-user=smtpq \
+    --with-filter-user=smtpf \
     --with-pam
   make
 }
@@ -41,23 +52,21 @@
 package() {
   cd $pkgname-$pkgver
   make DESTDIR="$pkgdir/" install
+  # license
   install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-
+  # working directory
   cd "$pkgdir"
-  # working directory
   install -dm711 var/spool/smtpd
-  # license
   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 -r usr/bin/opensmtpd
-  # empty aliases file
-  install -Dm644 /dev/null "$pkgdir/etc/aliases"
-  install -Dm644 /dev/null "$pkgdir/etc/virtual"
-  install -Dm640 /dev/null "$pkgdir/etc/secrets"
+  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...
-  ln "$pkgdir/usr/bin/smtpctl" "$pkgdir/usr/bin/sendmail"
+  # use hardlink as upstream does
+  cd "$pkgdir/usr/bin"
+  ln smtpctl "$pkgdir/usr/bin/sendmail"
 }
 
 # vim:set ts=2 sw=2 et:

Modified: opensmtpd.install
===================================================================
--- opensmtpd.install	2013-06-27 01:34:18 UTC (rev 93170)
+++ opensmtpd.install	2013-06-27 02:40:55 UTC (rev 93171)
@@ -1,14 +1,24 @@
 # arg 1:  the new package version
-# arg 2:  the old package version
+post_install() {
+  # 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
-post_install() {
-  makemap -t aliases /etc/aliases
+# arg 2:  the old package version
+post_upgrade() {
+  post_install "$1"
 }
 
 # arg 1:  the old package version
 post_remove() {
- rm -f /etc/aliases.db
+  for _u in smtpd smtpq smtpf; do userdel -f "$_u"; done
+  true
 }
 
 # vim:set ts=2 sw=2 et:




More information about the arch-commits mailing list