git: aaa196b77ee8 - main - security/py-greenbone-feed-sync: New port: new script for downloading the Greenbone Community Feed

From: Jose Alonso Cardenas Marquez <acm_at_FreeBSD.org>
Date: Thu, 21 Sep 2023 16:50:26 UTC
The branch main has been updated by acm:

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

commit aaa196b77ee89c811718cd846345e74f47d4c8ac
Author:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
AuthorDate: 2023-09-21 16:49:08 +0000
Commit:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
CommitDate: 2023-09-21 16:49:08 +0000

    security/py-greenbone-feed-sync: New port: new script for downloading the Greenbone Community Feed
    
    https://github.com/greenbone/greenbone-feed-sync
---
 security/Makefile                                  |  1 +
 security/py-greenbone-feed-sync/Makefile           | 44 +++++++++++++++++
 security/py-greenbone-feed-sync/distinfo           |  3 ++
 .../files/patch-greenbone-feed-sync_config.py      | 15 ++++++
 security/py-greenbone-feed-sync/pkg-descr          |  1 +
 security/py-greenbone-feed-sync/pkg-plist          | 57 ++++++++++++++++++++++
 6 files changed, 121 insertions(+)

diff --git a/security/Makefile b/security/Makefile
index 609837e80af0..43e8001596fc 100644
--- a/security/Makefile
+++ b/security/Makefile
@@ -920,6 +920,7 @@
     SUBDIR += py-google-auth-oauthlib
     SUBDIR += py-gpgme
     SUBDIR += py-gpsoauth
+    SUBDIR += py-greenbone-feed-sync
     SUBDIR += py-gssapi
     SUBDIR += py-gvm-tools
     SUBDIR += py-hkdf
