diff options
-rw-r--r-- | pcr/postsrsd/PKGBUILD | 53 | ||||
-rw-r--r-- | pcr/postsrsd/postsrsd-genkey.service | 8 | ||||
-rw-r--r-- | pcr/postsrsd/postsrsd.install | 15 | ||||
-rw-r--r-- | pcr/postsrsd/postsrsd.service | 15 | ||||
-rw-r--r-- | pcr/postsrsd/postsrsd.service-genkey.conf | 3 |
5 files changed, 40 insertions, 54 deletions
diff --git a/pcr/postsrsd/PKGBUILD b/pcr/postsrsd/PKGBUILD index 43581298e..66ee84cfc 100644 --- a/pcr/postsrsd/PKGBUILD +++ b/pcr/postsrsd/PKGBUILD @@ -1,41 +1,46 @@ -# Based on -# Maintainer: Thomas Haider <t.haider@deprecate.de> +# Maintainer: Luke Shumaker <lukeshu@parabola.nu> +# Maintainer (AUR:postsrsd-git): Radek Podgorny <radek@podgorny.cz> +# Maintainer (AUR:postsrsd-git): Thomas Haider <t.haider@deprecate.de> +# Maintainer (AUR:postsrsd): fordprefect <fordprefect@dukun.de> pkgname=postsrsd -pkgver=1.1 +pkgver=1.4 pkgrel=1 -pkgdesc="Provides the Sender Rewriting Scheme (SRS) via TCP-based lookup tables for Postfix" -arch=('i686' 'x86_64' 'mips64el') -depends=('glibc') +pkgdesc="Sender Rewriting Scheme (SRS) daemon for Postfix" +arch=('i686' 'x86_64' 'armv7h') makedepends=('cmake' 'help2man') -backup=('etc/postsrsd/postsrsd.conf') +backup=('etc/default/postsrsd') url="https://github.com/roehling/postsrsd" -install=postsrsd.install license=('GPL2') -source=('https://github.com/roehling/postsrsd/archive/1.1.tar.gz' 'postsrsd.service') -md5sums=('5cde2c2ae7046347f5e17aef2ea8a4a8' - '64f31e8914f5063297371d36f699302d') - -prepare() { - cd "$srcdir/${pkgname}-${pkgver}" - mkdir build -} +source=("$pkgname-$pkgver.tar.gz::https://github.com/roehling/postsrsd/archive/${pkgver}.tar.gz" + postsrsd-genkey.service + postsrsd.service-genkey.conf) +md5sums=('cb6e13a06d6bbd7d383efb9bbf0867ce' + 'ca8cae7a54e57f71e59372c29785cddc' + '3441061474bd5da0d5f8148f53b05917') build() { cd "$srcdir/${pkgname}-${pkgver}" + mkdir -p build cd build - cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DGENERATE_SRS_SECRET=OFF + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DGENERATE_SRS_SECRET=OFF \ + -DUSE_APPARMOR=ON \ + -DINIT_FLAVOR=systemd \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DSYSD_UNIT_DIR='/usr/lib/systemd/system' make all } package() { cd "$srcdir/${pkgname}-${pkgver}/build" make DESTDIR="$pkgdir/" install - - rm -rf $pkgdir/usr/lib - mv "$pkgdir/usr/sbin" "$pkgdir/usr/bin" - sed -e 's/^\(RUN_AS=\)nobody/#\1postsrsd/;s/\(\/etc\/postsrsd\)\(\.secret\)/\1\/postsrsd\2/' \ - -e 's/^\(# is \).*$/\1localhost\.localdomain/'< ../postsrsd.default > postsrsd.conf - install -D -m644 "postsrsd.conf" "$pkgdir/etc/postsrsd/postsrsd.conf" - install -D -m644 "$srcdir/postsrsd.service" "$pkgdir/usr/lib/systemd/system/postsrsd.service" + + mv "$pkgdir"/usr/{sbin,bin} + + # This is to defer running the keygen until runtime; because of + # GENERATE_SRS_SECRET=OFF. + install -Dm644 "$srcdir/postsrsd-genkey.service" "$pkgdir/usr/lib/systemd/system/postsrsd-genkey.service" + install -Dm644 "$srcdir/postsrsd.service-genkey.conf" "$pkgdir/usr/lib/systemd/system/postsrsd.service.d/genkey.conf" } diff --git a/pcr/postsrsd/postsrsd-genkey.service b/pcr/postsrsd/postsrsd-genkey.service new file mode 100644 index 000000000..ca29b3cd9 --- /dev/null +++ b/pcr/postsrsd/postsrsd-genkey.service @@ -0,0 +1,8 @@ +[Unit] +Description=PostSRSd Key Generation +ConditionPathExists=!/etc/postsrsd.conf + +[Service] +ExecStart=/bin/sh -c 'dd if=/dev/urandom bs=18 count=1 status=none | base64 > /etc/postsrsd.secret' +Type=oneshot +RemainAfterExit=yes diff --git a/pcr/postsrsd/postsrsd.install b/pcr/postsrsd/postsrsd.install deleted file mode 100644 index b8e7f8d5a..000000000 --- a/pcr/postsrsd/postsrsd.install +++ /dev/null @@ -1,15 +0,0 @@ -post_install() { - useradd -r -g mail -d / postsrsd - chown -R postsrsd:root etc/postsrsd - - [ -e /etc/postsrsd/postsrsd.secret ] || dd if=/dev/urandom bs=18 count=1 status=none | base64 > /etc/postsrsd/postsrsd.secret - chown postsrsd:root /etc/postsrsd/postsrsd.secret - chmod 400 /etc/postsrsd/postsrsd.secret - cat << _EOF -Don't forget to set your domainname in /etc/postsrsd/postsrsd.conf -_EOF -} - -post_remove() { - userdel postsrsd -} diff --git a/pcr/postsrsd/postsrsd.service b/pcr/postsrsd/postsrsd.service deleted file mode 100644 index e72f97045..000000000 --- a/pcr/postsrsd/postsrsd.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Postfix Sender Rewriting Scheme daemon - -[Service] -Type=forking -RuntimeDirectory=postsrsd -PIDFile=/run/postsrsd/postsrsd.pid -Environment=SRS_DOMAIN=localhost.localdomain SRS_FORWARD_PORT=10001 SRS_REVERSE_PORT=10002 SRS_SECRET=/etc/postsrsd/postsrsd.secret \ - SRS_EXCLUDE_DOMAINS= RUN_AS=postsrsd CHROOT=/run/postsrsd -EnvironmentFile=/etc/postsrsd/postsrsd.conf -ExecStart=/usr/bin/postsrsd -D -4 -f${SRS_FORWARD_PORT} -r${SRS_REVERSE_PORT} -d${SRS_DOMAIN} -s${SRS_SECRET} -u${RUN_AS} \ - -c${CHROOT} -X${SRS_EXCLUDE_DOMAINS} -p/run/postsrsd/postsrsd.pid - -[Install] -WantedBy=multi-user.target diff --git a/pcr/postsrsd/postsrsd.service-genkey.conf b/pcr/postsrsd/postsrsd.service-genkey.conf new file mode 100644 index 000000000..014b43797 --- /dev/null +++ b/pcr/postsrsd/postsrsd.service-genkey.conf @@ -0,0 +1,3 @@ +[Unit] +Wants=postsrsd-genkey.service +After=postsrsd-genkey.service |