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"
22 DEPEND="dev-libs/openssl:0
27 app-misc/ca-certificates
44 S=${WORKDIR}/${MY_P/_}
47 # Use /run instead of /var/run
48 sed -i -e '/pidfile_path/s:_PATH_VARRUN:"/run/":' openbsd-compat/pidfile.c || die
56 AR="$(which "$AR")" econf \
58 --with-privsep-user=smtpd \
59 --with-queue-user=smtpq \
60 --with-privsep-path=/var/empty \
61 --with-sock-dir=/run \
62 --sysconfdir=/etc/opensmtpd \
63 --with-ca-file=/etc/ssl/certs/ca-certificates.crt \
69 newinitd "${FILESDIR}"/smtpd.initd smtpd
70 systemd_dounit "${FILESDIR}"/smtpd.{service,socket}
71 use pam && newpamd "${FILESDIR}"/smtpd.pam smtpd
74 dosym /usr/sbin/smtpctl /usr/sbin/sendmail
75 dosym /usr/sbin/smtpctl /usr/bin/sendmail
76 dosym /usr/sbin/smtpctl /usr/$(get_libdir)/sendmail
82 enewuser smtpd 25 -1 /var/empty smtpd
84 enewuser smtpq 252 -1 /var/empty smtpq
89 einfo "Plugins for SQLite, MySQL, PostgreSQL, LDAP, socketmaps,"
90 einfo "Redis, and many other useful addons and filters are"
91 einfo "available in the mail-filter/opensmtpd-extras package."