summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 54e2dd8992e85df8b4c589f46ec4460e467dd509 (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
# Maintainer: Hugo Osvaldo Barrera <hugo@barrera.io>
# Contributor: nougad

pkgname=opensmtpd-snapshot
_pkgname=opensmtpd
pkgver=201801101641p1
pkgrel=1
pkgdesc='A FREE implementation of the server-side SMTP protocol. Latest snapshot.'
arch=('i686' 'x86_64')
url="http://www.opensmtpd.org/portable.html"
license=('BSD')
depends=('libevent' 'pam' 'openssl-1.0' 'libasr-snapshot')
provides=('opensmtpd' 'smtp-server' 'smtp-forwarder')
conflicts=('smtp-server' 'smtp-forwarder')
replaces=('opensmtpd-portable')
options=(emptydirs !strip)
backup=("etc/mail/smtpd.conf" "etc/mail/aliases")
source=("http://www.opensmtpd.org/archives/${_pkgname}-${pkgver}.tar.gz"
        "smtpd.service"
        "smtpd.socket"
        "smtpd.conf.patch"
        "opensmtpd.sysusers")
sha256sums=('00f9add1fec403fd065b033f5e577ada74dfaf4c3bda459a1cefb973f3e0c94b'
            '655ca04a3b95e7424d625e60304387c5d73eb35997a7878089cae94e1dae5b27'
            '32d46de5562d01de445d04c93bcc9f94bf103539b676e449c32e3603a3866cf8'
            'da42f59718713c70c24d001604cd123fbde1da4314abbe445347207d0d14f5e4'
            'c26ca99242d12b1942934fc5e47c14fcd7120614561c2d30beff378630f00d0c')
install="${pkgname}.install"

prepare() {
  cd "$srcdir"
  patch "${_pkgname}-${pkgver}"/smtpd/smtpd.conf < smtpd.conf.patch
}

build() {
  cd "$srcdir/${_pkgname}-${pkgver}"

  ./configure --prefix=/usr \
              --sysconfdir=/etc/mail \
              --sbindir=/usr/bin \
              --libexecdir=/usr/lib/smtpd \
              --with-path-CAfile=/etc/ssl/certs/ca-certificates.crt \
              --with-table-db \
              --with-libssl='/usr/lib/openssl-1.0' \
              --with-cflags='-I/usr/include/openssl-1.0'
  make
}

package() {
  cd "$srcdir/${_pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}/" install
  ln -s /usr/bin/smtpctl "$pkgdir/usr/bin/makemap"
  ln -s /usr/bin/smtpctl "$pkgdir/usr/bin/newaliases"
  ln -s /usr/bin/smtpctl "$pkgdir/usr/bin/sendmail"

  install -Dm644 LICENSE   "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"

  install -Dm 644 "$srcdir/smtpd.service" "${pkgdir}/usr/lib/systemd/system/smtpd.service"
  install -Dm 644 "$srcdir/smtpd.socket"  "${pkgdir}/usr/lib/systemd/system/smtpd.socket"
  install -Dm 644 "$srcdir/opensmtpd.sysusers" "$pkgdir/usr/lib/sysusers.d/opensmtpd.conf"

  install -Dm 644 /dev/null "$pkgdir/etc/mail/aliases"

  install -dm 711 "$pkgdir/var/spool/smtpd/"
}