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,105 +1,108 @@ 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}/ \ https://oss.oetiker.ch/${PORTNAME}/pub/ MAINTAINER= dinoex@FreeBSD.org COMMENT= Multi-router traffic grapher WWW= https://oss.oetiker.ch/mrtg/ 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 # override with languages specific gd fonts GD_PORT?= graphics/gd CONFIGURE_ARGS= --with-gd-lib=${LOCALBASE}/lib \ --with-gd-inc=${LOCALBASE}/include USERS= mrtg 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 SUB_LIST= PERL=${PERL} \ MRTG_RUNDIR=${MRTG_RUNDIR} \ USERS=${USERS} \ GROUPS=${GROUPS} PKGINSTALL= ${WRKDIR}/pkg-install PKGDEINSTALL= ${WRKDIR}/pkg-deinstall GNU_CONFIGURE= YES CONFIGURE_ENV= PERL=${PERL} MANPAGE= cfgmaker.1 indexmaker.1 mrtg-contrib.1 mrtg-faq.1 mrtg-forum.1 \ mrtg-ipv6.1 mrtg-logfile.1 mrtg-mibhelp.1 mrtg-nt-guide.1 \ mrtg-nw-guide.1 mrtg-reference.1 mrtg-rrd.1 mrtg-squid.1 \ mrtg-unix-guide.1 mrtg-webserver.1 mrtg.1 MANPAGE3= mrtglib.3 DOCS= CHANGES COPYRIGHT MANIFEST README EXAMPLES= cfgmaker.pod indexmaker.pod mrtg-contrib.pod mrtg-faq.pod \ mrtg-forum.pod mrtg-ipv6.pod mrtg-logfile.pod mrtg-mibhelp.pod \ mrtg-nt-guide.pod mrtg-nw-guide.pod mrtg-reference.pod \ mrtg-rrd.pod mrtg-squid.pod mrtg-unix-guide.pod mrtg.pod \ mrtg-webserver.pod mrtglib.pod cfgmaker.txt indexmaker.txt \ mrtg-contrib.txt mrtg-faq.txt mrtg-forum.txt mrtg-ipv6.txt \ mrtg-logfile.txt mrtg-mibhelp.txt mrtg-nt-guide.txt \ mrtg-nw-guide.txt mrtg-reference.txt mrtg-rrd.txt \ mrtg-squid.txt mrtg-unix-guide.txt mrtg-webserver.txt \ mrtg.txt mrtglib.txt IMAGES= favicon.ico mrtg-l.gif mrtg-l.png mrtg-m.gif mrtg-m.png \ mrtg-r.gif mrtg-r.png mrtg-ti.gif mrtg-ti.png SCRIPTS= cfgmaker indexmaker mrtg mrtg-traffic-sum OPTIONS_DEFINE= DOCS EXAMPLES IPV6 SNMPV3 SNMPV3_DESC= Build with support for SNMPv3 IPV6_RUN_DEPENDS= p5-IO-Socket-INET6>=0:net/p5-IO-Socket-INET6 SNMPV3_RUN_DEPENDS= p5-Net-SNMP>=0:net-mgmt/p5-Net-SNMP PORTDOCS= * PORTEXAMPLES= * post-extract: @${FIND} ${WRKSRC} -type f -name "*.orig" -delete post-patch: @${RM} ${WRKSRC}/lib/mrtg2/BER.pm ${WRKSRC}/lib/mrtg2/SNMP_*.pm do-install: @${MKDIR} ${STAGEDIR}${DOCSDIR} \ ${STAGEDIR}${EXAMPLESDIR}/doc \ ${STAGEDIR}${EXAMPLESDIR}/images \ ${STAGEDIR}${ETCDIR} \ ${STAGEDIR}${PREFIX}/${SITE_PERL_REL} ${INSTALL_DATA} ${DOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}/ ${INSTALL_DATA} ${EXAMPLES:S,^,${WRKSRC}/doc/,} \ ${STAGEDIR}${EXAMPLESDIR}/doc/ ${INSTALL_DATA} ${IMAGES:S,^,${WRKSRC}/images/,} \ ${STAGEDIR}${EXAMPLESDIR}/images/ ${INSTALL_DATA} ${WRKSRC}/contrib/mrtgmk/cfg/mrtg.cfg \ ${STAGEDIR}${ETCDIR}/mrtg.cfg.sample ${INSTALL_DATA} ${MANPAGE:S,^,${WRKSRC}/doc/,} \ ${STAGEDIR}${PREFIX}/share/man/man1/ ${INSTALL_DATA} ${MANPAGE3:S,^,${WRKSRC}/doc/,} \ ${STAGEDIR}${PREFIX}/share/man/man3/ cd ${WRKSRC}/lib/mrtg2 && \ ${COPYTREE_SHARE} "*.pm" ${STAGEDIR}${PREFIX}/${SITE_PERL_REL} ${INSTALL_PROGRAM} ${WRKSRC}/bin/rateup ${STAGEDIR}${PREFIX}/bin/ ${INSTALL_SCRIPT} ${SCRIPTS:S,^,${WRKSRC}/bin/,} \ ${STAGEDIR}${PREFIX}/bin/ .include 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,22 +1,29 @@ -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 -sleep 1 echo $ECHO_N ".$ECHO_C" 1>&6 -sleep 1 echo $ECHO_N ".$ECHO_C" 1>&6 -sleep 1 echo $ECHO_N ".$ECHO_C" 1>&6 -sleep 1 echo $ECHO_N ".$ECHO_C" 1>&6 -sleep 1 { $as_echo "$as_me:${as_lineno-$LINENO}: result: just kidding ;-)" >&5 $as_echo " just kidding ;-)" >&6; } -sleep 2 echo echo "----------------------------------------------------------------" echo "Config is DONE!" 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"