update to librenms-1.37. dependencies have been removed upstream in favour

of scripts to fetch via composer - the port switches to a locally produced
tar with pre-fetched dependencies, a port cannot go to the net and fetch
files at build time.
This commit is contained in:
sthen 2018-02-27 15:17:39 +00:00
parent 4ffe3aafc0
commit 3ad2086259
11 changed files with 717 additions and 1557 deletions

View File

@ -1,10 +1,11 @@
# $OpenBSD: Makefile,v 1.59 2018/02/14 14:04:34 sthen Exp $
# $OpenBSD: Makefile,v 1.60 2018/02/27 15:17:39 sthen Exp $
COMMENT = auto-discovering network management/monitoring system
GH_ACCOUNT = librenms
GH_PROJECT = librenms
GH_TAGNAME = 1.36.01
GH_TAGNAME = 1.37
DISTFILES = librenms-${GH_TAGNAME}.tar.gz librenms-vendor-${GH_TAGNAME}.tar.xz:0
EPOCH = 0
CATEGORIES = net www
@ -16,6 +17,8 @@ MAINTAINER = Stuart Henderson <sthen@openbsd.org>
# GPLv3+
PERMIT_PACKAGE_CDROM = Yes
MASTER_SITES0 = https://spacehopper.org/mirrors/
MODULES = lang/php \
lang/python
MODPY_BUILDDEP = No
@ -51,6 +54,7 @@ R += s,/var/www/librenms,${TRUEPREFIX}/librenms,g;
R += s,/usr/local,${LOCALBASE},g
post-extract:
mv ${WRKDIR}/vendor ${WRKSRC}/
perl -pi \
-e "s,'/usr/bin/snmp,'/usr/local/bin/snmp,;" \
-e "s,'/bin/ping,'/sbin/ping,;" \
@ -69,6 +73,18 @@ do-install:
sed -i 's,%PHP%,${MODPHP_BIN},' daily.sh *-wrapper.py *-service.py validate.php LibreNMS/Validations/Php.php html/includes/output/capture.inc.php scripts/composer_wrapper.php; \
sed -i 's,%LNMS_VERSION%,${DISTNAME:S/librenms-//},' includes/common.php
cp /usr/share/snmp/mibs/OPENBSD-* ${INSTDIR}/mibs/
rm -r ${INSTDIR}/tests
rm -r ${INSTDIR}/tests ${INSTDIR}/librenms/vendor/xjtuwangke/passwordhash/.git
# maintainer convenience target
dist: /usr/ports/distfiles/librenms-${GH_TAGNAME}.tar.gz
t=`mktemp -d /tmp/librenms.XXXXXXXXXX`; \
f=$$t/librenms-vendor-${GH_TAGNAME}.tar.xz; \
cd $$t; \
tar xzf ${FULLDISTDIR}/${DISTNAME}.tar.gz; \
cd librenms-${GH_TAGNAME}; \
composer install --no-dev; \
tar cf - vendor | xz -T 0 > $$f; \
scp $$f naiad:mirrors/; \
cd -; rm -rf $$t
.include <bsd.port.mk>

View File

