Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/spamassassin/
Date: Mon, 03 Feb 2020 06:38:15
Message-Id: 1580711872.d1b377ebfb6351d9c451fb8642c4fcb85c86e3de.juippis@gentoo
1 commit: d1b377ebfb6351d9c451fb8642c4fcb85c86e3de
2 Author: Philippe Chaintreuil <gentoo_bugs_peep <AT> parallaxshift <DOT> com>
3 AuthorDate: Sun Feb 2 00:08:13 2020 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 3 06:37:52 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1b377eb
7
8 mail-filter/spamassassin: Bump to v3.4.4
9
10 Bug: https://bugs.gentoo.org/707816
11 Closes: https://github.com/gentoo/gentoo/pull/14527
12 Package-Manager: Portage-2.3.84, Repoman-2.3.20
13 Signed-off-by: Philippe Chaintreuil <gentoo_bugs_peep <AT> parallaxshift.com>
14 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
15
16 mail-filter/spamassassin/Manifest | 1 +
17 mail-filter/spamassassin/spamassassin-3.4.4.ebuild | 284 +++++++++++++++++++++
18 2 files changed, 285 insertions(+)
19
20 diff --git a/mail-filter/spamassassin/Manifest b/mail-filter/spamassassin/Manifest
21 index ed1f81dd451..6b5b51cc48d 100644
22 --- a/mail-filter/spamassassin/Manifest
23 +++ b/mail-filter/spamassassin/Manifest
24 @@ -1,2 +1,3 @@
25 DIST Mail-SpamAssassin-3.4.2.tar.bz2 2700016 BLAKE2B a29b4cfce5e578c07ec54b2224191917dc45bcefff071f674c572fc905f1d6324827bcc21c338546bdea11140fc20474a16314218e2fd4fa685965b0e0078df8 SHA512 fe3d9d1d7b9fed3063549afd071066729f1f4d998be91ded1e5afc29bb37c7a298dc5f8f99a282b75435d317b5b5072a81393134ccfe059a73d953e26a9c3885
26 DIST Mail-SpamAssassin-3.4.3.tar.bz2 2739618 BLAKE2B cd77fc99cbec17f10c04f211e773fe2df9dd9c2efb54c9cc169f1fbfed884e74b77c96d8eee333af4bcefb05dee4519408b2e53e0c519734d582f95bad6030d6 SHA512 4d50b30a42d318c3a4c868b4940d1f56c329cc501270df12e1a369dd7de670c30f328a5fbc37dbd3b0d06538b9500085e920939c62de80ad6d8740bc47162cb0
27 +DIST Mail-SpamAssassin-3.4.4.tar.bz2 2741290 BLAKE2B 03dec6c71a43ad7d288a96de32fb61e81e2c793756c76b7c36ec34226483a35123cc291376e7c15ce73571e7de5967cee058a1b34932fd0f27632028d22b092b SHA512 7dfd0cf3426df683f608218da8881538a24e833024f2a1eb0f8513bdf3e4bc6ac48198c4f380efe024a01ae7b6a5ab9d76205cec185d0e4818f1cc79bda0ea3f
28
29 diff --git a/mail-filter/spamassassin/spamassassin-3.4.4.ebuild b/mail-filter/spamassassin/spamassassin-3.4.4.ebuild
30 new file mode 100644
31 index 00000000000..39c0972f5e9
32 --- /dev/null
33 +++ b/mail-filter/spamassassin/spamassassin-3.4.4.ebuild
34 @@ -0,0 +1,284 @@
35 +# Copyright 1999-2020 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=6
39 +
40 +inherit perl-functions systemd toolchain-funcs user eapi7-ver
41 +
42 +MY_P="Mail-SpamAssassin-${PV//_/-}"
43 +S="${WORKDIR}/${MY_P}"
44 +DESCRIPTION="An extensible mail filter which can identify and tag spam"
45 +HOMEPAGE="https://spamassassin.apache.org/"
46 +SRC_URI="mirror://apache/spamassassin/source/${MY_P}.tar.bz2"
47 +
48 +LICENSE="Apache-2.0 GPL-2"
49 +SLOT="0"
50 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-macos"
51 +IUSE="berkdb cron ipv6 ldap libressl mysql postgres qmail sqlite ssl test"
52 +RESTRICT="!test? ( test )"
53 +
54 +# The Makefile.PL script checks for dependencies, but only fails if a
55 +# required (i.e. not optional) dependency is missing. We therefore
56 +# require most of the optional modules only at runtime.
57 +REQDEPEND="dev-lang/perl:=
58 + dev-perl/HTML-Parser
59 + dev-perl/Net-DNS
60 + dev-perl/NetAddr-IP
61 + virtual/perl-Archive-Tar
62 + virtual/perl-Digest-SHA
63 + virtual/perl-IO-Zlib
64 + virtual/perl-Time-HiRes
65 + ssl? (
66 + !libressl? ( dev-libs/openssl:0= )
67 + libressl? ( dev-libs/libressl )
68 + )"
69 +
70 +# SpamAssassin doesn't use libwww-perl except as a fallback for when
71 +# curl/wget are missing, so we depend on one of those instead. Some
72 +# mirrors use https, so we need those utilities to support SSL.
73 +#
74 +# re2c is needed to compile the rules (sa-compile).
75 +#
76 +# We still need the old Digest-SHA1 because razor2 has not been ported
77 +# to Digest-SHA.
78 +OPTDEPEND="app-crypt/gnupg
79 + dev-perl/BSD-Resource
80 + dev-perl/Digest-SHA1
81 + dev-perl/Encode-Detect
82 + dev-perl/Geo-IP
83 + dev-perl/HTTP-Date
84 + dev-perl/Mail-DKIM
85 + dev-perl/Mail-SPF
86 + dev-perl/Net-Patricia
87 + dev-perl/Net-CIDR-Lite
88 + dev-util/re2c
89 + || ( net-misc/wget[ssl] net-misc/curl[ssl] )
90 + virtual/perl-MIME-Base64
91 + virtual/perl-Pod-Parser
92 + berkdb? ( virtual/perl-DB_File )
93 + ipv6? ( dev-perl/IO-Socket-INET6 )
94 + ldap? ( dev-perl/perl-ldap )
95 + mysql? (
96 + dev-perl/DBI
97 + dev-perl/DBD-mysql
98 + )
99 + postgres? (
100 + dev-perl/DBI
101 + dev-perl/DBD-Pg
102 + )
103 + sqlite? (
104 + dev-perl/DBI
105 + dev-perl/DBD-SQLite
106 + )
107 + ssl? ( dev-perl/IO-Socket-SSL )"
108 +
109 +DEPEND="${REQDEPEND}
110 + test? (
111 + ${OPTDEPEND}
112 + virtual/perl-Test-Harness
113 + )"
114 +RDEPEND="${REQDEPEND} ${OPTDEPEND}"
115 +
116 +PATCHES=(
117 +)
118 +
119 +src_prepare() {
120 + default
121 +
122 + # The sa_compile test does some weird stuff like hopping around in
123 + # the directory tree and calling "make" to create a dist tarball
124 + # from ${S}. It fails, and is more trouble than it's worth...
125 + perl_rm_files t/sa_compile.t || die 'failed to remove sa_compile test'
126 +
127 + # The spamc tests (which need the networked spamd daemon) fail for
128 + # irrelevant reasons. It's too hard to disable them (unlike the
129 + # spamd tests themselves -- see src_test), so use a crude
130 + # workaround.
131 + perl_rm_files t/spamc_*.t || die 'failed to remove spamc tests'
132 +
133 + # Upstream bug 7622: this thing needs network access but doesn't
134 + # respect the 'run_net_tests' setting.
135 + perl_rm_files t/urilocalbl_geoip.t \
136 + || die 'failed to remove urilocalbl_geoip tests'
137 +}
138 +
139 +src_configure() {
140 + # This is how and where the perl-module eclass disables the
141 + # MakeMaker interactive prompt.
142 + export PERL_MM_USE_DEFAULT=1
143 +
144 + # Set SYSCONFDIR explicitly so we can't get bitten by bug 48205 again
145 + # (just to be sure, nobody knows how it could happen in the first place).
146 + #
147 + # We also set the path to the perl executable explictly. This will be
148 + # used to create the initial shebang line in the scripts (bug 62276).
149 + perl Makefile.PL \
150 + PREFIX="${EPREFIX}/usr" \
151 + INSTALLDIRS=vendor \
152 + SYSCONFDIR="${EPREFIX}/etc" \
153 + DATADIR="${EPREFIX}/usr/share/spamassassin" \
154 + PERL_BIN="${EPREFIX}/usr/bin/perl" \
155 + ENABLE_SSL="$(usex ssl)" \
156 + DESTDIR="${D}" \
157 + || die 'failed to create a Makefile using Makefile.PL'
158 +
159 + # Now configure spamc.
160 + emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}" spamc/Makefile
161 +}
162 +
163 +src_compile() {
164 + emake
165 + use qmail && emake spamc/qmail-spamc
166 +}
167 +
168 +src_install () {
169 + emake install
170 + einstalldocs
171 +
172 + # Create the stub dir used by sa-update and friends
173 + keepdir /var/lib/spamassassin
174 +
175 + # Move spamd to sbin where it belongs.
176 + dodir /usr/sbin
177 + mv "${ED}"/usr/bin/spamd "${ED}"/usr/sbin/spamd || die "move spamd failed"
178 +
179 + if use qmail; then
180 + dobin spamc/qmail-spamc
181 + fi
182 +
183 + dosym mail/spamassassin /etc/spamassassin
184 +
185 + # Disable plugin by default
186 + sed -i -e 's/^loadplugin/\#loadplugin/g' \
187 + "${ED}/etc/mail/spamassassin/init.pre" \
188 + || die "failed to disable plugins by default"
189 +
190 + # Add the init and config scripts.
191 + newinitd "${FILESDIR}/3.4.1-spamd.init-r3" spamd
192 + newconfd "${FILESDIR}/3.4.1-spamd.conf-r1" spamd
193 +
194 + systemd_newunit "${FILESDIR}/${PN}.service-r4" "${PN}.service"
195 + systemd_install_serviced "${FILESDIR}/${PN}.service.conf-r2" \
196 + "${PN}.service"
197 +
198 + use postgres && dodoc sql/*_pg.sql
199 + use mysql && dodoc sql/*_mysql.sql
200 +
201 + dodoc NOTICE TRADEMARK CREDITS UPGRADE USAGE sql/README.bayes \
202 + sql/README.awl procmailrc.example sample-nonspam.txt \
203 + sample-spam.txt spamd/PROTOCOL spamd/README.vpopmail \
204 + spamd-apache2/README.apache
205 +
206 + # Rename some files so that they don't clash with others.
207 + newdoc spamd/README README.spamd
208 + newdoc sql/README README.sql
209 + newdoc ldap/README README.ldap
210 +
211 + if use qmail; then
212 + dodoc spamc/README.qmail
213 + fi
214 +
215 + insinto /etc/mail/spamassassin/
216 + insopts -m0400
217 + newins "${FILESDIR}"/secrets.cf secrets.cf.example
218 +
219 + # Create the directory where sa-update stores its GPG key (if you
220 + # choose to import one). If this directory does not exist, the
221 + # import will fail. This is bug 396307. We expect that the import
222 + # will be performed as root, and making the directory accessible
223 + # only to root prevents a warning on the command-line.
224 + diropts -m0700
225 + dodir /etc/mail/spamassassin/sa-update-keys
226 +
227 + if use cron; then
228 + # Install the cron job if they want it.
229 + exeinto /etc/cron.daily
230 + newexe "${FILESDIR}/update-spamassassin-rules-r1.cron" \
231 + update-spamassassin-rules
232 + fi
233 +
234 + # Remove perllocal.pod to avoid file collisions (bug #603338).
235 + perl_delete_localpod || die "failed to remove perllocal.pod"
236 +
237 + # The perl-module eclass calls three other functions to clean
238 + # up in src_install. The first fixes references to ${D} in the
239 + # packlist, and is useful to us, too. The other two functions,
240 + # perl_delete_emptybsdir and perl_remove_temppath, don't seem
241 + # to be needed: there are no empty directories, *.bs files, or
242 + # ${D} paths remaining in our installed image.
243 + perl_fix_packlist || die "failed to fix paths in packlist"
244 +}
245 +
246 +src_test() {
247 + # Trick the test suite into skipping the spamd tests. Setting
248 + # SPAMD_HOST to a non-localhost value causes SKIP_SPAMD_TESTS to be
249 + # set in SATest.pm.
250 + export SPAMD_HOST=disabled
251 + default
252 +}
253 +
254 +pkg_preinst() {
255 + # The spamd daemon runs as this user. Use a real home directory so
256 + # that it can hold SA configuration.
257 + enewuser spamd -1 -1 /home/spamd
258 +
259 + if use mysql || use postgres ; then
260 + local _awlwarn=0
261 + local _v
262 + for _v in ${REPLACING_VERSIONS}; do
263 + if ver_test "${_v}" -lt "3.4.3"; then
264 + _awlwarn=1
265 + break
266 + fi
267 + done
268 + if [[ ${_awlwarn} == 1 ]] ; then
269 + ewarn 'If you used AWL before 3.4.3, the SQL schema has changed.'
270 + ewarn 'You will need to manually ALTER your tables for them to'
271 + ewarn 'continue working. See the UPGRADE documentation for'
272 + ewarn 'details.'
273 + ewarn
274 + fi
275 + fi
276 +}
277 +
278 +pkg_postinst() {
279 + elog
280 + elog 'No rules are installed by default. You will need to run sa-update'
281 + elog 'at least once, and most likely configure SpamAssassin before it'
282 + elog 'will work.'
283 +
284 + if ! use cron; then
285 + elog
286 + elog 'You should consider a cron job for sa-update. One is provided'
287 + elog 'for daily updates if you enable the "cron" USE flag.'
288 + fi
289 + elog
290 + elog 'Configuration and update help can be found on the wiki:'
291 + elog
292 + elog ' https://wiki.gentoo.org/wiki/SpamAssassin'
293 + elog
294 +
295 + if use mysql || use postgres ; then
296 + local _v
297 + for _v in ${REPLACING_VERSIONS}; do
298 + if ver_test "${_v}" -lt "3.4.3"; then
299 + ewarn
300 + ewarn 'If you used AWL before 3.4.3, the SQL schema has changed.'
301 + ewarn 'You will need to manually ALTER your tables for them to'
302 + ewarn 'continue working. See the UPGRADE documentation for'
303 + ewarn 'details.'
304 + ewarn
305 +
306 + # show this only once
307 + break
308 + fi
309 + done
310 + fi
311 +
312 + ewarn 'If this version of SpamAssassin causes permissions issues'
313 + ewarn 'with your user configurations or bayes databases, then you'
314 + ewarn 'may need to set SPAMD_RUN_AS_ROOT=true in your OpenRC service'
315 + ewarn 'configuration file, or remove the --username and --groupname'
316 + ewarn 'flags from the SPAMD_OPTS variable in your systemd service'
317 + ewarn 'configuration file.'
318 +}