git: 35f92ba20eb4 - main - textproc/py-ntc-templates: New port

From: Kai Knoblich <kai_at_FreeBSD.org>
Date: Mon, 28 Mar 2022 10:56:20 UTC
The branch main has been updated by kai:

URL: https://cgit.FreeBSD.org/ports/commit/?id=35f92ba20eb40d243f5241217e22a213427bbd57

commit 35f92ba20eb40d243f5241217e22a213427bbd57
Author:     Kai Knoblich <kai@FreeBSD.org>
AuthorDate: 2022-03-28 10:42:00 +0000
Commit:     Kai Knoblich <kai@FreeBSD.org>
CommitDate: 2022-03-28 10:42:00 +0000

    textproc/py-ntc-templates: New port
    
    The NTC templates project provides a large collection of TextFSM
    Templates (text parsers) for a variety of Networking Vendors.
    
    In addition to the templates, there is a function that will convert the
    CLI output into a CliTable object; the resulting text table is converted
    into a list of dictionaries mapping the column headers with each row in
    the table.
    
    WWW: https://github.com/networktocode/ntc-templates
---
 textproc/Makefile                              |  1 +
 textproc/py-ntc-templates/Makefile             | 30 ++++++++++++++++++++++++++
 textproc/py-ntc-templates/distinfo             |  3 +++
 textproc/py-ntc-templates/files/patch-setup.py | 29 +++++++++++++++++++++++++
 textproc/py-ntc-templates/pkg-descr            |  8 +++++++
 5 files changed, 71 insertions(+)

diff --git a/textproc/Makefile b/textproc/Makefile
index cbaf8601fdf5..24db1cd44931 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -1377,6 +1377,7 @@
     SUBDIR += py-nbsphinx
     SUBDIR += py-nltk
     SUBDIR += py-normality
+    SUBDIR += py-ntc-templates
     SUBDIR += py-numpydoc
     SUBDIR += py-ocrmypdf
     SUBDIR += py-openpyxl
diff --git a/textproc/py-ntc-templates/Makefile b/textproc/py-ntc-templates/Makefile
new file mode 100644
index 000000000000..40e60e413c59
--- /dev/null
+++ b/textproc/py-ntc-templates/Makefile
@@ -0,0 +1,30 @@
+PORTNAME=	ntc-templates
+DISTVERSIONPREFIX=	v
+DISTVERSION=	3.0.0
+CATEGORIES=	textproc net-mgmt python
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	kai@FreeBSD.org
+COMMENT=	TextFSM Templates for Network Devices
+
+LICENSE=	APACHE20
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}textfsm>=1.1.0<2.0.0:textproc/py-textfsm@${PY_FLAVOR}
+TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}ruamel.yaml>0:devel/py-ruamel.yaml@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}yaml>0:devel/py-yaml@${PY_FLAVOR}
+
+USES=		python:3.6+
+USE_GITHUB=	yes
+GH_ACCOUNT=	networktocode
+USE_PYTHON=	autoplist distutils
+
+TEST_ENV=	PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+
+NO_ARCH=	yes
+
+do-test:
+	@cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest -v -rs
+
+.include <bsd.port.mk>
diff --git a/textproc/py-ntc-templates/distinfo b/textproc/py-ntc-templates/distinfo
new file mode 100644
index 000000000000..32e85ebb0cc4
--- /dev/null
+++ b/textproc/py-ntc-templates/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1648157996
+SHA256 (networktocode-ntc-templates-v3.0.0_GH0.tar.gz) = d5f1148926b1b7a5929ac4896dfa6712bef840d2fb33710fbe6fe505c9f34a6f
+SIZE (networktocode-ntc-templates-v3.0.0_GH0.tar.gz) = 752785
diff --git a/textproc/py-ntc-templates/files/patch-setup.py b/textproc/py-ntc-templates/files/patch-setup.py
new file mode 100644
index 000000000000..9412c6341606
--- /dev/null
+++ b/textproc/py-ntc-templates/files/patch-setup.py
@@ -0,0 +1,29 @@
+--- setup.py.orig	2022-03-27 21:10:43 UTC
++++ setup.py
+@@ -0,0 +1,26 @@
++# -*- coding: utf-8 -*-
++from setuptools import setup
++
++packages = \
++['ntc_templates']
++
++package_data = \
++{'': ['*'], 'ntc_templates': ['templates/*']}
++
++install_requires = \
++['textfsm>=1.1.0,<2.0.0']
++
++setup_kwargs = {
++    'name': 'ntc-templates',
++    'version': '3.0.0',
++    'description': "TextFSM Templates for Network Devices, and Python wrapper for TextFSM's CliTable.",
++    'author': 'Network to Code',
++    'author_email': 'info@networktocode.com',
++    'url': 'https://github.com/networktocode/ntc-templates',
++    'packages': packages,
++    'package_data': package_data,
++    'install_requires': install_requires,
++    'python_requires': '>=3.6,<4.0',
++}
++
++setup(**setup_kwargs)
diff --git a/textproc/py-ntc-templates/pkg-descr b/textproc/py-ntc-templates/pkg-descr
new file mode 100644
index 000000000000..363142fa427c
--- /dev/null
+++ b/textproc/py-ntc-templates/pkg-descr
@@ -0,0 +1,8 @@
+The NTC templates project provides a large collection of TextFSM Templates
+(text parsers) for a variety of Networking Vendors.
+
+In addition to the templates, there is a function that will convert the CLI
+output into a CliTable object; the resulting text table is converted into a
+list of dictionaries mapping the column headers with each row in the table.
+
+WWW: https://github.com/networktocode/ntc-templates