diff options
author | rm <rm@FreeBSD.org> | 2015-11-19 04:28:03 +0800 |
---|---|---|
committer | rm <rm@FreeBSD.org> | 2015-11-19 04:28:03 +0800 |
commit | 43051375ef26d4a81cc3f3da8fa8853e19e82974 (patch) | |
tree | 12064fd8714eb40d9e823a241d5a32ff0997cafd /net-mgmt | |
parent | 8fb356dbfce2f321b4c23f15bbaf1a3bccec8385 (diff) | |
download | freebsd-ports-gnome-43051375ef26d4a81cc3f3da8fa8853e19e82974.tar.gz freebsd-ports-gnome-43051375ef26d4a81cc3f3da8fa8853e19e82974.tar.zst freebsd-ports-gnome-43051375ef26d4a81cc3f3da8fa8853e19e82974.zip |
Add py-pysmi 0.0.6, SNMP/SMI MIB parsing in Python.
PR: 204572
Submitted by: John W. O'Brien <john@saltant.com>
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/Makefile | 1 | ||||
-rw-r--r-- | net-mgmt/py-pysmi/Makefile | 41 | ||||
-rw-r--r-- | net-mgmt/py-pysmi/distinfo | 2 | ||||
-rw-r--r-- | net-mgmt/py-pysmi/files/patch-setup.py | 12 | ||||
-rw-r--r-- | net-mgmt/py-pysmi/files/tests__init__.py | 20 | ||||
-rw-r--r-- | net-mgmt/py-pysmi/pkg-descr | 3 |
6 files changed, 79 insertions, 0 deletions
diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index 5edaec643a53..383cb48de56e 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -267,6 +267,7 @@ SUBDIR += py-ipcalc SUBDIR += py-ipy SUBDIR += py-pyang + SUBDIR += py-pysmi SUBDIR += py-snmp4 SUBDIR += py-snmp4-apps SUBDIR += py-snmp4-mibs diff --git a/net-mgmt/py-pysmi/Makefile b/net-mgmt/py-pysmi/Makefile new file mode 100644 index 000000000000..e2e77a62917f --- /dev/null +++ b/net-mgmt/py-pysmi/Makefile @@ -0,0 +1,41 @@ +# Created by: John W. O'Brien <john@saltant.com> +# $FreeBSD$ + +PORTNAME= pysmi +PORTVERSION= 0.0.6 +CATEGORIES= net-mgmt python +MASTER_SITES= CHEESESHOP \ + SF/pysmi/pysmi/${PORTVERSION} +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= john@saltant.com +COMMENT= SNMP/SMI MIB parsing in Python + +LICENSE= BSD2CLAUSE + +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}ply>=0:${PORTSDIR}/devel/py-ply + +NO_ARCH= yes +USES= python shebangfix +USE_PYTHON= autoplist concurrent distutils +SHEBANG_FILES= scripts/mibdump.py + +OPTIONS_DEFINE= DOCS EXAMPLES + +PORTDOCS= * +PORTEXAMPLES= * + +BASEDOCS= CHANGES.txt README.txt TODO.txt + +post-patch: + ${CP} ${FILESDIR}/tests__init__.py ${WRKSRC}/tests/__init__.py + ${MV} ${WRKSRC}/tests ${WRKSRC}/${PORTNAME} + +post-install: + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${BASEDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR} + + @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} + (cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}) + +.include <bsd.port.mk> diff --git a/net-mgmt/py-pysmi/distinfo b/net-mgmt/py-pysmi/distinfo new file mode 100644 index 000000000000..39c6059763a0 --- /dev/null +++ b/net-mgmt/py-pysmi/distinfo @@ -0,0 +1,2 @@ +SHA256 (pysmi-0.0.6.tar.gz) = f04641fd88239ad6708aad9f8b24bc1606b225346bb6a7bb7253cc2103a7d9a0 +SIZE (pysmi-0.0.6.tar.gz) = 55917 diff --git a/net-mgmt/py-pysmi/files/patch-setup.py b/net-mgmt/py-pysmi/files/patch-setup.py new file mode 100644 index 000000000000..48643afcfe3a --- /dev/null +++ b/net-mgmt/py-pysmi/files/patch-setup.py @@ -0,0 +1,12 @@ +--- setup.py.orig 2015-11-07 19:23:39 UTC ++++ setup.py +@@ -80,7 +80,8 @@ params.update( { + 'pysmi.parser', + 'pysmi.codegen', + 'pysmi.borrower', +- 'pysmi.writer' ], ++ 'pysmi.writer', ++ 'pysmi.tests' ], + 'scripts': [ os.path.join('scripts','mibdump.py') ] + } ) + diff --git a/net-mgmt/py-pysmi/files/tests__init__.py b/net-mgmt/py-pysmi/files/tests__init__.py new file mode 100644 index 000000000000..b6f4cc125c2a --- /dev/null +++ b/net-mgmt/py-pysmi/files/tests__init__.py @@ -0,0 +1,20 @@ +from unittest import SkipTest, TestSuite + + +def load_tests(loader, tests, pattern): + import suite + return suite.suite + + +try: + from pysnmp.smi.builder import MibBuilder +except ImportError: + + # python -m unittest pysmi.tests + def load_tests(*args, **kwars): + print("Skipping test suite: pysnmp is not installed") + return TestSuite() + + # nosetests pysmi + def setup(): + raise SkipTest("pysnmp is not installed") diff --git a/net-mgmt/py-pysmi/pkg-descr b/net-mgmt/py-pysmi/pkg-descr new file mode 100644 index 000000000000..cf87382da5b9 --- /dev/null +++ b/net-mgmt/py-pysmi/pkg-descr @@ -0,0 +1,3 @@ +Pure-Python implementation of SNMP/SMI MIB parsing and conversion library + +WWW: http://pysmi.sourceforge.net/ |