Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/pyzor/
Date: Wed, 02 Sep 2020 05:14:13
Message-Id: 1599022828.cd9172fb91c1f3649997a06f2f063223a3e5fa4e.sam@gentoo
1 commit: cd9172fb91c1f3649997a06f2f063223a3e5fa4e
2 Author: Tomáš Mózes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Sat May 23 18:40:30 2020 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 2 05:00:28 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd9172fb
7
8 mail-filter/pyzor: add snapshot with python 3.{7,8} support
9
10 Bug: https://bugs.gentoo.org/718326
11 Signed-off-by: Tomáš Mózes <hydrapolic <AT> gmail.com>
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 mail-filter/pyzor/Manifest | 1 +
15 mail-filter/pyzor/metadata.xml | 4 ++
16 mail-filter/pyzor/pyzor-1.0.1_pre20200523.ebuild | 61 ++++++++++++++++++++++++
17 3 files changed, 66 insertions(+)
18
19 diff --git a/mail-filter/pyzor/Manifest b/mail-filter/pyzor/Manifest
20 index 4cfe0abd497..fc35455a69a 100644
21 --- a/mail-filter/pyzor/Manifest
22 +++ b/mail-filter/pyzor/Manifest
23 @@ -1 +1,2 @@
24 DIST pyzor-1.0.0.tar.gz 126276 BLAKE2B c60f26c53bf118c88dacbc49ddd414473748af1868b383a9c937ecf3cfe426ecdd60f64388fe7e555bd4641ef445769600e40879279dd544ef9ea32bd0dab6b9 SHA512 b3fb8b2c5261e187a2ab3a5a3b12d221df7de08766c6bb2ad9990c0f23517534871ecc9d5ad529e79b0d0aef8b2b800728320c57435a8c0d8c3f80a4ba0f7e4a
25 +DIST pyzor-f46159bd6519cebcebf59e9334a7920371111d75.tar.gz 138077 BLAKE2B 13ad30f06ce32a24a42dd5aaa21ad2a6700df1bac3dc54a86532748688b094ee0f56a8e28e34336298388c6e0b95868e95d040866c9afa561d867069496608fe SHA512 afe3b14794aea68b1a7d72840257976c7c9f755a6f6dcaaf6ebacab465c176fe2aa84f3fe176006cdbe26ef0b07ed949f75f6ef729f65c604fadf6ce8472da8f
26
27 diff --git a/mail-filter/pyzor/metadata.xml b/mail-filter/pyzor/metadata.xml
28 index 21a8605f271..c8b645011f0 100644
29 --- a/mail-filter/pyzor/metadata.xml
30 +++ b/mail-filter/pyzor/metadata.xml
31 @@ -10,6 +10,10 @@
32 <flag name="gdbm">
33 Enables the Gdbm back-end database engine for pyzord
34 </flag>
35 + <flag name="mysql">
36 + Enables the MySQL back-end database engine for pyzord through
37 + <pkg>dev-python/mysqlclient</pkg>.
38 + </flag>
39 <flag name="redis">
40 Enables the redis back-end database engine for pyzord through
41 <pkg>dev-python/redis-py</pkg>
42
43 diff --git a/mail-filter/pyzor/pyzor-1.0.1_pre20200523.ebuild b/mail-filter/pyzor/pyzor-1.0.1_pre20200523.ebuild
44 new file mode 100644
45 index 00000000000..690769b4a58
46 --- /dev/null
47 +++ b/mail-filter/pyzor/pyzor-1.0.1_pre20200523.ebuild
48 @@ -0,0 +1,61 @@
49 +# Copyright 1999-2020 Gentoo Authors
50 +# Distributed under the terms of the GNU General Public License v2
51 +
52 +EAPI=7
53 +
54 +PYTHON_COMPAT=( python3_{7,8} )
55 +inherit distutils-r1
56 +
57 +COMMIT="f46159bd6519cebcebf59e9334a7920371111d75"
58 +
59 +DESCRIPTION="A distributed, collaborative spam detection and filtering network"
60 +HOMEPAGE="https://github.com/SpamExperts/pyzor"
61 +SRC_URI="https://github.com/SpamExperts/pyzor/archive/${COMMIT}.tar.gz -> ${PN}-${COMMIT}.tar.gz"
62 +
63 +LICENSE="GPL-2"
64 +SLOT="0"
65 +KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-linux"
66 +
67 +IUSE="doc gdbm gevent mysql pyzord redis test"
68 +RESTRICT="!test? ( test )"
69 +
70 +RDEPEND="
71 + pyzord? (
72 + gdbm? ( $(python_gen_impl_dep 'gdbm') )
73 + gevent? ( dev-python/gevent[${PYTHON_USEDEP}] )
74 + mysql? ( dev-python/mysqlclient[${PYTHON_USEDEP}] )
75 + redis? ( dev-python/redis-py[${PYTHON_USEDEP}] )
76 + )"
77 +DEPEND="
78 + test? (
79 + gdbm? ( $(python_gen_impl_dep 'gdbm') )
80 + redis? ( dev-python/redis-py[${PYTHON_USEDEP}] )
81 + )
82 +"
83 +BDEPEND="test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
84 +
85 +# TODO: maybe upstream would support skipping tests for which the
86 +# dependencies are missing?
87 +REQUIRED_USE="
88 + pyzord? ( || ( gdbm redis ) )
89 + test? ( gdbm redis )
90 +"
91 +S="${WORKDIR}/${PN}-${COMMIT}"
92 +
93 +distutils_enable_sphinx "docs"
94 +
95 +python_test() {
96 + pytest -vv tests/unit || die "Tests fail with ${EPYTHON}"
97 +}
98 +
99 +src_install() {
100 + distutils-r1_src_install
101 +
102 + if use pyzord; then
103 + dodir /usr/sbin
104 + mv "${D}"/usr/bin/pyzord* "${ED}/usr/sbin" \
105 + || die "failed to relocate pyzord"
106 + else
107 + rm "${D}"/usr/bin/pyzord* || die "failed to remove pyzord"
108 + fi
109 +}