diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2014-07-28 12:55:11 +0200 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2015-06-01 16:03:40 +0200 |
commit | 3c24c1355f273ec7c7919c2d51e225cb7acf28e3 (patch) | |
tree | 6095e11b3c4e37ed28e57d826d5e81c673266f27 | |
download | pkgbuilds-3c24c1355f273ec7c7919c2d51e225cb7acf28e3.tar.xz |
opensmtp: initial import
-rw-r--r-- | .SRCINFO | 29 | ||||
-rw-r--r-- | PKGBUILD | 59 | ||||
-rw-r--r-- | opensmtpd.install | 26 | ||||
-rw-r--r-- | smtpd.service | 10 | ||||
-rw-r--r-- | smtpd.socket | 8 |
5 files changed, 132 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..99b8ea5 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,29 @@ +# Generated by makepkg 4.2.1 +# Mon Jun 1 14:53:59 UTC 2015 +pkgbase = opensmtpd-ldap + pkgdesc = Free implementation of the server-side SMTP protocol + pkgver = 5.4.2p1 + pkgrel = 2 + url = http://www.opensmtpd.org/ + install = opensmtpd.install + arch = i686 + arch = x86_64 + license = custom + depends = libevent + depends = openssl + provides = smtp-server + provides = smtp-forwarder + conflicts = smtp-server + conflicts = smtp-forwarder + options = emptydirs + backup = etc/smtpd/smtpd.conf + backup = etc/smtpd/aliases + source = http://www.opensmtpd.org/archives/opensmtpd-ldap-5.4.2p1.tar.gz + source = smtpd.service + source = smtpd.socket + md5sums = c76b39a5fcc0ad05eea541e74b16e62a + md5sums = a278f272d97a9fe5a8aac784a7c98d67 + md5sums = c2c01e9ca78df3f65efe40a7c0e17ee0 + +pkgname = opensmtpd-ldap + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..d17f53f --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,59 @@ +pkgname=opensmtpd-ldap +pkgver=5.4.2p1 +pkgrel=2 +pkgdesc='Free implementation of the server-side SMTP protocol' +arch=('i686' 'x86_64') +url='http://www.opensmtpd.org/' +license=('custom') +depends=('libevent' 'openssl') +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=('c76b39a5fcc0ad05eea541e74b16e62a' + 'a278f272d97a9fe5a8aac784a7c98d67' + 'c2c01e9ca78df3f65efe40a7c0e17ee0') + +prepare() { + sed -ri 's,/etc/mail,/etc/smtpd,g' "$pkgname-$pkgver/smtpd/smtpd.conf" +} + +build() { + cd "$pkgname-$pkgver" + + # Remove _FORTIFY_SOURCES: FS#38124 + export CPPFLAGS='' + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc/smtpd \ + --sbindir=/usr/bin \ + --libexecdir=/usr/lib/smtpd \ + --with-maildir=/var/spool/mail \ + --with-privsep-path=/var/empty \ + --with-sock-dir=/run \ + --with-ca-file=/etc/ssl/certs/ca-certificates.crt \ + --with-privsep-user=smtpd \ + --with-queue-user=smtpq \ + --with-experimental-ldap \ + --with-pam + + make +} + +package() { + cd "$pkgname-$pkgver" + + make DESTDIR="$pkgdir/" install + + # install license and systemd unit files + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + install -Dm644 "$srcdir/smtpd.service" "$pkgdir/usr/lib/systemd/system/smtpd.service" + install -Dm644 "$srcdir/smtpd.socket" "$pkgdir/usr/lib/systemd/system/smtpd.socket" + + # install an empty aliases file (used by the default config) + install -Dm644 /dev/null "$pkgdir/etc/smtpd/aliases" +} diff --git a/opensmtpd.install b/opensmtpd.install new file mode 100644 index 0000000..71759d5 --- /dev/null +++ b/opensmtpd.install @@ -0,0 +1,26 @@ +# arg 1: the new 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 +} + +# arg 1: the new package version +# arg 2: the old package version +post_upgrade() { + post_install "$1" + 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() { + userdel -f smtpd + userdel -f smtpq + if (( $(vercmp $1 5.4) <= 0 )); then + userdel -f smtpf + fi +} diff --git a/smtpd.service b/smtpd.service new file mode 100644 index 0000000..0ad2182 --- /dev/null +++ b/smtpd.service @@ -0,0 +1,10 @@ +[Unit] +Description=OpenSMTPD +After=network.target + +[Service] +Type=forking +ExecStart=/usr/bin/smtpd + +[Install] +WantedBy=multi-user.target diff --git a/smtpd.socket b/smtpd.socket new file mode 100644 index 0000000..5d1d105 --- /dev/null +++ b/smtpd.socket @@ -0,0 +1,8 @@ +[Unit] +Description=OpenSMTPD Socket + +[Socket] +ListenStream=/run/smtpd.sock + +[Install] +WantedBy=sockets.target |