dev-db/slony1: Remove POSTGRES_COMPAT 9.3
[gentoo.git] / mail-filter / postfwd / postfwd-2.00-r1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit systemd user
7
8 DESCRIPTION="Versatile Postfix policy server with a flexible ruleset based configuration"
9 HOMEPAGE="https://www.postfwd.org/"
10 SRC_URI="https://www.postfwd.org/${P}.tar.gz"
11
12 LICENSE="BSD"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15
16 DEPEND=""
17 RDEPEND=">=dev-lang/perl-5.16.3
18         dev-perl/Net-CIDR-Lite
19         dev-perl/Net-DNS
20         dev-perl/Net-Server
21         dev-perl/NetAddr-IP
22         virtual/perl-Digest-MD5
23         virtual/perl-Storable
24         virtual/perl-Sys-Syslog
25         virtual/perl-Time-HiRes
26 "
27
28 S=${WORKDIR}/${PN}
29
30 pkg_setup() {
31         enewgroup postfwd
32         enewuser postfwd -1 -1 -1 postfwd
33 }
34
35 src_install() {
36         local BIN="postfwd3"
37         # program
38         dosbin sbin/${BIN}
39
40         # man pages and documentation
41         doman man/man8/${BIN}.8
42         dodoc doc/{${BIN}.CHANGELOG,${BIN}.txt}
43
44         # example configuration
45         dodoc etc/${PN}.cf.sample
46
47         # plugins and tools
48         dodoc -r plugins tools
49
50         # start scripts script and respective configuration file
51         newinitd "${FILESDIR}"/${PN}.init.3-r1 ${PN}
52         newconfd "${FILESDIR}"/${PN}.conf.3 ${PN}
53         systemd_newunit "${FILESDIR}"/${PN}.service.3 ${PN}.service
54 }
55
56 pkg_postinst() {
57         einfo
58         einfo "${PN} has no default configuration for safety reasons. Every"
59         einfo "mail system is different, so you should craft a set of rules"
60         einfo "that is suitable for your environment and save it to:"
61         einfo "   ${EROOT}/etc/postfwd.cf"
62         einfo "You can find a sample configuration in:"
63         einfo "   ${EROOT}/usr/share/doc/${PF}"
64         einfo
65         einfo "If you want ${PN} to start on system boot, you have to add it your"
66         einfo "default run level if using OpenRC:"
67         einfo "   # rc-update add postfwd default"
68         einfo "Also remember to edit ${EROOT}/etc/conf.d/${PN} to your liking."
69         einfo
70         einfo "Or - if you are using systemd - enable the service:"
71         einfo "   # systemctl enable postfwd"
72         einfo
73         einfo "A plugins sample folder has been placed under:"
74         einfo
75         einfo "   ${EROOT}/usr/share/doc/${PF}/plugins"
76         einfo
77         einfo "You can find additional tools for testing ${PN} in:"
78         einfo "   ${EROOT}/usr/share/doc/${PF}/tools"
79
80         ewarn
81         ewarn "Please read the documentation carefully and properly test new"
82         ewarn "rulesets before putting them into production use. Otherwise you"
83         ewarn "risk accidental mail loss or worse."
84         ewarn
85         ewarn "Visit https://www.postfwd.org/ for more information."
86         ewarn
87 }