Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/spf-engine/
Date: Fri, 29 Oct 2021 12:56:55
Message-Id: 1635512159.297fd5ee563da41f502a3bddbd0bccfe1da107d0.mjo@gentoo
1 commit: 297fd5ee563da41f502a3bddbd0bccfe1da107d0
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 29 12:47:34 2021 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 29 12:55:59 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=297fd5ee
7
8 mail-filter/spf-engine: new revision with python-3.10 support.
9
10 I've also dropped support for python-3.7, which lets us finally revert
11 DISTUTILS_USE_SETUPTOOLS to the default value and stop spewing QA
12 warnings.
13
14 Closes: https://bugs.gentoo.org/820662
15 Package-Manager: Portage-3.0.20, Repoman-3.0.3
16 Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
17
18 mail-filter/spf-engine/spf-engine-2.9.2-r4.ebuild | 77 +++++++++++++++++++++++
19 1 file changed, 77 insertions(+)
20
21 diff --git a/mail-filter/spf-engine/spf-engine-2.9.2-r4.ebuild b/mail-filter/spf-engine/spf-engine-2.9.2-r4.ebuild
22 new file mode 100644
23 index 00000000000..250e794e33c
24 --- /dev/null
25 +++ b/mail-filter/spf-engine/spf-engine-2.9.2-r4.ebuild
26 @@ -0,0 +1,77 @@
27 +# Copyright 1999-2021 Gentoo Authors
28 +# Distributed under the terms of the GNU General Public License v2
29 +
30 +EAPI=8
31 +
32 +PYTHON_COMPAT=( python3_8 python3_9 python3_10 )
33 +
34 +# The built-in ipaddress module handles the parsing of IP addresses. If
35 +# python is built without ipv6 support, then ipaddress can't parse ipv6
36 +# addresses, and the daemon will crash if it sees an ipv6 SPF record. In
37 +# other words, it's completely broken.
38 +PYTHON_REQ_USE="ipv6(+)"
39 +
40 +inherit distutils-r1
41 +
42 +DESCRIPTION="Policy daemon and milter for Postfix SPF verification"
43 +HOMEPAGE="https://launchpad.net/spf-engine"
44 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
45 +
46 +LICENSE="Apache-2.0"
47 +SLOT="0"
48 +KEYWORDS="~amd64 ~x86"
49 +IUSE=""
50 +
51 +DEPEND="dev-python/pyspf[${PYTHON_USEDEP}]"
52 +
53 +RDEPEND="${DEPEND}
54 + dev-python/authres[${PYTHON_USEDEP}]"
55 +
56 +DOCS=( CHANGES policyd-spf.conf.commented README README.per_user_whitelisting )
57 +
58 +python_prepare_all() {
59 + # The "real" config file mentions the commented one, so we point
60 + # users in the right direction.
61 + local oldconf="policyd-spf.conf.commented"
62 + local newconf="/usr/share/doc/${PF}/${oldconf}"
63 +
64 + sed -e "1 s~ ${oldconf}~,\n# ${newconf}~" -i policyd-spf.conf \
65 + || die 'failed to update commented config file path'
66 +
67 + distutils-r1_python_prepare_all
68 +}
69 +
70 +src_install() {
71 + distutils-r1_src_install
72 +
73 + # Remove the milter files that are installed by default. The milter
74 + # isn't quite ready:
75 + #
76 + # * The README says it's experimental not well-tested.
77 + # * There's no documentation for its configuration parameters
78 + # (expecially the UserID).
79 + # * The configuration file is hard-coded to /usr/local.
80 + # * The paths in the systemd service file are hard-coded to /usr/local.
81 + # * We need to write an OpenRC service script for it.
82 + #
83 + # These are all eventually doable, but I'm not willing to commit to
84 + # making the milter work before upstream is.
85 + #
86 + rm "${ED}/usr/bin/pyspf-milter" \
87 + || die "failed to remove ${ED}/usr/bin/pyspf-milter"
88 + rm -r "${ED}/usr/lib/systemd" \
89 + || die "failed to remove ${ED}/usr/lib/systemd"
90 + rm -r "${ED}/usr/etc/init.d" \
91 + || die "failed to remove ${ED}/usr/etc/init.d"
92 + einfo "The milter component of spf-engine is still deemed experimental"
93 + einfo "and not well-tested by upstream. It's missing configuration"
94 + einfo "files, service scripts, and documentation. In other words, it"
95 + einfo "doesn't work yet."
96 +
97 + # The setuptools installation routing always works relative to
98 + # python's prefix, so that when installing locally you wind up
99 + # with paths like /usr/local/etc. However for system installs
100 + # that does the wrong thing and puts the sysconfdir at /usr/etc.
101 + # Here we move it to the right place.
102 + mv -v "${ED}/usr/etc" "${ED}/" || die 'failed to relocate sysconfdir'
103 +}