diff --git a/security/py-greenbone-feed-sync/Makefile b/security/py-greenbone-feed-sync/Makefile
new file mode 100644
index 000000000000..65f0c90bced0
--- /dev/null
+++ b/security/py-greenbone-feed-sync/Makefile
@@ -0,0 +1,44 @@
+PORTNAME=	greenbone-feed-sync
+DISTVERSION=	23.8.0
+DISTVERSIONPREFIX=	v
+CATEGORIES=	security python
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	acm@FreeBSD.org
+COMMENT=	new script for downloading the Greenbone Community Feed
+WWW=		https://github.com/greenbone/greenbone-feed-sync
+
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}poetry-core>0:devel/py-poetry-core@${PY_FLAVOR}
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}rich>0:textproc/py-rich@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}tomli>0:textproc/py-tomli@${PY_FLAVOR} \
+		rsync:net/rsync
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	greenbone
+GH_PROJECT=	${PORTNAME}
+
+USES=		python
+USE_PYTHON=	pep517
+
+NO_ARCH=	yes
+
+USERS=		gvm
+GROUPS=		${USERS}
+
+post-extract:
+	${MV} ${WRKSRC}/tests ${WRKSRC}/greenbone/
+
+post-patch:
+	@${RM} ${WRKSRC}/greenbone/feed/sync/config.py.orig
+	@${REINPLACE_CMD} -i "" -e 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/greenbone/feed/sync/config.py
+
+post-install:
+	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/gvm
+	@${MKDIR} ${STAGEDIR}/var/lib/gvm
+	@${MKDIR} ${STAGEDIR}/var/lib/openvas/plugins
+	@${MKDIR} ${STAGEDIR}/var/lib/notus
+
+.include <bsd.port.mk>
diff --git a/security/py-greenbone-feed-sync/distinfo b/security/py-greenbone-feed-sync/distinfo
new file mode 100644
index 000000000000..7744bdaef511
--- /dev/null
+++ b/security/py-greenbone-feed-sync/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1695267921
+SHA256 (greenbone-greenbone-feed-sync-v23.8.0_GH0.tar.gz) = d1f37085010cde702017d4fdd71ddf840ffd5170d4ab6d66a3155a28eb759b7a
+SIZE (greenbone-greenbone-feed-sync-v23.8.0_GH0.tar.gz) = 63822
diff --git a/security/py-greenbone-feed-sync/files/patch-greenbone-feed-sync_config.py b/security/py-greenbone-feed-sync/files/patch-greenbone-feed-sync_config.py
new file mode 100644
index 000000000000..b7736118da6d
--- /dev/null
+++ b/security/py-greenbone-feed-sync/files/patch-greenbone-feed-sync_config.py
@@ -0,0 +1,15 @@
+--- greenbone/feed/sync/config.py	2023-09-21 01:01:53.391475000 -0500
++++ greenbone/feed/sync/config.py	2023-09-21 01:02:58.557438000 -0500
+@@ -69,10 +69,10 @@
+ DEFAULT_GVMD_LOCK_FILE_PATH = "gvm/feed-update.lock"
+ DEFAULT_OPENVAS_LOCK_FILE_PATH = "openvas/feed-update.lock"
+ 
+-DEFAULT_CONFIG_FILE = "/etc/gvm/greenbone-feed-sync.toml"
++DEFAULT_CONFIG_FILE = "%%LOCALBASE%%/etc/gvm/greenbone-feed-sync.toml"
+ DEFAULT_USER_CONFIG_FILE = "~/.config/greenbone-feed-sync.toml"
+ 
+-DEFAULT_ENTERPRISE_KEY_PATH = "/etc/gvm/greenbone-enterprise-feed-key"
++DEFAULT_ENTERPRISE_KEY_PATH = "%%LOCALBASE%%/etc/gvm/greenbone-enterprise-feed-key"
+ 
+ DEFAULT_GROUP = "gvm"
+ DEFAULT_USER = "gvm"
diff --git a/security/py-greenbone-feed-sync/pkg-descr b/security/py-greenbone-feed-sync/pkg-descr
new file mode 100644
index 000000000000..82fa26c017b6
--- /dev/null
+++ b/security/py-greenbone-feed-sync/pkg-descr
@@ -0,0 +1 @@
+New script for downloading the Greenbone Community Feed
diff --git a/security/py-greenbone-feed-sync/pkg-plist b/security/py-greenbone-feed-sync/pkg-plist
new file mode 100644
index 000000000000..ecbd20453c08
--- /dev/null
+++ b/security/py-greenbone-feed-sync/pkg-plist
@@ -0,0 +1,57 @@
+bin/greenbone-certdata-sync
+bin/greenbone-feed-sync
+bin/greenbone-nvt-sync
+bin/greenbone-scapdata-sync
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__init__.py
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/__version__%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/__version__%%PYTHON_EXT_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/config%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/config%%PYTHON_EXT_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/errors%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/errors%%PYTHON_EXT_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/helper%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/helper%%PYTHON_EXT_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/main%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/main%%PYTHON_EXT_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/parser%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/parser%%PYTHON_EXT_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/rsync%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__pycache__/rsync%%PYTHON_EXT_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/__version__.py
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/config.py
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/errors.py
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/helper.py
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/main.py
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/parser.py
+%%PYTHON_SITELIBDIR%%/greenbone/feed/sync/rsync.py
+%%PYTHON_SITELIBDIR%%/greenbone/tests/__init__.py
+%%PYTHON_SITELIBDIR%%/greenbone/tests/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/tests/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/tests/__pycache__/test_config%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/tests/__pycache__/test_config%%PYTHON_EXT_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/tests/__pycache__/test_helper%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/tests/__pycache__/test_helper%%PYTHON_EXT_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/tests/__pycache__/test_main%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/tests/__pycache__/test_main%%PYTHON_EXT_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/tests/__pycache__/test_parser%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/tests/__pycache__/test_parser%%PYTHON_EXT_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/tests/__pycache__/test_rsync%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/tests/__pycache__/test_rsync%%PYTHON_EXT_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/greenbone/tests/test_config.py
+%%PYTHON_SITELIBDIR%%/greenbone/tests/test_helper.py
+%%PYTHON_SITELIBDIR%%/greenbone/tests/test_main.py
+%%PYTHON_SITELIBDIR%%/greenbone/tests/test_parser.py
+%%PYTHON_SITELIBDIR%%/greenbone/tests/test_rsync.py
+@dir(gvm,gvm,750) etc/gvm
+@dir(gvm,gvm,750) /var/lib/gvm
+@dir(gvm,gvm,750) /var/lib/notus
+@dir(gvm,gvm,750) /var/lib/openvas/plugins
+@dir(gvm,gvm,750) /var/lib/openvas
+@dir etc/gvm
+@dir /var/lib/gvm
+@dir /var/lib/notus
+@dir /var/lib/openvas/plugins
+@dir /var/lib/openvas
+@dir /var/lib