1 |
commit: 6380f83b6aa3cdb85211e79686d719943661ca92 |
2 |
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 3 12:24:59 2015 +0000 |
4 |
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 3 12:25:29 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6380f83b |
7 |
|
8 |
mail-filter/postfwd: Install systemd unit file (#528034 by Stefan G. Weichinger) |
9 |
|
10 |
Package-Manager: portage-2.2.22 |
11 |
|
12 |
mail-filter/postfwd/files/postfwd.service | 11 ++++ |
13 |
mail-filter/postfwd/postfwd-1.35-r3.ebuild | 88 ++++++++++++++++++++++++++++++ |
14 |
2 files changed, 99 insertions(+) |
15 |
|
16 |
diff --git a/mail-filter/postfwd/files/postfwd.service b/mail-filter/postfwd/files/postfwd.service |
17 |
new file mode 100644 |
18 |
index 0000000..376e8d2 |
19 |
--- /dev/null |
20 |
+++ b/mail-filter/postfwd/files/postfwd.service |
21 |
@@ -0,0 +1,11 @@ |
22 |
+[Unit] |
23 |
+Description=Postfix firewall daemon |
24 |
+ |
25 |
+[Service] |
26 |
+Type=forking |
27 |
+ExecStart=/usr/sbin/postfwd2 --shortlog --summary=600 --cache=600 --cache-rbl-timeout=3600 --cleanup-requests=1200 --cleanup-rbls=1800 --cleanup-rates=1200 --daemon --file=/etc/postfwd/postfwd.cf --interface=127.0.0.1 --port=10040 --pidfile=/var/run/postfwd.pid --user=postfwd --group=postfwd |
28 |
+ExecStop=/usr/sbin/postfwd2 --file=/etc/postfwd/postfwd.cf --pidfile=/var/run/postfwd.pid --kill |
29 |
+ExecReload=/usr/sbin/postfwd2 --file=/etc/postfwd/postfwd.cf --pidfile=/var/run/postfwd.pid --reload |
30 |
+ |
31 |
+[Install] |
32 |
+WantedBy=multi-user.target |
33 |
|
34 |
diff --git a/mail-filter/postfwd/postfwd-1.35-r3.ebuild b/mail-filter/postfwd/postfwd-1.35-r3.ebuild |
35 |
new file mode 100644 |
36 |
index 0000000..a35f890 |
37 |
--- /dev/null |
38 |
+++ b/mail-filter/postfwd/postfwd-1.35-r3.ebuild |
39 |
@@ -0,0 +1,88 @@ |
40 |
+# Copyright 1999-2015 Gentoo Foundation |
41 |
+# Distributed under the terms of the GNU General Public License v2 |
42 |
+# $Id$ |
43 |
+ |
44 |
+EAPI=5 |
45 |
+ |
46 |
+inherit eutils user systemd |
47 |
+ |
48 |
+DESCRIPTION="Versatile Postfix policy server with a flexible ruleset based configuration" |
49 |
+HOMEPAGE="http://www.postfwd.org/" |
50 |
+SRC_URI="http://www.postfwd.org/${P}.tar.gz" |
51 |
+ |
52 |
+LICENSE="BSD" |
53 |
+SLOT="0" |
54 |
+KEYWORDS="~amd64 ~x86" |
55 |
+IUSE="+tools" |
56 |
+ |
57 |
+DEPEND="" |
58 |
+RDEPEND=">=dev-lang/perl-5.16.3 |
59 |
+ virtual/perl-Sys-Syslog |
60 |
+ dev-perl/Net-DNS |
61 |
+ dev-perl/net-server |
62 |
+" |
63 |
+ |
64 |
+pkg_setup() { |
65 |
+ enewgroup postfwd |
66 |
+ enewuser postfwd -1 -1 -1 postfwd |
67 |
+} |
68 |
+ |
69 |
+src_install() { |
70 |
+ local BIN="postfwd2" |
71 |
+ # programs and tools |
72 |
+ dosbin "${S}"/sbin/${BIN} |
73 |
+ |
74 |
+ # man pages and documentation |
75 |
+ doman "${S}"/man/man8/${BIN}.8 |
76 |
+ dodoc "${S}"/doc/{${BIN}.CHANGELOG,${BIN}.txt} |
77 |
+ |
78 |
+ # example configuration(s) |
79 |
+ insinto /usr/share/doc/${PF}/examples |
80 |
+ newins "${S}"/etc/${PN}.cf.sample ${PN}.cf.dist |
81 |
+ |
82 |
+ # plugins |
83 |
+ dodoc -r "${S}"/plugins |
84 |
+ |
85 |
+ # tools |
86 |
+ if use tools; then |
87 |
+ dodoc -r "${S}"/tools |
88 |
+ fi |
89 |
+ |
90 |
+ # start scripts script and respective configuration file |
91 |
+ newinitd "${FILESDIR}"/${PN}.init ${PN} |
92 |
+ newconfd "${FILESDIR}"/${PN}.conf ${PN} |
93 |
+ systemd_dounit "${FILESDIR}"/${PN}.service |
94 |
+} |
95 |
+ |
96 |
+pkg_postinst() { |
97 |
+ einfo |
98 |
+ einfo "${PN} has no default configuration for safety reasons. Every" |
99 |
+ einfo "mail system is different, so you should craft a set of rules" |
100 |
+ einfo "that is suitable for your environment and save it to:" |
101 |
+ einfo " /etc/postfix/postfwd.cf" |
102 |
+ einfo "You can find example configurations in:" |
103 |
+ einfo " /usr/share/doc/${PF}/examples" |
104 |
+ einfo |
105 |
+ einfo "If you want ${PN} to start on system boot, you have to add it your" |
106 |
+ einfo "default run level:" |
107 |
+ einfo " # rc-update add postfwd default" |
108 |
+ einfo "Also remember to edit /etc/conf.d/${PN} to your liking." |
109 |
+ einfo |
110 |
+ einfo "A plugins sampe folder has been placed under:" |
111 |
+ einfo |
112 |
+ einfo " /usr/share/doc/${PF}/plugins" |
113 |
+ |
114 |
+ if use tools; then |
115 |
+ einfo |
116 |
+ einfo "You can find additional tools for testing ${PN} in:" |
117 |
+ einfo " /usr/share/doc/${PF}/tools" |
118 |
+ fi |
119 |
+ |
120 |
+ ewarn |
121 |
+ ewarn "Please read the documentation carefully and properly test new" |
122 |
+ ewarn "rulesets before putting them into production use. Otherwise you" |
123 |
+ ewarn "risk accidental mail loss or worse." |
124 |
+ ewarn |
125 |
+ ewarn "Visit http://www.postfwd.org/ for more information." |
126 |
+ ewarn |
127 |
+} |