git: 917c4c6dd4bb - main - net-mgmt/librenms: add many files to SHEBANG_FILES

From: Dan Langille <dvl_at_FreeBSD.org>
Date: Sun, 30 Jul 2023 23:55:30 UTC
The branch main has been updated by dvl:

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

commit 917c4c6dd4bbda3ce239856697e3607e8cfb4381
Author:     Dan Langille <dvl@FreeBSD.org>
AuthorDate: 2023-07-30 23:51:50 +0000
Commit:     Dan Langille <dvl@FreeBSD.org>
CommitDate: 2023-07-30 23:55:25 +0000

    net-mgmt/librenms: add many files to SHEBANG_FILES
    
    While here, run portfmt over the Makefile - that accounts for the
    majority of changes seen in the diff
    
    patch LibreNMS/wrapper.py which contains "/usr/bin/env php" mid-file
    
    PR:             260085
---
 net-mgmt/librenms/Makefile                        | 59 +++++++++++++++++------
 net-mgmt/librenms/files/patch-LibreNMS_wrapper.py | 11 +++++
 2 files changed, 55 insertions(+), 15 deletions(-)

diff --git a/net-mgmt/librenms/Makefile b/net-mgmt/librenms/Makefile
index f505c2851ee7..8ddd7a98f94a 100644
--- a/net-mgmt/librenms/Makefile
+++ b/net-mgmt/librenms/Makefile
@@ -32,18 +32,47 @@ USE_PHP=	ctype curl dom fileinfo filter gd hash json ldap mbstring \
 USE_RC_SUBR=	librenms
 
 SHEBANG_FILES=	../${PORTNAME}-vendor-${PORTVERSION}/tecnickcom/tcpdf/tools/tcpdf_addfont.php \
-		poller-wrapper.py poller.php scripts/auth_test.php \
-		scripts/check_requirements.py \
-		scripts/dynamic_check_requirements.py scripts/github-remove \
-		scripts/ifAlias \
+		../librenms-vendor-${PORTVERSION}/bin/carbon \
+		../librenms-vendor-${PORTVERSION}/bin/doctrine-dbal \
+		../librenms-vendor-${PORTVERSION}/bin/patch-type-declarations \
+		../librenms-vendor-${PORTVERSION}/bin/php-parse \
+		../librenms-vendor-${PORTVERSION}/bin/psysh \
+		../librenms-vendor-${PORTVERSION}/bin/validate-json \
+		../librenms-vendor-${PORTVERSION}/bin/var-dump-server \
+		../librenms-vendor-${PORTVERSION}/bin/yaml-lint \
+		../librenms-vendor-${PORTVERSION}/doctrine/dbal/bin/doctrine-dbal \
+		../librenms-vendor-${PORTVERSION}/justinrainbow/json-schema/bin/validate-json \
+		../librenms-vendor-${PORTVERSION}/nesbot/carbon/bin/carbon \
+		../librenms-vendor-${PORTVERSION}/nikic/php-parser/bin/php-parse \
+		../librenms-vendor-${PORTVERSION}/predis/predis/bin/create-command-test \
+		../librenms-vendor-${PORTVERSION}/psy/psysh/bin/psysh \
+		../librenms-vendor-${PORTVERSION}/symfony/error-handler/Resources/bin/extract-tentative-return-types.php \
+		../librenms-vendor-${PORTVERSION}/symfony/error-handler/Resources/bin/patch-type-declarations \
+		../librenms-vendor-${PORTVERSION}/symfony/var-dumper/Resources/bin/var-dump-server \
+		../librenms-vendor-${PORTVERSION}/symfony/yaml/Resources/bin/yaml-lint \
+		addhost.php alerts.php artisan billing-calculate.php \
+		check-services.php config_to_json.php daily.php delhost.php \
+		discovery.php dist-pollers.php irc.php LibreNMS/wrapper.py lnms \
+		ping.php poll-billing.php poller-wrapper.py poller.php \
+		renamehost.php scripts/auth_test.php \
+		scripts/check_requirements.py scripts/collect-port-polling.php \
+		scripts/collect-snmp-data.php scripts/composer_wrapper.php \
+		scripts/dynamic_check_requirements.py scripts/gen_rancid.php \
+		scripts/gen_smokeping.php scripts/github-remove scripts/ifAlias \
+		scripts/json-app-tool.php scripts/manage_bills.php \
 		scripts/Migration/Standard_Conversion/convert_no_xml.sh \
 		scripts/Migration/Standard_Conversion/destwork_no_xml.sh \
 		scripts/Migration/Standard_Conversion/mkdir.sh \
 		scripts/Migration/XML_Conversion/convert.sh \
 		scripts/Migration/XML_Conversion/destwork.sh \
