aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Langille <dvl@FreeBSD.org>2021-05-25 20:44:08 +0000
committerDan Langille <dvl@FreeBSD.org>2021-05-25 20:46:21 +0000
commit95895b273983fca1a7ecfed8056499c2c9e683f6 (patch)
tree309ad629db10337a8809ca8cd02ca2a988bbc78d
parent030849414b53d3574fd00ebac9e6f78d9dcd7637 (diff)
downloadports-95895b273983fca1a7ecfed8056499c2c9e683f6.tar.gz
ports-95895b273983fca1a7ecfed8056499c2c9e683f6.zip
net-mgmt/librenms: fix capture so that it works on FreeBSD
The application depends up on PATH to locate php. The code is now patched to use LOCALBASE. re: https://docs.librenms.org/Support/Device-Troubleshooting/
-rw-r--r--net-mgmt/librenms/Makefile7
-rw-r--r--net-mgmt/librenms/files/patch-includes_html_output_capture.inc.php20
2 files changed, 24 insertions, 3 deletions
diff --git a/net-mgmt/librenms/Makefile b/net-mgmt/librenms/Makefile
index 5ed4ceccd303..03c02d5caba1 100644
--- a/net-mgmt/librenms/Makefile
+++ b/net-mgmt/librenms/Makefile
@@ -1,6 +1,6 @@
PORTNAME= librenms
PORTVERSION= 21.5.1
-PORTREVISION= 2
+PORTREVISION= 3
PORTEPOCH= 1
CATEGORIES= net-mgmt
MASTER_SITES= LOCAL/dvl:vendor
@@ -112,10 +112,11 @@ _OTHER_DIRS= html/js/lang resources/views/overview/custom \
vendor/symfony/string/Resources/bin
post-patch:
- ${REINPLACE_CMD} 's|%%PORTVERSION%%|${PORTVERSION}|g' ${WRKSRC}/includes/common.php
- ${REINPLACE_CMD} 's|%%RELEASE_TIMESTAMP%%|${_RELEASE_TIMESTAMP}|g' ${WRKSRC}/includes/common.php
${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/LibreNMS/Util/Version.php
${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/LibreNMS/Validations/Php.php
+ ${REINPLACE_CMD} 's|%%PORTVERSION%%|${PORTVERSION}|g' ${WRKSRC}/includes/common.php
+ ${REINPLACE_CMD} 's|%%RELEASE_TIMESTAMP%%|${_RELEASE_TIMESTAMP}|g' ${WRKSRC}/includes/common.php
+ ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/includes/html/output/capture.inc.php
${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/config.php.default
${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/poller-wrapper.py
${RM} ${WRKSRC}/LibreNMS/Validations/Updates.php
diff --git a/net-mgmt/librenms/files/patch-includes_html_output_capture.inc.php b/net-mgmt/librenms/files/patch-includes_html_output_capture.inc.php
new file mode 100644
index 000000000000..a526ec24e50f
--- /dev/null
+++ b/net-mgmt/librenms/files/patch-includes_html_output_capture.inc.php
@@ -0,0 +1,20 @@
+--- includes/html/output/capture.inc.php.orig 2021-05-25 19:32:48 UTC
++++ includes/html/output/capture.inc.php
+@@ -31,7 +31,7 @@ $type = $_REQUEST['type'];
+
+ switch ($type) {
+ case 'poller':
+- $cmd = ['php', \LibreNMS\Config::get('install_dir') . '/poller.php', '-h', $hostname, '-r', '-f', '-d'];
++ $cmd = ['%%LOCALBASE%%/bin/php', \LibreNMS\Config::get('install_dir') . '/poller.php', '-h', $hostname, '-r', '-f', '-d'];
+ $filename = "poller-$hostname.txt";
+ break;
+ case 'snmpwalk':
+@@ -42,7 +42,7 @@ switch ($type) {
+ $filename = $device['os'] . '-' . $device['hostname'] . '.snmpwalk';
+ break;
+ case 'discovery':
+- $cmd = ['php', \LibreNMS\Config::get('install_dir') . '/discovery.php', '-h', $hostname, '-d'];
++ $cmd = ['%%LOCALBASE%%/bin/php', \LibreNMS\Config::get('install_dir') . '/discovery.php', '-h', $hostname, '-d'];
+ $filename = "discovery-$hostname.txt";
+ break;
+ default: