aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-snmp
diff options
context:
space:
mode:
Diffstat (limited to 'community/py3-snmp')
-rw-r--r--community/py3-snmp/APKBUILD51
-rw-r--r--community/py3-snmp/remove-bogus-check.patch25
2 files changed, 76 insertions, 0 deletions
diff --git a/community/py3-snmp/APKBUILD b/community/py3-snmp/APKBUILD
new file mode 100644
index 0000000000..be171e0740
--- /dev/null
+++ b/community/py3-snmp/APKBUILD
@@ -0,0 +1,51 @@
+# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
+# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
+pkgname=py-snmp
+_pkgname=pysnmp
+pkgver=4.4.11
+pkgrel=0
+pkgdesc="A Python SNMP v1/v2c/v3 engine"
+url="http://snmplabs.com/pysnmp/index.html"
+arch="noarch"
+license="BSD-2-Clause"
+options="!check"
+depends="py-asn1 py-crypto"
+makedepends="py-setuptools py3-setuptools"
+subpackages="py3-${pkgname#py-}:_py3 py2-${pkgname#py-}:_py2"
+source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
+ remove-bogus-check.patch
+ "
+builddir="$srcdir/$_pkgname-$pkgver"
+
+build() {
+ python2 setup.py build
+ python3 setup.py build
+}
+
+package() {
+ mkdir -p "$pkgdir"
+}
+
+_py() {
+ local python="$1"
+ pkgdesc="$pkgdesc (for $python)"
+ depends="$depends $python"
+ install_if="$pkgname=$pkgver-r$pkgrel $python"
+
+ cd "$builddir"
+ $python setup.py install --prefix=/usr --root="$subpkgdir"
+}
+
+_py2() {
+ replaces="$pkgname"
+ depends="${depends//py-/py2-}"
+ _py python2
+}
+
+_py3() {
+ depends="${depends//py-/py3-}"
+ _py python3
+}
+
+sha512sums="0f61ad0c095398b4b511c854ea7156aae78495f299457b14f4d3b50833670ec77c905e9cf4bdc30c21dd3c3e62d1c3473d7895f0352140af6345b18c1db3e7d8 pysnmp-4.4.11.tar.gz
+7976030882c78154a8db4250f1bcb634e74f7f7bd2ec5002dee89605b2cc1845fe92287ea22a2f0eb564fd8c2f3efdcac3370bafadb9eb54925646d6f57e677a remove-bogus-check.patch"
diff --git a/community/py3-snmp/remove-bogus-check.patch b/community/py3-snmp/remove-bogus-check.patch
new file mode 100644
index 0000000000..4ce19a0c2f
--- /dev/null
+++ b/community/py3-snmp/remove-bogus-check.patch
@@ -0,0 +1,25 @@
+diff --git a/setup.py b/setup.py
+index 0d987d5..82da3ad 100644
+--- a/setup.py
++++ b/setup.py
+@@ -63,19 +63,6 @@ try:
+
+ setup, Command = setuptools.setup, setuptools.Command
+
+- observed_version = [int(x) for x in setuptools.__version__.split('.')]
+- required_version = [36, 2, 0]
+-
+- # NOTE(etingof): require fresh setuptools to build proper wheels
+- # See also: https://hynek.me/articles/conditional-python-dependencies/
+- if ('bdist_wheel' in sys.argv and
+- observed_version < required_version):
+- print("ERROR: your wheels won't come out round with setuptools %s! "
+- "Upgrade to %s and try again." % (
+- '.'.join([str(x) for x in observed_version]),
+- '.'.join([str(x) for x in required_version])))
+- sys.exit(1)
+-
+ params = {
+ 'install_requires': requires,
+ 'zip_safe': True
+