From 3c24c1355f273ec7c7919c2d51e225cb7acf28e3 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Mon, 28 Jul 2014 12:55:11 +0200 Subject: opensmtp: initial import --- .SRCINFO | 29 +++++++++++++++++++++++++++ PKGBUILD | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ opensmtpd.install | 26 ++++++++++++++++++++++++ smtpd.service | 10 ++++++++++ smtpd.socket | 8 ++++++++ 5 files changed, 132 insertions(+) create mode 100644 .SRCINFO create mode 100644 PKGBUILD create mode 100644 opensmtpd.install create mode 100644 smtpd.service create mode 100644 smtpd.socket 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 -- cgit v1.2.3-70-g09d2