forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
postgrey-1.37_p20190625-r1.ebuild
76 lines (61 loc) · 1.72 KB
/
postgrey-1.37_p20190625-r1.ebuild
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
67
68
69
70
71
72
73
74
75
76
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit systemd
COMMIT="eb420c5dee57dd54e6f63bad5d74e85f5cc9535d"
DESCRIPTION="Postgrey is a Postfix policy server implementing greylisting"
HOMEPAGE="https://postgrey.schweikert.ch/"
SRC_URI="https://github.com/schweikert/postgrey/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${PN}-${COMMIT}"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ppc ppc64 x86"
DEPEND="
acct-group/postgrey
acct-user/postgrey
"
# TODO: Use db.eclass?
RDEPEND="
${DEPEND}
>=dev-lang/perl-5.6.0
dev-perl/Net-Server
dev-perl/IO-Multiplex
dev-perl/BerkeleyDB
dev-perl/Net-DNS
dev-perl/NetAddr-IP
dev-perl/Net-RBLClient
dev-perl/Parse-Syslog
virtual/perl-Digest-SHA
>=sys-libs/db-4.1
"
src_prepare() {
default
# bug #479400
sed -i 's@#!/usr/bin/perl -T -w@#!/usr/bin/perl -w@' postgrey || die "sed failed"
sed -i -e '/git/d' Makefile || die
}
src_install() {
# postgrey data/DB in /var
diropts -m0770 -o ${PN} -g ${PN}
dodir /var/spool/postfix/${PN}
keepdir /var/spool/postfix/${PN}
fowners postgrey:postgrey /var/spool/postfix/${PN}
fperms 0770 /var/spool/postfix/${PN}
# postgrey binary
dosbin ${PN}
dosbin contrib/postgreyreport
# policy-test script
dosbin policy-test
# postgrey data in /etc/postfix
insinto /etc/postfix
insopts -o root -g ${PN} -m 0640
doins postgrey_whitelist_clients postgrey_whitelist_recipients
# documentation
dodoc Changes README README.exim
# init.d + conf.d files
insopts -o root -g root -m 755
newinitd "${FILESDIR}"/${PN}-1.34-r3.rc.new ${PN}
insopts -o root -g root -m 640
newconfd "${FILESDIR}"/${PN}.conf.new ${PN}
systemd_dounit "${FILESDIR}"/postgrey.service
}