summaryrefslogtreecommitdiffstats
path: root/mail-mta/opensmtpd/opensmtpd-5.2.ebuild
blob: 7e3cf84b76ea3139e09a267215651d23ce618d25 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

inherit multilib user flag-o-matic eutils pam

DESCRIPTION="Lightweight but featured SMTP daemon from OpenBSD"
HOMEPAGE="http://www.opensmtpd.org/"
SRC_URI="http://www.opensmtpd.org/archives/opensmtpd-portable-latest.tar.gz"

LICENSE="ISC BSD BSD-1 BSD-2 BSD-4"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="pam"

DEPEND="dev-libs/openssl
		sys-libs/zlib
		pam? ( virtual/pam )
		sys-libs/db
		dev-db/sqlite:3
		dev-libs/libevent
		!net-mail/mailwrapper
		!mail-mta/courier
		!mail-mta/esmtp
		!mail-mta/exim
		!mail-mta/mini-qmail
		!mail-mta/msmtp[mta]
		!mail-mta/nbsmtp
		!mail-mta/netqmail
		!mail-mta/nullmailer
		!mail-mta/postfix
		!mail-mta/qmail-ldap
		!mail-mta/sendmail
		!mail-mta/ssmtp[mta]
"
RDEPEND="${DEPEND}"

S=${WORKDIR}/${P}.xp1

src_prepare() {
	epatch "${FILESDIR}"/pam.patch
	epatch "${FILESDIR}"/strict-alias.patch
}

src_configure() {
	./bootstrap
	econf \
		--with-privsep-user=smtpd \
		--with-privsep-path=/var/empty \
		--with-sock-dir=/var/run \
		--sysconfdir=/etc/opensmtpd \
		$(use_with pam)
}

src_install() {
	default
	newinitd "${FILESDIR}"/opensmtpd.initd opensmtpd
	use pam && newpamd "${FILESDIR}"/opensmtpd.pam opensmtpd
}

pkg_preinst() {
	enewgroup smtpd 25
	enewuser smtpd 25 -1 /var/empty smtpd
}