1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-24 04:33:24 +00:00

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/
This commit is contained in:
Dan Langille 2021-05-25 20:44:08 +00:00
parent 030849414b
commit 95895b2739
2 changed files with 24 additions and 3 deletions

View File

@ -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

View File

@ -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: