1 |
commit: aeffb0da0983d2fa61c3e8e61471dd835f91355c |
2 |
Author: Craig Andrews <candrews <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Nov 21 02:14:08 2018 +0000 |
4 |
Commit: Craig Andrews <candrews <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Nov 21 02:14:08 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aeffb0da |
7 |
|
8 |
mail-filter/amavisd-new: Fix installed systemd service filename |
9 |
|
10 |
Closes: https://bugs.gentoo.org/671598 |
11 |
Package-Manager: Portage-2.3.52, Repoman-2.3.12 |
12 |
Signed-off-by: Craig Andrews <candrews <AT> gentoo.org> |
13 |
|
14 |
.../amavisd-new/amavisd-new-2.11.1-r1.ebuild | 190 +++++++++++++++++++++ |
15 |
1 file changed, 190 insertions(+) |
16 |
|
17 |
diff --git a/mail-filter/amavisd-new/amavisd-new-2.11.1-r1.ebuild b/mail-filter/amavisd-new/amavisd-new-2.11.1-r1.ebuild |
18 |
new file mode 100644 |
19 |
index 00000000000..d436def3bdb |
20 |
--- /dev/null |
21 |
+++ b/mail-filter/amavisd-new/amavisd-new-2.11.1-r1.ebuild |
22 |
@@ -0,0 +1,190 @@ |
23 |
+# Copyright 1999-2018 Gentoo Authors |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=6 |
27 |
+inherit systemd user |
28 |
+ |
29 |
+DESCRIPTION="High-performance interface between the MTA and content checkers" |
30 |
+HOMEPAGE="https://gitlab.com/amavis/amavis" |
31 |
+SRC_URI="${HOMEPAGE}/-/archive/${P}/amavis-${P}.tar.gz" |
32 |
+PORTAGE_DOHTML_WARN_ON_SKIPPED_FILES=yes |
33 |
+ |
34 |
+LICENSE="GPL-2 BSD-2" |
35 |
+SLOT="0" |
36 |
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86" |
37 |
+IUSE="clamav courier dkim ldap mysql postgres qmail razor snmp spamassassin zmq" |
38 |
+ |
39 |
+DEPEND=">=sys-apps/sed-4 |
40 |
+ >=dev-lang/perl-5.10.0" |
41 |
+ |
42 |
+RDEPEND="${DEPEND} |
43 |
+ >=sys-apps/coreutils-5.0-r3 |
44 |
+ app-arch/cpio |
45 |
+ app-arch/gzip |
46 |
+ app-arch/bzip2 |
47 |
+ app-arch/arc |
48 |
+ app-arch/cabextract |
49 |
+ app-arch/freeze |
50 |
+ app-arch/lha |
51 |
+ app-arch/lrzip |
52 |
+ app-arch/lzop |
53 |
+ app-arch/ncompress |
54 |
+ app-arch/p7zip |
55 |
+ app-arch/pax |
56 |
+ app-arch/unarj |
57 |
+ app-arch/unrar |
58 |
+ app-arch/xz-utils |
59 |
+ app-arch/zoo |
60 |
+ net-mail/ripole |
61 |
+ >=dev-perl/Archive-Zip-1.14 |
62 |
+ >=virtual/perl-IO-Compress-1.35 |
63 |
+ >=virtual/perl-Compress-Raw-Zlib-2.017 |
64 |
+ net-mail/tnef |
65 |
+ virtual/perl-MIME-Base64 |
66 |
+ >=dev-perl/MIME-tools-5.415 |
67 |
+ >=dev-perl/MailTools-1.58 |
68 |
+ >=dev-perl/Net-Server-0.91 |
69 |
+ virtual/perl-Digest-MD5 |
70 |
+ dev-perl/IO-stringy |
71 |
+ virtual/perl-IO-Socket-IP |
72 |
+ >=virtual/perl-Time-HiRes-1.49 |
73 |
+ dev-perl/Unix-Syslog |
74 |
+ dev-perl/Net-LibIDN |
75 |
+ dev-perl/File-LibMagic |
76 |
+ >=sys-libs/db-4.4.20 |
77 |
+ dev-perl/BerkeleyDB |
78 |
+ dev-perl/Convert-BinHex |
79 |
+ >=dev-perl/Mail-DKIM-0.31 |
80 |
+ virtual/perl-File-Temp |
81 |
+ dev-perl/Net-SSLeay |
82 |
+ dev-perl/IO-Socket-SSL |
83 |
+ virtual/mta |
84 |
+ clamav? ( app-antivirus/clamav ) |
85 |
+ ldap? ( >=dev-perl/perl-ldap-0.33 ) |
86 |
+ mysql? ( dev-perl/DBD-mysql ) |
87 |
+ postgres? ( dev-perl/DBD-Pg ) |
88 |
+ razor? ( mail-filter/razor ) |
89 |
+ snmp? ( net-analyzer/net-snmp[perl] ) |
90 |
+ spamassassin? ( mail-filter/spamassassin dev-perl/Image-Info ) |
91 |
+ zmq? ( dev-perl/ZMQ-LibZMQ3 )" |
92 |
+ |
93 |
+AMAVIS_ROOT="/var/amavis" |
94 |
+S="${WORKDIR}/amavis-${P}" |
95 |
+ |
96 |
+pkg_setup() { |
97 |
+ # Create the user beforehand so that we can install the config file |
98 |
+ # (and some directories) with group "amavis" in src_install(). |
99 |
+ enewgroup amavis |
100 |
+ enewuser amavis -1 -1 "${AMAVIS_ROOT}" amavis |
101 |
+} |
102 |
+ |
103 |
+src_prepare() { |
104 |
+ # amavisd-new version 2.11.0 breaks DKIM signing of outbound mail, |
105 |
+ # see https://bugs.gentoo.org/603582 |
106 |
+ eapply "${FILESDIR}/amavisd-2.11.0-dkim.patch" |
107 |
+ |
108 |
+ if use courier ; then |
109 |
+ eapply -p0 amavisd-new-courier.patch |
110 |
+ fi |
111 |
+ |
112 |
+ if use qmail ; then |
113 |
+ eapply -p0 amavisd-new-qmqpqq.patch |
114 |
+ fi |
115 |
+ |
116 |
+ sed -i \ |
117 |
+ -e '/daemon/s/vscan/amavis/' \ |
118 |
+ -e "s:'/var/virusmails':\"\$MYHOME/quarantine\":" \ |
119 |
+ "${S}/amavisd.conf" "${S}/amavis-mc" || die "missing conf file" |
120 |
+ |
121 |
+ if ! use dkim ; then |
122 |
+ sed -i -e '/enable_dkim/s/1/0/' "${S}/amavisd.conf" \ |
123 |
+ || die "missing conf file - dkim" |
124 |
+ fi |
125 |
+ |
126 |
+ if use zmq ; then |
127 |
+ sed -i -e '/enable_zmq/s/# //' "${S}/amavisd.conf" \ |
128 |
+ || die "missing conf file - zmq" |
129 |
+ fi |
130 |
+ |
131 |
+ if ! use spamassassin ; then |
132 |
+ sed -i -e \ |
133 |
+ "/^#[[:space:]]*@bypass_spam_checks_maps[[:space:]]*=[[:space:]]*(1)/s/^#//" \ |
134 |
+ "${S}/amavisd.conf" || die "missing conf file - sa" |
135 |
+ fi |
136 |
+ |
137 |
+ eapply_user |
138 |
+} |
139 |
+ |
140 |
+src_install() { |
141 |
+ dosbin amavisd amavisd-agent amavisd-nanny amavisd-release \ |
142 |
+ amavisd-signer amavisd-status |
143 |
+ dobin p0f-analyzer.pl amavisd-submit |
144 |
+ |
145 |
+ if use snmp ; then |
146 |
+ dosbin amavisd-snmp-subagent |
147 |
+ use zmq && dosbin amavisd-snmp-subagent-zmq |
148 |
+ dodoc AMAVIS-MIB.txt |
149 |
+ newinitd "${FILESDIR}"/amavisd-snmp.initd amavisd-snmp |
150 |
+ fi |
151 |
+ |
152 |
+ if use zmq ; then |
153 |
+ dosbin amavis-services amavis-mc |
154 |
+ newinitd "${FILESDIR}"/amavis-mc.initd amavis-mc |
155 |
+ fi |
156 |
+ |
157 |
+ if use ldap ; then |
158 |
+ dodir /etc/openldap/schema |
159 |
+ insinto /etc/openldap/schema |
160 |
+ newins LDAP.schema ${PN}.schema || die |
161 |
+ fi |
162 |
+ |
163 |
+ # The config file should be root:amavis so that the amavis user can |
164 |
+ # read (only) it after dropping privileges. And of course he should |
165 |
+ # own everything in his home directory. |
166 |
+ insinto /etc |
167 |
+ insopts -m0640 -g amavis |
168 |
+ doins amavisd.conf |
169 |
+ |
170 |
+ # Implementation detail? Keepdir calls dodir under the hood. |
171 |
+ diropts -o amavis -g amavis |
172 |
+ keepdir "${AMAVIS_ROOT}"/{,db,quarantine,tmp,var} |
173 |
+ |
174 |
+ # BEWARE: |
175 |
+ # |
176 |
+ # Anything below this line is using the mangled insopts/diropts from |
177 |
+ # above! |
178 |
+ # |
179 |
+ |
180 |
+ newinitd "${FILESDIR}/amavisd.initd-r2" amavisd |
181 |
+ |
182 |
+ systemd_newunit "${FILESDIR}/amavisd.service-r1" amavisd.service |
183 |
+ |
184 |
+ dodoc AAAREADME.first INSTALL MANIFEST RELEASE_NOTES TODO \ |
185 |
+ amavisd.conf-default amavisd-custom.conf |
186 |
+ |
187 |
+ docinto README_FILES |
188 |
+ dodoc README_FILES/README* |
189 |
+ dodoc -r README_FILES/*.{html,css} |
190 |
+ docinto README_FILES/images |
191 |
+ dodoc README_FILES/images/*.png |
192 |
+ docinto README_FILES/images/callouts |
193 |
+ dodoc README_FILES/images/callouts/*.png |
194 |
+ |
195 |
+ docinto test-messages |
196 |
+ dodoc test-messages/README |
197 |
+ dodoc test-messages/sample.tar.gz.compl |
198 |
+} |
199 |
+ |
200 |
+pkg_preinst() { |
201 |
+ # TODO: the following is done as root, but should probably be done |
202 |
+ # as the amavis user. |
203 |
+ if use razor ; then |
204 |
+ if [ ! -d "${ROOT}${AMAVIS_ROOT}/.razor" ] ; then |
205 |
+ elog "Setting up initial razor config files..." |
206 |
+ |
207 |
+ razor-admin -create -home="${D}/${AMAVIS_ROOT}/.razor" |
208 |
+ sed -i -e "s:debuglevel\([ ]*\)= .:debuglevel\1= 0:g" \ |
209 |
+ "${D}/${AMAVIS_ROOT}/.razor/razor-agent.conf" || die |
210 |
+ fi |
211 |
+ fi |
212 |
+} |