summaryrefslogtreecommitdiff
path: root/community/opensmtpd/PKGBUILD
blob: 0e452fb825e5496ac5f319bb16940f09736ee8b8 (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
# $Id: PKGBUILD 102612 2013-12-16 18:31:48Z seblu $
# Maintainer: Sébastien Luttringer

pkgname=opensmtpd
pkgver=5.4.1p1
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=('74551342985b78eb687995f7953d1790'
         '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-pam
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir/" install
  # license
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  # working directory
  cd "$pkgdir"
  # install systemd units
  install -Dm644 "$srcdir/smtpd.service" usr/lib/systemd/system/smtpd.service
  install -Dm644 "$srcdir/smtpd.socket" usr/lib/systemd/system/smtpd.socket
  # empty aliases file (used by default config)
  install -Dm644 /dev/null etc/smtpd/aliases
}

# vim:set ts=2 sw=2 et: