Gentoo Archives: gentoo-commits

From: Marc Schiffbauer <mschiff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/postfwd/files/, mail-filter/postfwd/
Date: Mon, 01 Apr 2019 22:06:35
Message-Id: 1554156345.9cbf9208b57473f897dcf82dffdd22144e35d8d1.mschiff@gentoo
1 commit: 9cbf9208b57473f897dcf82dffdd22144e35d8d1
2 Author: Tomas Mozes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Thu Mar 28 08:51:21 2019 +0000
4 Commit: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
5 CommitDate: Mon Apr 1 22:05:45 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cbf9208
7
8 mail-filter/postfwd: improve ebuild
9
10 Package-Manager: Portage-2.3.62, Repoman-2.3.12
11 Signed-off-by: Marc Schiffbauer <mschiff <AT> gentoo.org>
12 Closes: https://github.com/gentoo/gentoo/pull/11521
13
14 mail-filter/postfwd/files/postfwd.init.3-r1 | 11 ++++
15 mail-filter/postfwd/postfwd-2.00-r1.ebuild | 87 +++++++++++++++++++++++++++++
16 2 files changed, 98 insertions(+)
17
18 diff --git a/mail-filter/postfwd/files/postfwd.init.3-r1 b/mail-filter/postfwd/files/postfwd.init.3-r1
19 new file mode 100644
20 index 00000000000..496fea75720
21 --- /dev/null
22 +++ b/mail-filter/postfwd/files/postfwd.init.3-r1
23 @@ -0,0 +1,11 @@
24 +#!/sbin/openrc-run
25 +# Copyright 1999-2019 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +command="/usr/sbin/postfwd3"
29 +command_args="--nodaemon --file ${POSTFWD_CONFIG} --interface=${POSTFWD_LISTEN} \
30 + --port=${POSTFWD_PORT} ${POSTFWD_OPTS}"
31 +command_background=true
32 +command_user="${POSTFWD_USER}:${POSTFWD_GROUP}"
33 +pidfile="/run/${RC_SVCNAME}.pid"
34 +required_files="${POSTFWD_CONFIG}"
35
36 diff --git a/mail-filter/postfwd/postfwd-2.00-r1.ebuild b/mail-filter/postfwd/postfwd-2.00-r1.ebuild
37 new file mode 100644
38 index 00000000000..df52b4a6f05
39 --- /dev/null
40 +++ b/mail-filter/postfwd/postfwd-2.00-r1.ebuild
41 @@ -0,0 +1,87 @@
42 +# Copyright 1999-2019 Gentoo Authors
43 +# Distributed under the terms of the GNU General Public License v2
44 +
45 +EAPI=7
46 +
47 +inherit systemd user
48 +
49 +DESCRIPTION="Versatile Postfix policy server with a flexible ruleset based configuration"
50 +HOMEPAGE="https://www.postfwd.org/"
51 +SRC_URI="https://www.postfwd.org/${P}.tar.gz"
52 +
53 +LICENSE="BSD"
54 +SLOT="0"
55 +KEYWORDS="~amd64 ~x86"
56 +
57 +DEPEND=""
58 +RDEPEND=">=dev-lang/perl-5.16.3
59 + dev-perl/Net-CIDR-Lite
60 + dev-perl/Net-DNS
61 + dev-perl/Net-Server
62 + dev-perl/NetAddr-IP
63 + virtual/perl-Digest-MD5
64 + virtual/perl-Storable
65 + virtual/perl-Sys-Syslog
66 + virtual/perl-Time-HiRes
67 +"
68 +
69 +S=${WORKDIR}/${PN}
70 +
71 +pkg_setup() {
72 + enewgroup postfwd
73 + enewuser postfwd -1 -1 -1 postfwd
74 +}
75 +
76 +src_install() {
77 + local BIN="postfwd3"
78 + # program
79 + dosbin sbin/${BIN}
80 +
81 + # man pages and documentation
82 + doman man/man8/${BIN}.8
83 + dodoc doc/{${BIN}.CHANGELOG,${BIN}.txt}
84 +
85 + # example configuration
86 + dodoc etc/${PN}.cf.sample
87 +
88 + # plugins and tools
89 + dodoc -r plugins tools
90 +
91 + # start scripts script and respective configuration file
92 + newinitd "${FILESDIR}"/${PN}.init.3-r1 ${PN}
93 + newconfd "${FILESDIR}"/${PN}.conf.3 ${PN}
94 + systemd_newunit "${FILESDIR}"/${PN}.service.3 ${PN}.service
95 +}
96 +
97 +pkg_postinst() {
98 + einfo
99 + einfo "${PN} has no default configuration for safety reasons. Every"
100 + einfo "mail system is different, so you should craft a set of rules"
101 + einfo "that is suitable for your environment and save it to:"
102 + einfo " ${EROOT}/etc/postfwd.cf"
103 + einfo "You can find a sample configuration in:"
104 + einfo " ${EROOT}/usr/share/doc/${PF}"
105 + einfo
106 + einfo "If you want ${PN} to start on system boot, you have to add it your"
107 + einfo "default run level if using OpenRC:"
108 + einfo " # rc-update add postfwd default"
109 + einfo "Also remember to edit ${EROOT}/etc/conf.d/${PN} to your liking."
110 + einfo
111 + einfo "Or - if you are using systemd - enable the service:"
112 + einfo " # systemctl enable postfwd"
113 + einfo
114 + einfo "A plugins sample folder has been placed under:"
115 + einfo
116 + einfo " ${EROOT}/usr/share/doc/${PF}/plugins"
117 + einfo
118 + einfo "You can find additional tools for testing ${PN} in:"
119 + einfo " ${EROOT}/usr/share/doc/${PF}/tools"
120 +
121 + ewarn
122 + ewarn "Please read the documentation carefully and properly test new"
123 + ewarn "rulesets before putting them into production use. Otherwise you"
124 + ewarn "risk accidental mail loss or worse."
125 + ewarn
126 + ewarn "Visit https://www.postfwd.org/ for more information."
127 + ewarn
128 +}