*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / pysnmp / pysnmp-4.4.10-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python{2_7,3_{6,7}} )
6 inherit distutils-r1
7
8 DESCRIPTION="Python SNMP library"
9 HOMEPAGE="http://snmplabs.com/pysnmp/ https://pypi.org/project/pysnmp/"
10 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
11
12 LICENSE="BSD"
13 SLOT="0"
14 KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~sparc ~x86"
15 IUSE="doc examples"
16
17 DEPEND="
18         dev-python/setuptools[${PYTHON_USEDEP}]
19         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
20 "
21 RDEPEND="
22         >=dev-python/pyasn1-0.2.3[${PYTHON_USEDEP}]
23         dev-python/pysmi[${PYTHON_USEDEP}]
24         || (
25                 dev-python/pycryptodome[${PYTHON_USEDEP}]
26                 dev-python/pycrypto[${PYTHON_USEDEP}]
27         )
28 "
29
30 python_compile_all() {
31         default
32
33         if use doc; then
34                 touch docs/source/conf.py
35                 emake -C docs html
36         fi
37 }
38
39 python_install_all() {
40         use doc && local HTML_DOCS=( docs/build/html/* )
41         docinto examples
42         use examples && dodoc -r examples/* docs/mibs
43
44         distutils-r1_python_install_all
45 }
46
47 pkg_postinst() {
48         elog "You may also be interested in the following packages: "
49         elog "dev-python/pysnmp-apps - example programs using pysnmp"
50         elog "dev-python/pysnmp-mibs - IETF and other mibs"
51         elog "dev-python/pysmi - to dump MIBs in python format"
52 }