archrelease: copy trunk to community-any
[ArchLinux/community.git] / opensmtpd / repos / community-x86_64 / PKGBUILD
blob662628f9e17a4bb0caa97df5ad3b918c2167d7b5
1 # Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
2 # Maintainer: Bruno Pagani <archange@archlinux.org>
3 # Contributor: T.J. Townsend <blakkheim@archlinux.org>
4 # Contributor: Sébastien Luttringer
5 # Contributor: parchd <parchd@archlinux.info>
7 pkgname=opensmtpd
8 pkgver=6.8.0p2
9 pkgrel=5
10 pkgdesc="Free implementation of the server-side SMTP protocol"
11 arch=(x86_64)
12 url="https://www.opensmtpd.org/"
13 license=(custom)
14 depends=(libevent libressl pam libxcrypt zlib)
15 optdepends=('opensmtpd-filter-rspamd: rspamd integration')
16 provides=(smtp-server smtp-forwarder)
17 conflicts=(smtp-server smtp-forwarder)
18 backup=(etc/smtpd/smtpd.conf etc/smtpd/aliases)
19 options=(emptydirs)
20 source=("https://www.opensmtpd.org/archives/${pkgname}-${pkgver}.tar.gz"
21         opensmtpd.sysusers
22         smtpd.service
23         smtpd.socket)
24 sha256sums=('51bf05312fe56764748faab9e63170bfbb7c7d84a37c4117b62b2681eb3a4d17'
25             'b38b64f1457b7227d55585edc711cce525e089516d16b093e6c44387380e6b13'
26             'abf5baeb2a87c60d668ad18ea41cc08cab7a4f76339dd6df05de15cdaadaf922'
27             '32d46de5562d01de445d04c93bcc9f94bf103539b676e449c32e3603a3866cf8')
28 install=${pkgname}.install
30 prepare() {
31   sed -ri 's,/etc/mail,/etc/smtpd,g' ${pkgname}-${pkgver}/usr.sbin/smtpd/smtpd.conf
34 build() {
35   cd ${pkgname}-${pkgver}
37   ./configure \
38     --prefix=/usr \
39     --sysconfdir=/etc/smtpd \
40     --sbindir=/usr/bin \
41     --libexecdir=/usr/lib/smtpd \
42     --with-path-mbox=/var/spool/mail \
43     --with-path-empty=/var/empty \
44     --with-path-socket=/run \
45     --with-path-CAfile=/etc/ssl/certs/ca-certificates.crt \
46     --with-user-smtpd=smtpd \
47     --with-user-queue=smtpq \
48     --with-group-queue=smtpq \
49     --with-auth-pam \
50     --with-cflags='-I/usr/include/libressl -L/usr/lib/libressl -Wl,-rpath=/usr/lib/libressl'
52   make
55 package() {
56   cd ${pkgname}-${pkgver}
58   make DESTDIR="${pkgdir}" install SMTPD_QUEUE_USER=92
60   ln -s /usr/bin/smtpctl "${pkgdir}"/usr/bin/sendmail
61   ln -s /usr/bin/smtpctl "${pkgdir}"/usr/bin/mailq
62   ln -s /usr/bin/smtpctl "${pkgdir}"/usr/bin/newaliases
63   ln -s /usr/bin/smtpctl "${pkgdir}"/usr/bin/makemap
65   install -Dm644 etc/aliases -t  "${pkgdir}"/etc/smtpd/
67   install -Dm644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}/
69   install -Dm644 ../smtpd.service -t "${pkgdir}"/usr/lib/systemd/system/
70   install -Dm644 ../smtpd.socket -t "${pkgdir}"/usr/lib/systemd/system/
71   install -Dm644 ../opensmtpd.sysusers "${pkgdir}"/usr/lib/sysusers.d/opensmtpd.conf