summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2021-10-29 08:47:34 -0400
committerMichael Orlitzky <mjo@gentoo.org>2021-10-29 08:55:59 -0400
commit297fd5ee563da41f502a3bddbd0bccfe1da107d0 (patch)
treeae6eac1182f81e9a3adf8ef7886f80c5fe022297 /mail-filter
parentnet-print/foomatic-db-ppds: mark ALLARCHES (diff)
downloadgentoo-297fd5ee563da41f502a3bddbd0bccfe1da107d0.tar.gz
gentoo-297fd5ee563da41f502a3bddbd0bccfe1da107d0.tar.bz2
gentoo-297fd5ee563da41f502a3bddbd0bccfe1da107d0.zip
mail-filter/spf-engine: new revision with python-3.10 support.
I've also dropped support for python-3.7, which lets us finally revert DISTUTILS_USE_SETUPTOOLS to the default value and stop spewing QA warnings. Closes: https://bugs.gentoo.org/820662 Package-Manager: Portage-3.0.20, Repoman-3.0.3 Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
Diffstat (limited to 'mail-filter')
-rw-r--r--mail-filter/spf-engine/spf-engine-2.9.2-r4.ebuild77
1 files changed, 77 insertions, 0 deletions
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
new file mode 100644
index 000000000000..250e794e33cd
--- /dev/null
+++ b/mail-filter/spf-engine/spf-engine-2.9.2-r4.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_8 python3_9 python3_10 )
+
+# The built-in ipaddress module handles the parsing of IP addresses. If
+# python is built without ipv6 support, then ipaddress can't parse ipv6
+# addresses, and the daemon will crash if it sees an ipv6 SPF record. In
+# other words, it's completely broken.
+PYTHON_REQ_USE="ipv6(+)"
+
+inherit distutils-r1
+
+DESCRIPTION="Policy daemon and milter for Postfix SPF verification"
+HOMEPAGE="https://launchpad.net/spf-engine"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-python/pyspf[${PYTHON_USEDEP}]"
+
+RDEPEND="${DEPEND}
+ dev-python/authres[${PYTHON_USEDEP}]"
+
+DOCS=( CHANGES policyd-spf.conf.commented README README.per_user_whitelisting )
+
+python_prepare_all() {
+ # The "real" config file mentions the commented one, so we point
+ # users in the right direction.
+ local oldconf="policyd-spf.conf.commented"
+ local newconf="/usr/share/doc/${PF}/${oldconf}"
+
+ sed -e "1 s~ ${oldconf}~,\n# ${newconf}~" -i policyd-spf.conf \
+ || die 'failed to update commented config file path'
+
+ distutils-r1_python_prepare_all
+}
+
+src_install() {
+ distutils-r1_src_install
+
+ # Remove the milter files that are installed by default. The milter
+ # isn't quite ready:
+ #
+ # * The README says it's experimental not well-tested.
+ # * There's no documentation for its configuration parameters
+ # (expecially the UserID).
+ # * The configuration file is hard-coded to /usr/local.
+ # * The paths in the systemd service file are hard-coded to /usr/local.
+ # * We need to write an OpenRC service script for it.
+ #
+ # These are all eventually doable, but I'm not willing to commit to
+ # making the milter work before upstream is.
+ #
+ rm "${ED}/usr/bin/pyspf-milter" \
+ || die "failed to remove ${ED}/usr/bin/pyspf-milter"
+ rm -r "${ED}/usr/lib/systemd" \
+ || die "failed to remove ${ED}/usr/lib/systemd"
+ rm -r "${ED}/usr/etc/init.d" \
+ || die "failed to remove ${ED}/usr/etc/init.d"
+ einfo "The milter component of spf-engine is still deemed experimental"
+ einfo "and not well-tested by upstream. It's missing configuration"
+ einfo "files, service scripts, and documentation. In other words, it"
+ einfo "doesn't work yet."
+
+ # The setuptools installation routing always works relative to
+ # python's prefix, so that when installing locally you wind up
+ # with paths like /usr/local/etc. However for system installs
+ # that does the wrong thing and puts the sysconfdir at /usr/etc.
+ # Here we move it to the right place.
+ mv -v "${ED}/usr/etc" "${ED}/" || die 'failed to relocate sysconfdir'
+}