net-mgmt/librenms: Update to 23.1.0

re: https://github.com/librenms/librenms/releases/tag/23.1.0

While here, run the Makefile through portfmt and portlint
This commit is contained in:
Dan Langille 2023-01-25 13:58:08 +00:00
parent 8694ccef73
commit 3e84726434
4 changed files with 37 additions and 41 deletions

View file

@ -1,5 +1,5 @@
PORTNAME= librenms
PORTVERSION= 22.2.1
PORTVERSION= 23.1.0
PORTEPOCH= 1
CATEGORIES= net-mgmt
MASTER_SITES= LOCAL/dvl:vendor
@ -11,6 +11,8 @@ WWW= https://www.librenms.org
LICENSE= GPLv3
IGNORE_WITH_PHP= 82
# perhaps we also need python-memcache python-mysqldb
RUN_DEPENDS+= ${LOCALBASE}/share/pear/Net/IPv4.php:net/pear-Net_IPv4@${PHP_FLAVOR} \
${LOCALBASE}/share/pear/Net/IPv6.php:net/pear-Net_IPv6@${PHP_FLAVOR} \
@ -25,22 +27,22 @@ RUN_DEPENDS+= ${LOCALBASE}/share/pear/Net/IPv4.php:net/pear-Net_IPv4@${PHP_FLAVO
USES= cpe php python shebangfix
USE_GITHUB= yes
USE_PHP= ctype curl dom fileinfo filter gd hash json ldap mbstring \
mysqli openssl pdo pdo_mysql phar posix session simplexml \
snmp sockets tokenizer xml xmlwriter zip
IGNORE_WITH_PHP= 82
mysqli openssl pdo pdo_mysql phar posix session simplexml snmp \
sockets tokenizer xml xmlwriter zip
USE_RC_SUBR= librenms
SHEBANG_FILES= ../${PORTNAME}-vendor-${PORTVERSION}/swiftmailer/swiftmailer/lib/swiftmailer_generate_mimes_config.php \
../${PORTNAME}-vendor-${PORTVERSION}/tecnickcom/tcpdf/tools/tcpdf_addfont.php \
poller-wrapper.py poller.php scripts/auth_test.php \
scripts/check_requirements.py scripts/github-remove \
scripts/check_requirements.py \
scripts/dynamic_check_requirements.py scripts/github-remove \
scripts/ifAlias \
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/dynamic_check_requirements.py \
scripts/removespikes.php scripts/removespikes.pl \
scripts/watchmaillog/watchmaillog.pl
@ -96,7 +98,7 @@ _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
# It sits here so you remember to update it with each release
_RELEASE_TIMESTAMP= 1645175566
_RELEASE_TIMESTAMP= 1674578610
_ROOT_DIRS= LibreNMS app bootstrap config database doc html \
includes licenses mibs misc resources routes scripts \
sql-schema tests
@ -104,23 +106,21 @@ _DOCS= AUTHORS.md CHANGELOG.md CONTRIBUTING.md LICENSE.txt \
README.md
# these are directories which require a generic @DIR entry in pkg-plist
_STORAGE_DIRS= app app/public debugbar framework framework/cache framework/cache/data framework/sessions \
framework/testing framework/views logs
_STORAGE_DIRS= app app/public debugbar framework framework/cache \
framework/cache/data framework/sessions framework/testing \
framework/views logs
# these are directories which require a generic @DIR entry in pkg-plist
_OTHER_DIRS= database/seeders/config html/plugins \
html/js/lang resources/views/overview/custom \
tests/Browser/console \
_OTHER_DIRS= database/seeders/config html/plugins html/js/lang \
resources/views/overview/custom tests/Browser/console \
tests/Browser/screenshots \
vendor/librenms/laravel-vue-i18n-generator/tests/output \
vendor/ramsey/collection/bin \
vendor/symfony/string/Resources/bin
post-patch:
${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}/LibreNMS/Util/Version.php
${REINPLACE_CMD} 's|%%PORTVERSION%%|${PORTVERSION}|g' ${WRKSRC}/LibreNMS/Util/Version.php
${REINPLACE_CMD} 's|%%RELEASE_TIMESTAMP%%|${_RELEASE_TIMESTAMP}|g' ${WRKSRC}/LibreNMS/Util/Version.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

View file

@ -1,5 +1,5 @@
TIMESTAMP = 1645192012
SHA256 (librenms-vendor-22.2.1.tar.gz) = 61d377bb05ba7cb3129d71092437582cc450a7ba029f71a5aadccd988304a490
SIZE (librenms-vendor-22.2.1.tar.gz) = 28184306
SHA256 (librenms-librenms-22.2.1_GH0.tar.gz) = a84dd3b30f412ee2e42b51b74472c6ffbc98e63900caf19fefa15679e44057a6
SIZE (librenms-librenms-22.2.1_GH0.tar.gz) = 53897718
TIMESTAMP = 1674597073
SHA256 (librenms-vendor-23.1.0.tar.gz) = 641381f70f362031646d877d76aaa114a618cb197bdacb7a745bcd32699793fe
SIZE (librenms-vendor-23.1.0.tar.gz) = 27753836
SHA256 (librenms-librenms-23.1.0_GH0.tar.gz) = f10242a5c5bbba3c55116d8d0b9f13efc22ffc256d25c5c477f8e5ecfd9230ad
SIZE (librenms-librenms-23.1.0_GH0.tar.gz) = 56953238

View file

@ -1,8 +1,17 @@
--- LibreNMS/Util/Version.php.orig 2021-05-21 10:09:00 UTC
--- LibreNMS/Util/Version.php.orig 2023-01-24 21:18:47 UTC
+++ LibreNMS/Util/Version.php
@@ -92,7 +92,7 @@ class Version
@@ -56,7 +56,7 @@ class Version
public static function python()
public function date(string $format = 'c'): string
{
- return date($format, $this->git->commitDate() ?: filemtime(__FILE__)); // approximate date for non-git installs
+ return date($format, %%RELEASE_TIMESTAMP%%); // obtained via git show --pretty='%H|%ct' -s %%PORTVERSION%%
}
public function name(): string
@@ -123,7 +123,7 @@
public function python(): string
{
- $proc = new Process(['python3', '--version']);
+ $proc = new Process(['%%LOCALBASE%%/bin/python3', '--version']);

View file

@ -1,13 +0,0 @@
--- includes/common.php.orig 2020-07-10 19:56:16 UTC
+++ includes/common.php
@@ -1004,6 +1004,10 @@ function version_info($remote = false)
$output['local_sha'] = $local_sha;
$output['local_date'] = $local_date;
$output['local_branch'] = rtrim(`git rev-parse --abbrev-ref HEAD`);
+ } else {
+ $output['local_ver'] = '%%PORTVERSION%%';
+ # obtained via git show --pretty='%H|%ct' -s %%PORTVERSION%%
+ $output['local_date'] = %%RELEASE_TIMESTAMP%%;
}
$output['db_schema'] = vsprintf('%s (%s)', $version->database());
$output['php_ver'] = phpversion();