@ -1,2 +1,4 @@
SHA256 (librenms-1.36.01.tar.gz) = 6jdmk+duBEUE3OLMCclZboKBl2FnNZcb4MO7lAc3Zh8=
SIZE (librenms-1.36.01.tar.gz) = 63281861
SHA256 (librenms-1.37.tar.gz) = htvLKHXHu0344ELZ/Ajncctg9ttVulklmhTGqLbqooE=
SHA256 (librenms-vendor-1.37.tar.xz) = ZLrLdsCoJ/2WMEC1n1jgZ3cpMrpCYxCm8YaGzvDhLiY=
SIZE (librenms-1.37.tar.gz) = 29901316
SIZE (librenms-vendor-1.37.tar.xz) = 24600168

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-daily_sh,v 1.23 2018/02/12 23:27:18 sthen Exp $
$OpenBSD: patch-daily_sh,v 1.24 2018/02/27 15:17:39 sthen Exp $
Index: daily.sh
--- daily.sh.orig
@ -66,7 +66,7 @@ Index: daily.sh
if [[ "$up" == "0" ]]; then
${DAILY_SCRIPT} no-code-update
set_notifiable_result update 1 # make sure there are no update notifications if update is disabled
@@ -217,7 +217,7 @@ main () {
@@ -223,7 +223,7 @@ main () {
no-code-update)
# Updates of the code are disabled, just check for schema updates
# and clean up the db.
@ -75,7 +75,7 @@ Index: daily.sh
status_run 'Cleaning up DB' "$DAILY_SCRIPT cleanup"
;;
post-pull)
@@ -231,7 +231,7 @@ main () {
@@ -245,7 +245,7 @@ main () {
fi
# List all tasks to do after pull in the order of execution

View File

@ -1,9 +1,9 @@
$OpenBSD: patch-html_install_php,v 1.21 2018/01/05 14:51:42 sthen Exp $
$OpenBSD: patch-html_install_php,v 1.22 2018/02/27 15:17:39 sthen Exp $
Index: html/install.php
--- html/install.php.orig
+++ html/install.php
@@ -379,7 +379,8 @@ $config_file = <<<"EOD"
@@ -374,7 +374,8 @@ $config_file = <<<"EOD"
#\$config\['base_url'\] = "http://librenms.company.com";
### Enable this to use rrdcached. Be sure rrd_dir is within the rrdcached dir

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-includes_common_php,v 1.20 2018/02/12 23:27:18 sthen Exp $
$OpenBSD: patch-includes_common_php,v 1.21 2018/02/27 15:17:39 sthen Exp $
Index: includes/common.php
--- includes/common.php.orig
@ -22,7 +22,7 @@ Index: includes/common.php
)));
return $output;
@@ -1728,12 +1731,7 @@ function set_numeric($value, $default = 0)
@@ -1723,12 +1726,7 @@ function set_numeric($value, $default = 0)
function check_git_exists()
{

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-includes_defaults_inc_php,v 1.31 2018/02/12 23:27:18 sthen Exp $
$OpenBSD: patch-includes_defaults_inc_php,v 1.32 2018/02/27 15:17:39 sthen Exp $
Some substitutions are done in the ports Makefile to reduce patch conflicts
during updates.
@ -6,7 +6,7 @@ during updates.
Index: includes/defaults.inc.php
--- includes/defaults.inc.php.orig
+++ includes/defaults.inc.php
@@ -42,14 +42,15 @@ $config['db_socket'] = null;
@@ -41,14 +41,15 @@ $config['db_socket'] = null;
$config['own_hostname'] = 'localhost';
// Location of executables
@ -24,7 +24,7 @@ Index: includes/defaults.inc.php
$config['snmpbulkwalk'] = '/usr/local/bin/snmpbulkwalk';
$config['snmptranslate'] = '/usr/local/bin/snmptranslate';
$config['whois'] = '/usr/bin/whois';
@@ -495,11 +496,11 @@ $config['billing']['bill_autoadd'] = 0;
@@ -499,11 +500,11 @@ $config['billing']['bill_autoadd'] = 0;
$config['billing']['base'] = 1000;
// Set the base to divider bytes to kB, MB, GB ,... (1000|1024)
// External Integration
@ -39,7 +39,7 @@ Index: includes/defaults.inc.php
$config['smokeping']['pings'] = 20;
// $config['oxidized']['enabled'] = FALSE;//Set to TRUE
// $config['oxidized']['url'] = 'http://127.0.0.1:8888';// Set the Oxidized rest URL
@@ -507,7 +508,7 @@ $config['smokeping']['pings'] = 20;
@@ -511,7 +512,7 @@ $config['smokeping']['pings'] = 20;
// NFSen RRD dir.
$config['nfsen_enable'] = 0;
// $config['nfsen_split_char'] = "_";
@ -48,7 +48,7 @@ Index: includes/defaults.inc.php
// $config['nfsen_suffix'] = "_yourdomain_com";
// Location Mapping
// Use this feature to map ugly locations to pretty locations
@@ -853,7 +854,7 @@ $config['api_demo'] = 0;
@@ -857,7 +858,7 @@ $config['api_demo'] = 0;
// Set this to 1 if you want to disable some untrusting features for the API
// Distributed Poller-Settings
$config['distributed_poller'] = false;

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-includes_functions_php,v 1.16 2018/02/12 23:27:18 sthen Exp $
$OpenBSD: patch-includes_functions_php,v 1.17 2018/02/27 15:17:39 sthen Exp $
Index: includes/functions.php
--- includes/functions.php.orig
@ -12,7 +12,7 @@ Index: includes/functions.php
$tmp = explode("\n", $ex);
if ($tmp[sizeof($tmp)-1] != "OK") {
$ret .= "Could not remove files:\n$ex\n";
@@ -2469,7 +2469,7 @@ function return_num($entry)
@@ -2419,7 +2419,7 @@ function return_num($entry)
function locate_binary($binary)
{
if (!str_contains($binary, '/')) {

View File

@ -1,27 +0,0 @@
$OpenBSD: patch-includes_process_config_inc_php,v 1.3 2017/11/27 17:41:36 sthen Exp $
sql-schema/079.sql which will have been added on some systems had a bad
path for rrdtool until patched. In older librenms versions, rrdtool path from
the config/php files took priority, which is more suitable for a packages-based
install, but in newer ones (without patching) it comes from the db.
Index: includes/process_config.inc.php
--- includes/process_config.inc.php.orig
+++ includes/process_config.inc.php
@@ -29,13 +29,9 @@ if (empty($config['email_from'])) {
$config['email_from'] = '"' . $config['project_name'] . '" <' . $config['email_user'] . '@' . php_uname('n') . '>';
}
-// We need rrdtool so ensure it's set
-if (empty($config['rrdtool'])) {
- $config['rrdtool'] = '/usr/bin/rrdtool';
-}
-if (empty($config['rrdtool_version'])) {
- $config['rrdtool_version'] = 1.4;
-}
+// Force rrdtool config; it's under packages control.
+$config['rrdtool'] = '/usr/local/bin/rrdtool';
+$config['rrdtool_version'] = 1.6;
if ($config['secure_cookies']) {
ini_set('session.cookie_secure', 1);

View File

@ -1,13 +0,0 @@
$OpenBSD: patch-lib_influxdb-php_requirements_sh,v 1.3 2017/05/30 21:05:44 sthen Exp $
Index: lib/influxdb-php/requirements.sh
--- lib/influxdb-php/requirements.sh.orig
+++ lib/influxdb-php/requirements.sh
@@ -1,6 +1,4 @@
-#!/usr/local/bin/bash
-
-#!/usr/local/bin/bash
+#!/bin/sh
GLEXEC=$(which ansible-galaxy)

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-validate_php,v 1.15 2018/02/12 23:27:18 sthen Exp $
$OpenBSD: patch-validate_php,v 1.16 2018/02/27 15:17:39 sthen Exp $
- files installed from packages should only be updated via packages so
it's safer if they are owned by root; adjust the ownership check so that
@ -32,4 +32,4 @@ Index: validate.php
+$dep_check = shell_exec('%PHP% scripts/composer_wrapper.php install --no-dev --dry-run');
preg_match_all('/Installing ([^ ]+\/[^ ]+) \(/', $dep_check, $dep_missing);
if (!empty($dep_missing[0])) {
print_fail("Missing dependencies!", "composer install --no-dev");
print_fail("Missing dependencies!", "./scripts/composer_wrapper.php install --no-dev");

File diff suppressed because it is too large Load Diff