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