1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit multilib user flag-o-matic eutils pam toolchain-funcs autotools systemd versionator
9 DESCRIPTION="Lightweight but featured SMTP daemon from OpenBSD"
10 HOMEPAGE="http://www.opensmtpd.org/"
12 if [ $(get_last_version_component_index) -eq 4 ]; then
13 MY_P="${PN}-$(get_version_component_range 4-)"
15 SRC_URI="https://www.opensmtpd.org/archives/${MY_P/_}.tar.gz"
17 LICENSE="ISC BSD BSD-1 BSD-2 BSD-4"
19 KEYWORDS="~amd64 ~x86"
20 IUSE="libressl pam +mta"
22 DEPEND="!libressl? ( dev-libs/openssl:0 )
23 libressl? ( dev-libs/libressl )
28 app-misc/ca-certificates
45 S=${WORKDIR}/${MY_P/_}
48 # Use /run instead of /var/run
49 sed -i -e '/pidfile_path/s:_PATH_VARRUN:"/run/":' openbsd-compat/pidfile.c || die
57 AR="$(which "$AR")" econf \
59 --with-privsep-user=smtpd \
60 --with-queue-user=smtpq \
61 --with-privsep-path=/var/empty \
62 --with-sock-dir=/run \
63 --sysconfdir=/etc/opensmtpd \
64 --with-ca-file=/etc/ssl/certs/ca-certificates.crt \
70 newinitd "${FILESDIR}"/smtpd.initd smtpd
71 systemd_dounit "${FILESDIR}"/smtpd.{service,socket}
72 use pam && newpamd "${FILESDIR}"/smtpd.pam smtpd
75 dosym /usr/sbin/smtpctl /usr/sbin/sendmail
76 dosym /usr/sbin/smtpctl /usr/bin/sendmail
77 dosym /usr/sbin/smtpctl /usr/$(get_libdir)/sendmail
83 enewuser smtpd 25 -1 /var/empty smtpd
85 enewuser smtpq 252 -1 /var/empty smtpq
90 einfo "Plugins for SQLite, MySQL, PostgreSQL, LDAP, socketmaps,"
91 einfo "Redis, and many other useful addons and filters are"
92 einfo "available in the mail-filter/opensmtpd-extras package."