From nobody Fri Oct 18 14:25:43 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XVRng3tqKz5ZHrj; Fri, 18 Oct 2024 14:25:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XVRng3M2Tz4Y54; Fri, 18 Oct 2024 14:25:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729261543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zL421dlcxFR8LD19XkLxh+4wFZWC/accWizqXPyY37E=; b=FrSRv8S3bVRe9xwtm3gMVDV+a45wq7XNzQ7pxiV0F8ZI+6Sjt08A625AbSHOKwKXa6CXj+ CZ/jXxl5zlutbQzN15h8519phNWgx1Z5HGGEMnQoSwxBRfOQI+eRIVuz0OQJtt2W2/YCs8 XXP/L13xOMzI2OEmkPvwm6yPnEtrvzhClfFvkBQtJdy6JyyBeyBMy3m/z0yIpse5jZiFX3 E3Y7o0yvRhRFWKBynKJj1pzoUXle2qyW8rE6FIaD6E5NhtB4O4U7qbSRVYszqAcg6sjrqe X6RkSDKpTu4mWyf9qmP3Qnf2TzNkXNF4WH8TrlSTS3XNQB9y9SMUDE067zDmFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729261543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zL421dlcxFR8LD19XkLxh+4wFZWC/accWizqXPyY37E=; b=kPDNv8V1InsNQgaoBgl676FnOUAqCOolqLrSXgW+goFclw7qDpzDmHxcO3+g6orA/LecvG xio293Z6iLQzHqV2X6f9jX7f4PGDznqb7DArD0fk+L6sip3O1F6Sh2fblFGweAQJJ0sT91 e5RszbzqF6znzALxlVfTltMjXK+1TEF9h/xB60GfPyS+YjbIfoYHu23ZH3i9C7SClj+IqK hEwFT6JlAUgh01GY+BgoBtKDJgeAEaP13RGxOoIP3lrTcNS+RvzJWn+S0xM8pyyONIMygX MgjF0pMVwfSx1essKPThNIFwGnFfP6Aq4CgDbH6BpAW1oazxRRanwBTPJ7ZuoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729261543; a=rsa-sha256; cv=none; b=jKQm9ksFChhuU3aFCPmjX7TlPCWaxdFlKpxkb12699qUlRLwc6OtKOQVIUO1JbkcAokP4o aFCnhIXOepG17rvfeeoGIPl0/LnLQpejITd9f1Gqwfg7v1/cnhmxdGEaq2QbZcD42dRrP3 u4rShCrPilZs2jus365xntxpBjqDL63t3Nk87bg0HDgJuwzSJ0AvgyhOLpaUUQGSYnJMFz 29IWY6y4JrQzN0rLMAIDD1p7JASiCRpaeqsAabAcB+T11EJEowsnxmD+ejVVsExJbU8DR4 3YwVdr9Gv0OfD8aRlNKCwWGjfnupd68buxlEkt3r23eFuHAh7i+TZBPisJtMug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XVRng2QWPzch2; Fri, 18 Oct 2024 14:25:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49IEPhpw066852; Fri, 18 Oct 2024 14:25:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49IEPhmZ066849; Fri, 18 Oct 2024 14:25:43 GMT (envelope-from git) Date: Fri, 18 Oct 2024 14:25:43 GMT Message-Id: <202410181425.49IEPhmZ066849@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dirk Meyer Subject: git: e25d62fc9bf6 - main - net-mgmt/mrtg: fix regression with gcc14 / clang16 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dinoex X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e25d62fc9bf6b007940a06a889a3501fa3e51607 Auto-Submitted: auto-generated The branch main has been updated by dinoex: URL: https://cgit.FreeBSD.org/ports/commit/?id=e25d62fc9bf6b007940a06a889a3501fa3e51607 commit e25d62fc9bf6b007940a06a889a3501fa3e51607 Author: Dirk Meyer AuthorDate: 2024-10-18 14:24:47 +0000 Commit: Dirk Meyer CommitDate: 2024-10-18 14:24:47 +0000 net-mgmt/mrtg: fix regression with gcc14 / clang16 - fix shebangfix - use textproc/p5-Pod-Parser Obtained from: NetBSD - add ubiquiti to cfgmaker - fix HC detection in cfgmaker --- net-mgmt/mrtg/Makefile | 9 ++++++--- net-mgmt/mrtg/files/patch-Makefile.in | 32 +++++++++++++++++++++++++++++ net-mgmt/mrtg/files/patch-Mrtg_nsi | 11 ++++++++++ net-mgmt/mrtg/files/patch-cfgmaker | 38 +++++++++++++++++++++++++++++++++++ net-mgmt/mrtg/files/patch-configure | 13 +++++++++--- net-mgmt/mrtg/files/patch-rateup.c | 14 +++++++++++++ 6 files changed, 111 insertions(+), 6 deletions(-) diff --git a/net-mgmt/mrtg/Makefile b/net-mgmt/mrtg/Makefile index 61249a09cf5b..bec636fbea34 100644 --- a/net-mgmt/mrtg/Makefile +++ b/net-mgmt/mrtg/Makefile @@ -1,6 +1,6 @@ PORTNAME= mrtg DISTVERSION= 2.17.10 -PORTREVISION= 2 +PORTREVISION= 3 PORTEPOCH= 1 CATEGORIES= net-mgmt MASTER_SITES= https://github.com/oetiker/${PORTNAME}/releases/download/v${DISTVERSION}/ \ @@ -14,7 +14,9 @@ LICENSE= GPLv2 LIB_DEPENDS= libgd.so:${GD_PORT} \ libpng16.so:graphics/png -RUN_DEPENDS= p5-SNMP_Session>=0:net-mgmt/p5-SNMP_Session +RUN_DEPENDS= p5-SNMP_Session>=0:net-mgmt/p5-SNMP_Session \ + p5-Pod-Parser>=0:textproc/p5-Pod-Parser \ + p5-Module-CoreList>=0:devel/p5-Module-CoreList USES= perl5 shebangfix @@ -29,7 +31,8 @@ GROUPS= mrtg MAKE_ENV+= PERL=${PERL} MRTG_RUNDIR?= /var/run/mrtg -SHEBANG_FILES= bin/mrtg-traffic-sum +SHEBANG_FILES= bin/cfgmaker bin/indexmaker bin/mrtg bin/mrtg-traffic-sum +perl_OLD_CMD= /home/oetiker/.plenv/shims/perl USE_RC_SUBR= mrtg_daemon SUB_FILES= pkg-deinstall pkg-install pkg-message diff --git a/net-mgmt/mrtg/files/patch-Makefile.in b/net-mgmt/mrtg/files/patch-Makefile.in new file mode 100644 index 000000000000..61447f9ba420 --- /dev/null +++ b/net-mgmt/mrtg/files/patch-Makefile.in @@ -0,0 +1,32 @@ +Ignore the enclosed Pod-Parser in favour of textproc/p5-Pod-Parser, +avoiding pointless conflicts with p5 packages + +Install Perl modules to the proper versioned vendorlib directory + +--- Makefile.in.orig 2022-01-19 10:24:31 UTC ++++ Makefile.in +@@ -38,7 +38,7 @@ subst: + $(CC) $(CPPFLAGS) $(CFLAGS) -c $(top_srcdir)/src/rateup.c -o bin/rateup.o + + subst: +- $(PERL) -0777 -p -i~ -e "s'^#!\s*/\S*perl'#! $(PERL)'" $(top_srcdir)/bin/cfgmaker $(top_srcdir)/bin/indexmaker $(top_srcdir)/bin/mrtg ++ $(PERL) -0777 -p -i~ -e "s@__PREFIX__@${prefix}@g" $(top_srcdir)/bin/cfgmaker $(top_srcdir)/bin/indexmaker $(top_srcdir)/bin/mrtg + $(PERL) -0777 -p -i~ -e 's@GRAPHFMT="...";@GRAPHFMT="$(GDFORM_EXT)";@' $(top_srcdir)/bin/mrtg $(top_srcdir)/bin/indexmaker + + configure: configure.ac +@@ -58,12 +58,10 @@ install: all + for x in $(top_srcdir)/bin/mrtg $(top_srcdir)/bin/cfgmaker $(top_srcdir)/bin/indexmaker $(top_srcdir)/bin/mrtg-traffic-sum; do \ + $(INSTALL) -m 755 $$x $(DESTDIR)$(bindir); done + for x in bin/rateup; do \ +- $(INSTALL) -m 755 $$x $(DESTDIR)$(bindir); done +- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)/mrtg2/Pod ++ $(INSTALL) -m 755 -s $$x $(DESTDIR)$(bindir); done ++ $(MKINSTALLDIRS) $(DESTDIR)${PERL5_INSTALLVENDORLIB} + for x in $(top_srcdir)/lib/mrtg2/*.pm; do \ +- $(INSTALL) -m 644 $$x $(DESTDIR)$(libdir)/mrtg2; done +- for x in $(top_srcdir)/lib/mrtg2/Pod/*.pm; do \ +- $(INSTALL) -m 644 $$x $(DESTDIR)$(libdir)/mrtg2/Pod; done ++ $(INSTALL) -m 644 $$x $(DESTDIR)${PERL5_INSTALLVENDORLIB}; done + $(MKINSTALLDIRS) $(DESTDIR)$(datadir)/mrtg2/icons + for x in $(top_srcdir)/images/*.gif $(top_srcdir)/images/*.png; do \ + $(INSTALL) -m 644 $$x $(DESTDIR)$(datadir)/mrtg2/icons; done diff --git a/net-mgmt/mrtg/files/patch-Mrtg_nsi b/net-mgmt/mrtg/files/patch-Mrtg_nsi new file mode 100644 index 000000000000..55cce864648a --- /dev/null +++ b/net-mgmt/mrtg/files/patch-Mrtg_nsi @@ -0,0 +1,11 @@ +--- contrib/NSI/Mrtg_nsi.orig 2017-03-05 14:09:53 UTC ++++ contrib/NSI/Mrtg_nsi +@@ -59,7 +59,7 @@ $main::OS = 'NT'; + } + die "ERROR: Can\'t find location of mrtg executable\n" + unless $main::binpath; +- unshift (@INC,$main::binpath); ++ $main::binpath .= "/../libexec" + } + + # There older perls tend to behave peculiar with diff --git a/net-mgmt/mrtg/files/patch-cfgmaker b/net-mgmt/mrtg/files/patch-cfgmaker new file mode 100644 index 000000000000..9053ec35fb7d --- /dev/null +++ b/net-mgmt/mrtg/files/patch-cfgmaker @@ -0,0 +1,38 @@ +--- bin/cfgmaker.orig 2022-01-19 10:25:15 UTC ++++ bin/cfgmaker +@@ -175,7 +175,7 @@ sub InterfaceInfo($$$$$) { + push @Variables, ($1 > 11.0 or $1 < 10.0 ) ? "ifAlias" : "CiscolocIfDescr"; + if ($1 > 11.2) {push @Variables, "vmVlan";}; + if ($1 > 11.3) {push @Variables, "vlanTrunkPortDynamicStatus";}; +- } elsif ( $routers->{$router}{deviceinfo}{Vendor} =~ /(?:hp|juniper|dlink|wwp|foundry|dellLan|force10|3com|extremenetworks|openBSD|arista|enterasys|zyxel|vyatta|dcn|brocade|datacom|alcatel|mikrotik|huawei|eltex)/i) { ++ } elsif ( $routers->{$router}{deviceinfo}{Vendor} =~ /(?:hp|juniper|dlink|wwp|foundry|dellLan|force10|3com|extremenetworks|openBSD|arista|enterasys|zyxel|vyatta|dcn|brocade|datacom|alcatel|mikrotik|huawei|eltex|ubiquiti)/i) { + push @Variables, "ifAlias"; + } + +@@ -911,11 +911,11 @@ sub IsCounterBroken ($$$) { + my $snmphost = v4onlyifnecessary($router, $ipv4only); + + if ($router =~ /:[\d.]*:[\d.]*:[\d.]*:[23]/) { +- my $speed = (snmpget($snmphost, $v3opt, 'ifHighSpeed.'.$if))[0] || 'unknown'; ++ my $speed = (snmpget($snmphost, $v3opt, 'ifHighSpeed.'.$if))[0] // 'unknown'; + debug('base',"snmpget $snmphost for ifHighSpeed.$if -> $speed Mb/s"); + $SNMP_Session::errmsg = undef; + $Net_SNMP_util::ErrorMessage = undef; +- my $counter = (snmpget($snmphost,$v3opt, 'ifHCInOctets.'.$if))[0] || 'unknown'; ++ my $counter = (snmpget($snmphost,$v3opt, 'ifHCInOctets.'.$if))[0] // 'unknown'; + debug('base',"snmpget $snmphost for ifHCInOctets.$if -> $counter"); + if( $speed eq 'unknown' or $counter !~ /^\d+$/ or $SNMP_Session::errmsg or $Net_SNMP_util::ErrorMessage){ + $SNMP_Session::errmsg = undef; +@@ -1018,7 +1018,11 @@ sub DeviceInfo ($$$) { + '1.3.6.1.4.1.14988.' => 'mikrotik', + '1.3.6.1.4.1.6486.' => 'alcatel', + '1.3.6.1.4.1.2011.' => 'huawei', +- '1.3.6.1.4.1.35265.' => 'eltex' ++ '1.3.6.1.4.1.35265.' => 'eltex', ++ '1.3.6.1.4.1.4413' => 'ubiquiti', ++ '1.3.6.1.4.1.41112' => 'ubiquiti' ++ ++ + ); + $DevInfo{Vendor} = 'Unknown Vendor - '.$DevInfo{sysObjectID}; + foreach (keys %vendorIDs) { diff --git a/net-mgmt/mrtg/files/patch-configure b/net-mgmt/mrtg/files/patch-configure index 4c0104f398a3..619060a62149 100644 --- a/net-mgmt/mrtg/files/patch-configure +++ b/net-mgmt/mrtg/files/patch-configure @@ -1,7 +1,14 @@ -If I can shave off 7 seconds off every exp-run this patch seems totally worth it ---- configure.orig 2014-12-11 13:46:28 UTC +--- configure.orig 2022-01-19 10:24:35 UTC +++ configure -@@ -5343,18 +5343,12 @@ fi +@@ -3664,6 +3664,7 @@ else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include ++#include + int main() + { + long long b, a = -0x3AFAFAFAFAFAFAFALL; +@@ -5384,18 +5385,12 @@ echo $ECHO_N "ordering CD from http://tobi.oetiker.ch/ echo $ECHO_N "ordering CD from http://tobi.oetiker.ch/wish $ECHO_C" 1>&6 diff --git a/net-mgmt/mrtg/files/patch-rateup.c b/net-mgmt/mrtg/files/patch-rateup.c new file mode 100644 index 000000000000..4e119ef4add0 --- /dev/null +++ b/net-mgmt/mrtg/files/patch-rateup.c @@ -0,0 +1,14 @@ +--- src/rateup.c.orig 2022-01-19 10:25:16 UTC ++++ src/rateup.c +@@ -49,11 +49,6 @@ + #define GFORM_GD gdImagePng + #endif + +-/* BSD* does not have/need malloc.h */ +-#if !defined(bsdi) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__APPLE__) +-#include +-#endif +- + /* MSVCRT.DLL does not know %ll in printf */ + #ifdef __MINGW32_VERSION + #define LLD "%I64d"