mail-mta/postfix: x86 stable wrt bug #712734
[gentoo.git] / mail-mta / opensmtpd / opensmtpd-6.6.4_p1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit pam systemd
7
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"
11
12 LICENSE="ISC BSD BSD-1 BSD-2 BSD-4"
13 SLOT="0"
14 KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
15 IUSE="libressl pam +mta"
16
17 DEPEND="
18         acct-user/smtpd
19         acct-user/smtpq
20         !libressl? ( >=dev-libs/openssl-1.1:0= )
21         libressl? ( dev-libs/libressl:0= )
22         elibc_musl? ( sys-libs/fts-standalone )
23         sys-libs/zlib
24         pam? ( sys-libs/pam )
25         sys-libs/db:=
26         dev-libs/libevent
27         app-misc/ca-certificates
28         net-mail/mailbase
29         net-libs/libasr
30         !mail-mta/courier
31         !mail-mta/esmtp
32         !mail-mta/exim
33         !mail-mta/mini-qmail
34         !mail-mta/msmtp[mta]
35         !mail-mta/netqmail
36         !mail-mta/nullmailer
37         !mail-mta/postfix
38         !mail-mta/qmail-ldap
39         !mail-mta/sendmail
40         !mail-mta/ssmtp[mta]
41 "
42 RDEPEND="${DEPEND}"
43
44 S=${WORKDIR}/${P/_}
45
46 src_configure() {
47         econf \
48                 --sysconfdir=/etc/smtpd \
49                 --with-path-mbox=/var/spool/mail \
50                 --with-path-empty=/var/empty \
51                 --with-path-socket=/run \
52                 --with-path-CAfile=/etc/ssl/certs/ca-certificates.crt \
53                 --with-user-smtpd=smtpd \
54                 --with-user-queue=smtpq \
55                 --with-group-queue=smtpq \
56                 $(use_with pam auth-pam)
57 }
58
59 src_install() {
60         default
61         newinitd "${FILESDIR}"/smtpd.initd smtpd
62         systemd_dounit "${FILESDIR}"/smtpd.{service,socket}
63         use pam && newpamd "${FILESDIR}"/smtpd.pam smtpd
64         dosym smtpctl /usr/sbin/makemap
65         dosym smtpctl /usr/sbin/newaliases
66         if use mta ; then
67                 dodir /usr/sbin
68                 dosym smtpctl /usr/sbin/sendmail
69                 dosym ../sbin/smtpctl /usr/bin/sendmail
70                 mkdir -p "${ED}"/usr/$(get_libdir) || die
71                 ln -s --relative "${ED}"/usr/sbin/smtpctl "${ED}"/usr/$(get_libdir)/sendmail || die
72         fi
73 }
74
75 pkg_postinst() {
76         ewarn
77         ewarn "If you're upgrading from version 6.0, note that the"
78         ewarn "configuration syntax has changed, and config files"
79         ewarn "now live in /etc/smtpd instead of /etc/opensmtpd."
80         ewarn
81 }