1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit pam toolchain-funcs systemd
8 DESCRIPTION="Lightweight but featured SMTP daemon from OpenBSD"
9 HOMEPAGE="https://www.opensmtpd.org"
10 SRC_URI="https://www.opensmtpd.org/archives/${P/_}.tar.gz"
12 LICENSE="ISC BSD BSD-1 BSD-2 BSD-4"
14 KEYWORDS="~amd64 ~arm ~arm64 ~x86"
15 IUSE="libressl pam +mta"
20 !libressl? ( dev-libs/openssl:0= )
21 libressl? ( dev-libs/libressl:0= )
22 elibc_musl? ( sys-libs/fts-standalone )
27 app-misc/ca-certificates
46 "${FILESDIR}/${P}-fix-crash-on-auth.patch"
47 "${FILESDIR}/${P}-openssl_1.1.patch"
48 "${FILESDIR}/${P}-security-fixes.patch"
53 AR="$(which "$AR")" econf \
55 --with-user-smtpd=smtpd \
56 --with-user-queue=smtpq \
57 --with-group-queue=smtpq \
58 --with-path-socket=/run \
59 --with-path-CAfile=/etc/ssl/certs/ca-certificates.crt \
60 --sysconfdir=/etc/opensmtpd \
61 $(use_with pam auth-pam)
66 newinitd "${FILESDIR}"/smtpd.initd smtpd
67 systemd_dounit "${FILESDIR}"/smtpd.{service,socket}
68 use pam && newpamd "${FILESDIR}"/smtpd.pam smtpd
69 dosym smtpctl /usr/sbin/makemap
70 dosym smtpctl /usr/sbin/newaliases
73 dosym smtpctl /usr/sbin/sendmail
74 dosym ../sbin/smtpctl /usr/bin/sendmail
75 mkdir -p "${ED}"/usr/$(get_libdir) || die
76 ln -s --relative "${ED}"/usr/sbin/smtpctl "${ED}"/usr/$(get_libdir)/sendmail || die