-		scripts/Migration/XML_Conversion/mkdir.sh \
+		scripts/Migration/XML_Conversion/mkdir.sh scripts/new-os.php \
+		scripts/pre-commit.php scripts/purge-port.php \
 		scripts/removespikes.php scripts/removespikes.pl \
-		scripts/watchmaillog/watchmaillog.pl
+		scripts/rename-mibs.php scripts/rrdstep.php \
+		scripts/save-test-data.php scripts/syslog-notify-oxidized.php \
+		scripts/test-alert.php scripts/test-template.php \
+		scripts/tune_port.php scripts/watchmaillog/watchmaillog.pl \
+		snmptrap.php syslog.php validate.php
 
 NO_ARCH=	yes
 NO_BUILD=	yes
@@ -52,6 +81,7 @@ SUB_FILES+=	pkg-message
 SUB_LIST+=	GROUP="${WWWGRP}" \
 		PHP="${PHPBASE}/bin/php" \
 		PYTHON=${PYTHON_CMD} \
+		PYTHON_VERSION=${PYTHON_VERSION} \
 		USER="${WWWOWN}" \
 		WWWDIR="${WWWDIR}"
 
@@ -84,15 +114,14 @@ X11_RUN_DEPENDS_OFF=	mtr:net/mtr-nox11
 X11_USES=		magick:6
 X11_USES_OFF=		magick:6,nox11
 
-_ROOT_FILES=		addhost.php alerts.php artisan \
-			billing-calculate.php check-services.php composer.json \
-			composer.lock config.php.default config_to_json.php \
-			cronic daily.php delhost.php discovery-wrapper.py \
-			discovery.php dist-pollers.php irc.php \
-			librenms-service.py mkdocs.yml pbin.sh phpunit.xml \
-			ping.php poll-billing.php poller.php poller-wrapper.py \
-			renamehost.php snmp-scan.py snmptrap.php syslog.php \
-			validate.php
+_ROOT_FILES=		addhost.php alerts.php artisan billing-calculate.php \
+			check-services.php composer.json composer.lock \
+			config.php.default config_to_json.php cronic daily.php \
+			delhost.php discovery-wrapper.py discovery.php \
+			dist-pollers.php irc.php librenms-service.py mkdocs.yml \
+			pbin.sh phpunit.xml ping.php poll-billing.php \
+			poller.php poller-wrapper.py renamehost.php \
+			snmp-scan.py snmptrap.php syslog.php validate.php
 _SCRIPT_FILES=		daily.sh lnms
 # _RELEASE_TIMESTAMP is used for a patch inside the vendor code
 # it represents the release date via: git show --pretty='%H|%ct' -s 1.42.01
diff --git a/net-mgmt/librenms/files/patch-LibreNMS_wrapper.py b/net-mgmt/librenms/files/patch-LibreNMS_wrapper.py
new file mode 100644
index 000000000000..dd8aae6e73de
--- /dev/null
+++ b/net-mgmt/librenms/files/patch-LibreNMS_wrapper.py
@@ -0,0 +1,11 @@
+--- LibreNMS/wrapper.py.orig	2023-07-30 23:13:00 UTC
++++ LibreNMS/wrapper.py
+@@ -278,7 +278,7 @@ def poll_worker(
+                     os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
+                     wrappers[wrapper_type]["executable"],
+                 )
+-                command = "/usr/bin/env php {} -h {}".format(executable, device_id)
++                command = "/usr/local/bin/php {} -h {}".format(executable, device_id)
+                 if debug:
+                     command = command + " -d"
+                 exit_code, output = command_runner(