summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3052fdf1d89dc862c6038e3c5bdb1a524a990595 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Maintainer: Maarten de Vries <maarten@de-vri.es>
# Contributor: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Hugo Osvaldo Barrera <hugo@barrera.io>
# Contributor: Sébastien Luttringer
# Contributor: parchd <parchd@archlinux.info>

pkgname=opensmtpd-libressl
pkgver=6.4.2p1
pkgrel=4
pkgdesc='OpenSMTPD built against LibreSSL'
arch=('i686' 'x86_64')
url="http://www.opensmtpd.org/"
license=('BSD')
depends=('libressl' 'libevent' 'pam' 'libasr')
provides=('smtp-server' 'smtp-forwarder' 'opensmtpd')
conflicts=('smtp-server' 'smtp-forwarder' 'opensmtpd')
backup=("etc/smtpd/smtpd.conf" "etc/smtpd/aliases")
options=(emptydirs)
source=(
  "https://www.opensmtpd.org/archives/opensmtpd-$pkgver.tar.gz"
  'opensmtpd.sysusers'
  'opensmtpd.tmpfiles'
  'smtpd.service'
  'smtpd.socket'
)
sha256sums=('6d71155b15fa4ef0198d10dfb7b1905845c9d36d4a02321245a99da80002fb5d'
            'b38b64f1457b7227d55585edc711cce525e089516d16b093e6c44387380e6b13'
            '107bc2a46fa885e355e551cc362dce5ef2362a8f4ad4cb12d6310a7b6d4edb54'
            '5c0f60d7bcebb1a6d371e7254b20d8ed2cfd79db64b3c3e9a6e992955bd6678f'
            '32d46de5562d01de445d04c93bcc9f94bf103539b676e449c32e3603a3866cf8')

prepare() {
  cd "opensmtpd-$pkgver"

  sed -i \
    -e 's#/etc/mail#/etc/smtpd#g' \
    -e 's/^listen on localhost$/listen on lo/' \
    smtpd/smtpd.conf

  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc/smtpd \
    --sbindir=/usr/bin \
    --libexecdir=/usr/lib/smtpd \
    --with-user-smtpd=smtpd \
    --with-user-queue=smtpq \
    --with-group-queue=smtpq \
    --with-path-CAfile=/etc/ssl/certs/ca-certificates.crt \
    --with-cflags='-I/usr/include/libressl -L/usr/lib/libressl -Wl,-rpath=/usr/lib/libressl'
}

build() {
  cd "opensmtpd-$pkgver"
  make
}

package() {
  cd "opensmtpd-$pkgver"

  make DESTDIR="$pkgdir/" install

  ln -s /usr/bin/smtpctl "$pkgdir/usr/bin/sendmail"
  ln -s /usr/bin/smtpctl "$pkgdir/usr/bin/mailq"
  ln -s /usr/bin/smtpctl "$pkgdir/usr/bin/newaliases"
  ln -s /usr/bin/smtpctl "$pkgdir/usr/bin/makemap"

  # install additional files
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 "$srcdir/opensmtpd.sysusers" "$pkgdir/usr/lib/sysusers.d/opensmtpd.conf"
  install -Dm644 "$srcdir/opensmtpd.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/opensmtpd.conf"
  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"
}