summaryrefslogtreecommitdiff
path: root/pcr/postsrsd/PKGBUILD
blob: 42ec47ba80120f146ac4a105f5ee4b10ce0f9317 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# 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.4
pkgrel=2
pkgdesc="Sender Rewriting Scheme (SRS) daemon for Postfix"
arch=('i686' 'x86_64' 'armv7h')
makedepends=('cmake' 'help2man')
backup=('etc/default/postsrsd')
url="https://github.com/roehling/postsrsd"
license=('GPL2')
source=("$pkgname-$pkgver.tar.gz::https://github.com/roehling/postsrsd/archive/${pkgver}.tar.gz"
        postsrsd-genkey.service
        postsrsd.service-genkey.conf)
md5sums=('cb6e13a06d6bbd7d383efb9bbf0867ce'
         '621d1ac7a15aec5d0cf91ec9b3ae7266'
         '3441061474bd5da0d5f8148f53b05917')

build() {
  cd "$srcdir/${pkgname}-${pkgver}"
  mkdir -p build
  cd build
  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

  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"
}