summaryrefslogtreecommitdiff
path: root/sysutils/munin-common
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/munin-common')
-rw-r--r--sysutils/munin-common/DESCR10
-rw-r--r--sysutils/munin-common/Makefile25
-rw-r--r--sysutils/munin-common/Makefile.common79
-rw-r--r--sysutils/munin-common/distinfo11
-rw-r--r--sysutils/munin-common/patches/patch-MANIFEST30
-rw-r--r--sysutils/munin-common/patches/patch-Makefile107
-rw-r--r--sysutils/munin-common/patches/patch-Makefile.config159
-rw-r--r--sysutils/munin-common/patches/patch-common_Build.PL14
-rw-r--r--sysutils/munin-common/patches/patch-lib_Munin_Common_Defaults.pm41
9 files changed, 476 insertions, 0 deletions
diff --git a/sysutils/munin-common/DESCR b/sysutils/munin-common/DESCR
new file mode 100644
index 00000000000..b8c39d5aee5
--- /dev/null
+++ b/sysutils/munin-common/DESCR
@@ -0,0 +1,10 @@
+Munin is a tool for graphing all sorts of information about one or
+more servers and displaying it in a web interface. It uses the
+execellent RRDTool (written by Tobi Oetiker) and is written in Perl.
+Munin has a master/node architecture. The master connects to all the
+nodes at regular intervals, and asks them for data. It then stores
+the data in RRD-files, and (if needed) updates the graphs. One of the
+main goals has been ease of creating own "plugins" (graphs).
+
+This package manages the common components used by both master and
+node munin packages.
diff --git a/sysutils/munin-common/Makefile b/sysutils/munin-common/Makefile
new file mode 100644
index 00000000000..faf5d726627
--- /dev/null
+++ b/sysutils/munin-common/Makefile
@@ -0,0 +1,25 @@
+# $NetBSD: Makefile,v 1.1 2019/09/09 12:21:44 tm Exp $
+#
+
+PKGNAME= ${DISTNAME:S/munin/munin-common/}
+COMMENT= Common components between a munin node and master
+
+.include "../../sysutils/munin-common/Makefile.common"
+
+# Adjust WRKSRC for the Perl module framework, but keep the same
+# patch base directory
+WRKSRC= ${WRKDIR}/${DISTNAME}/common
+PATCH_ARGS= -d ${WRKSRC}/.. --forward -E ${PATCH_STRIP}
+
+PERL5_MODULE_TYPE= Module::Build
+PERL5_PACKLIST= auto/Munin/Common/.packlist
+
+SUBST_CLASSES+= paths
+SUBST_STAGE.paths= pre-configure
+SUBST_FILES.paths= lib/Munin/Common/Defaults.pm
+SUBST_VARS.paths= PKG_SYSCONFDIR MUNIN_DBDIR MUNIN_LIBDIR \
+ MUNIN_LOGDIR MUNIN_STATEDIR MUNIN_WWWDIR \
+ MUNIN_PLUGSTATE PERL5
+
+.include "../../lang/perl5/module.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/munin-common/Makefile.common b/sysutils/munin-common/Makefile.common
new file mode 100644
index 00000000000..ecc6cff3c2d
--- /dev/null
+++ b/sysutils/munin-common/Makefile.common
@@ -0,0 +1,79 @@
+# $NetBSD: Makefile.common,v 1.1 2019/09/09 12:21:44 tm Exp $
+#
+# used by sysutils/munin-common/Makefile
+# used by sysutils/munin-master/Makefile
+# used by sysutils/munin-node/Makefile
+
+VERSION= 2.0.49
+DISTNAME= munin-${VERSION}
+CATEGORIES= sysutils
+MASTER_SITES= http://downloads.munin-monitoring.org/munin/stable/${VERSION}/
+
+MAINTAINER= tm@NetBSD.org
+HOMEPAGE= http://munin-monitoring.org/
+LICENSE= gnu-gpl-v2
+
+BUILD_DEPENDS+= p5-CPAN-Meta>=2.141170:../../devel/p5-CPAN-Meta
+BUILD_DEPENDS+= p5-Module-Build>=0.42050:../../devel/p5-Module-Build
+BUILD_DEPENDS+= p5-Time-HiRes>=0:../../time/p5-Time-HiRes
+DEPENDS= p5-Net-SSLeay>=0:../../security/p5-Net-SSLeay
+
+DISTINFO_FILE= ${.CURDIR}/../../sysutils/munin-common/distinfo
+PATCHDIR= ${.CURDIR}/../../sysutils/munin-common/patches
+
+.include "../../mk/bsd.prefs.mk"
+
+USE_LANGUAGES= # none
+USE_TOOLS+= gmake bash:run perl:run
+
+BUILD_DEFS+= VARBASE
+
+MUNIN_GROUP?= munin
+MUNIN_USER?= munin
+
+MUNIN_DBDIR?= ${VARBASE}/munin
+MUNIN_LIBDIR= ${PREFIX}/lib/munin
+MUNIN_LOGDIR?= ${VARBASE}/log/munin
+MUNIN_PLUGSTATE?= ${MUNIN_DBDIR}/plugin-state
+MUNIN_SPOOLDIR?= ${VARBASE}/spool/munin
+MUNIN_STATEDIR?= ${VARBASE}/run/munin
+MUNIN_WWWDIR?= ${PREFIX}/www
+
+PKG_GROUPS_VARS+= MUNIN_GROUP
+PKG_USERS_VARS+= MUNIN_USER
+PKG_GROUPS= ${MUNIN_GROUP}
+PKG_USERS= ${MUNIN_USER}:${MUNIN_GROUP}
+PKG_GECOS.${MUNIN_USER}= Munin user
+PKG_HOME.${MUNIN_USER}= ${MUNIN_DBDIR}
+PKG_SHELL.${MUNIN_USER}= ${BASH}
+
+PKG_SYSCONFSUBDIR?= munin
+
+EGDIR= ${PREFIX}/share/examples/munin
+
+REPLACE_PERL= master/_bin/munin-update.in
+
+FILES_SUBST+= MUNIN_GROUP=${MUNIN_GROUP}
+FILES_SUBST+= MUNIN_RUN=${MUNIN_RUN:Q}
+FILES_SUBST+= MUNIN_USER=${MUNIN_USER}
+FILES_SUBST+= PERL=${PERL5:Q}
+FILES_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
+FILES_SUBST+= STATEDIR=${STATEDIR}
+
+MAKE_ENV+= PERL_USE_UNSAFE_INC=1
+MAKE_ENV+= BASH=${BASH:Q}
+MAKE_ENV+= CONFDIR=${PKG_SYSCONFDIR}
+MAKE_ENV+= MUNIN_DBDIR=${MUNIN_DBDIR}
+MAKE_ENV+= MUNIN_GROUP=${MUNIN_GROUP}
+MAKE_ENV+= MUNIN_LOGDIR=${MUNIN_LOGDIR}
+MAKE_ENV+= MUNIN_PLUGSTATE=${MUNIN_PLUGSTATE}
+MAKE_ENV+= MUNIN_SPOOLDIR=${MUNIN_SPOOLDIR}
+MAKE_ENV+= MUNIN_STATEDIR=${MUNIN_STATEDIR}
+MAKE_ENV+= MUNIN_USER=${MUNIN_USER}
+MAKE_ENV+= MUNIN_WWWDIR=${MUNIN_WWWDIR}
+MAKE_ENV+= PERL5=${PERL5:Q}
+MAKE_ENV+= PREFIX=${PREFIX}
+MAKE_ENV+= PYTHONBIN=${PYTHONBIN:Q}
+MAKE_ENV+= RUBY=${RUBY:Q}
+
+MESSAGE_SUBST+= MUNIN_USER=${MUNIN_USER}
diff --git a/sysutils/munin-common/distinfo b/sysutils/munin-common/distinfo
new file mode 100644
index 00000000000..093431c2504
--- /dev/null
+++ b/sysutils/munin-common/distinfo
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.1 2019/09/09 12:21:44 tm Exp $
+
+SHA1 (munin-2.0.49.tar.gz) = 48531b84c4382983cf4fe64a7c3ad22a86cbdc2e
+RMD160 (munin-2.0.49.tar.gz) = 0e13eb4dfd01ea122476d041f51233612db00cfd
+SHA512 (munin-2.0.49.tar.gz) = 20f1f27aa1ff39ed92c967a13581ae199930323f5d2b62b62ce0a548a4cf561595e85d069e836b156c05d4a94c66328009aba56cb1b06c4b2719fbd9e1061ca4
+Size (munin-2.0.49.tar.gz) = 2252353 bytes
+SHA1 (patch-MANIFEST) = 538cec30723a6d41b732c9dc4a175472fb821609
+SHA1 (patch-Makefile) = 725b2fbac05ec89882fec295b8d38fc183bb310a
+SHA1 (patch-Makefile.config) = ce29e172ddf3303e6539c269622e3c0d9e10e099
+SHA1 (patch-common_Build.PL) = 7d7f5afde978d0e5641f931d3f2585651ff40c1a
+SHA1 (patch-lib_Munin_Common_Defaults.pm) = 2f6ffe9fe1b91361e35b9bfcac239252ba789482
diff --git a/sysutils/munin-common/patches/patch-MANIFEST b/sysutils/munin-common/patches/patch-MANIFEST
new file mode 100644
index 00000000000..08b80ec3762
--- /dev/null
+++ b/sysutils/munin-common/patches/patch-MANIFEST
@@ -0,0 +1,30 @@
+$NetBSD: patch-MANIFEST,v 1.1 2019/09/09 12:21:44 tm Exp $
+
+Add missing MANIFEST file so that Munin::Common becomes manageable
+by the Perl module framework.
+
+--- /dev/null 2011-01-09 11:43:05.000000000 +0000
++++ common/MANIFEST
+@@ -0,0 +1,22 @@
++Build.PL
++lib/Munin/Common/Config.pm
++lib/Munin/Common/Defaults.pm
++lib/Munin/Common/Timeout.pm
++lib/Munin/Common/TLS.pm
++lib/Munin/Common/TLSClient.pm
++lib/Munin/Common/TLSServer.pm
++MANIFEST This list of files
++t/critic.t
++t/munin_common_config.t
++t/munin_common_defaults.t
++t/munin_common_timeout.t
++t/munin_common_tls.t
++t/pod-coverage.t
++t/pod.t
++t/tls/CA/ca_cert.pem
++t/tls/master_cert.pem
++t/tls/master_key.pem
++t/tls/node_cert.pem
++t/tls/node_key.pem
++t/tls/openssl.cnf
++t/tls/README
diff --git a/sysutils/munin-common/patches/patch-Makefile b/sysutils/munin-common/patches/patch-Makefile
new file mode 100644
index 00000000000..6a580b83670
--- /dev/null
+++ b/sysutils/munin-common/patches/patch-Makefile
@@ -0,0 +1,107 @@
+$NetBSD: patch-Makefile,v 1.1 2019/09/09 12:21:44 tm Exp $
+
+Installation fixed to use all essential files, populate
+PKG_SYSCONFDIR as expected by the Munin scripts. Gets
+configured man3ext from Perl instead of assuming 3pm suffix.
+
+--- Makefile.orig Thu May 9 03:45:43 2019
++++ Makefile Wed Aug 14 12:38:00 2019
+@@ -33,8 +33,9 @@
+ PODMAN8 := build/master/doc/munin-cron master/doc/munin master/doc/munin-check
+ PODMAN5 := build/master/doc/munin.conf node/doc/munin-node.conf
+ PYTHON_LINT_CALL ?= python3 -m flake8
++MAN3EXT := $(shell $(PERL) -e 'use Config; print $$Config{man3ext};')
+ CONFVAR_SUBSTITUTION_FILES = \
+- master/blib/libdoc/Munin\:\:Master\:\:HTMLOld.3pm \
++ master/blib/libdoc/Munin\:\:Master\:\:HTMLOld.$(MAN3EXT) \
+ master/blib/lib/Munin/Master/HTMLOld.pm \
+ node/blib/sbin/munin-node-configure \
+ node/blib/sbin/munin-node \
+@@ -94,50 +95,37 @@
+ install: install-master-prime install-common-prime install-node-prime install-plugins-prime $(JAVA_INSTALL) install-man install-async-prime
+
+ install-pre: $(MAKEFILES)
+- @$(CHECKUSER)
+- mkdir -p $(LOGDIR)
+- mkdir -p $(STATEDIR)
+- mkdir -p $(SPOOLDIR)
+- mkdir -p $(CONFDIR)
+- $(CHOWN) $(USER) $(LOGDIR) $(STATEDIR) $(SPOOLDIR)
++ mkdir -p $(EGDIR)
+
+ install-master-prime: $(INFILES_MASTER) install-pre install-master
+- mkdir -p $(CONFDIR)/templates
+- mkdir -p $(CONFDIR)/static
+- mkdir -p $(CONFDIR)/templates/partial
+- mkdir -p $(CONFDIR)/munin-conf.d
++ mkdir -p $(EGDIR)/templates
++ mkdir -p $(EGDIR)/static
++ mkdir -p $(EGDIR)/templates/partial
++ mkdir -p $(EGDIR)/munin-conf.d
+ mkdir -p $(LIBDIR)
+ mkdir -p $(BINDIR)
+ mkdir -p $(PERLLIB)
+ mkdir -p $(PERLLIB)/Munin/Master
+ mkdir -p $(HTMLDIR)
+- mkdir -p $(DBDIR)
+- mkdir -p $(DBDIR)/cgi-tmp
+ mkdir -p $(CGIDIR)
+
+- $(CHOWN) $(USER) $(HTMLDIR) $(DBDIR)
+- $(CHMOD) 0755 $(DBDIR)
+-
+- $(CHOWN) $(CGIUSER) $(DBDIR)/cgi-tmp
+- $(CHMOD) 0755 $(DBDIR)/cgi-tmp
+-
+ for p in master/www/*.tmpl ; do \
+- $(INSTALL) -m 0644 "$$p" $(CONFDIR)/templates/ ; \
++ $(INSTALL) -m 0644 "$$p" $(EGDIR)/templates/ ; \
+ done
+
+ for p in master/static/* ; do \
+- $(INSTALL) -m 0644 "$$p" $(CONFDIR)/static/ ; \
++ $(INSTALL) -m 0644 "$$p" $(EGDIR)/static/ ; \
+ done
+
+ for p in master/www/partial/*.tmpl; do \
+- $(INSTALL) -m 0644 "$$p" $(CONFDIR)/templates/partial/ ; \
++ $(INSTALL) -m 0644 "$$p" $(EGDIR)/templates/partial/ ; \
+ done
+
+ $(INSTALL) -m 0644 master/DejaVuSansMono.ttf $(LIBDIR)/
+ $(INSTALL) -m 0644 master/DejaVuSans.ttf $(LIBDIR)/
+
+- test -f $(HTMLDIR)/.htaccess || $(INSTALL) -m 0644 build/master/www/munin-htaccess $(HTMLDIR)/.htaccess
+- test -f "$(CONFDIR)/munin.conf" || $(INSTALL) -m 0644 build/master/munin.conf $(CONFDIR)/
++ $(INSTALL) -m 0644 build/master/www/munin-htaccess $(HTMLDIR)/.htaccess
++ $(INSTALL) -m 0644 build/master/munin.conf $(EGDIR)/
+
+ $(INSTALL) -m 0755 build/master/_bin/munin-cron $(BINDIR)/
+ $(INSTALL) -m 0755 build/master/_bin/munin-check $(BINDIR)/
+@@ -156,17 +144,8 @@
+ install-node-plugins: install-plugins-prime
+
+ install-plugins-prime: install-plugins build $(PLUGINS) $(MAKEFILES)
+- @$(CHECKGROUP)
+-
+- mkdir -p $(CONFDIR)/plugins
+- mkdir -p $(CONFDIR)/plugin-conf.d
+ mkdir -p $(LIBDIR)/plugins
+- mkdir -p $(PLUGSTATE)
+
+- $(CHOWN) root:root $(PLUGSTATE)
+- $(CHMOD) 0755 $(PLUGSTATE)
+- $(CHMOD) 0755 $(CONFDIR)/plugin-conf.d
+-
+ @# Process the OS specific plugins at the end. Otherwise they would be overridden by the
+ @# generic ones.
+ for p in build/plugins/node.d/* build/plugins/node.d.$(OSTYPE)/* ; do \
+@@ -205,7 +184,7 @@
+ install-node-prime: install-node-pre install-node
+
+ install-node-pre: build/node/munin-node.conf install-pre
+- test -f "$(CONFDIR)/munin-node.conf" || $(INSTALL) -m 0644 build/node/munin-node.conf $(CONFDIR)/
++ $(INSTALL) -m 0644 build/node/munin-node.conf $(EGDIR)/
+
+
+ install-common-prime: build-common install-common
diff --git a/sysutils/munin-common/patches/patch-Makefile.config b/sysutils/munin-common/patches/patch-Makefile.config
new file mode 100644
index 00000000000..486bcf9ff55
--- /dev/null
+++ b/sysutils/munin-common/patches/patch-Makefile.config
@@ -0,0 +1,159 @@
+$NetBSD: patch-Makefile.config,v 1.1 2019/09/09 12:21:44 tm Exp $
+
+Define proper default locations and tools. Really need Bash for plugins
+despite what upstream says.
+
+--- Makefile.config.orig 2019-01-17 12:20:47.528006286 +0000
++++ Makefile.config
+@@ -17,35 +17,38 @@
+ #
+ # the base of the Munin installation.
+ #
+-PREFIX = $(DESTDIR)/opt/munin
++UPREFIX = $(DESTDIR)$(PREFIX)
+
+ # Where Munin keeps its configurations (server.conf, client.conf, ++)
+-CONFDIR = $(DESTDIR)/etc/opt/munin
++# CONFDIR = $(UPREFIX)/etc/munin
++
++# Where pkgsrc installs example config files
++EGDIR = $(UPREFIX)/share/examples/munin
+
+ # Server only - where to put munin-cron
+-BINDIR = $(PREFIX)/bin
++BINDIR = $(UPREFIX)/bin
+
+ # Client only - where to put munin-node, munin-node-configure, and munin-run
+-SBINDIR = $(PREFIX)/sbin
++SBINDIR = $(UPREFIX)/sbin
+
+ # Where to put text and html documentation
+-DOCDIR = $(PREFIX)/doc
++DOCDIR = $(UPREFIX)/share/doc/munin
+
+ # Where to put man pages
+-MANDIR = $(PREFIX)/man
++MANDIR = $(UPREFIX)/$(PKGMANDIR)
+
+ # Where to put internal binaries and plugin repository
+-LIBDIR = $(PREFIX)/lib
++LIBDIR = $(UPREFIX)/lib/munin
+
+ # Server only - Output directory
+-HTMLDIR = $(PREFIX)/www/docs
+-CGIDIR = $(PREFIX)/www/cgi
++HTMLDIR = $(DESTDIR)/$(MUNIN_WWWDIR)/munin/data
++CGIDIR = $(DESTDIR)/$(MUNIN_WWWDIR)/cgi-bin
+
+ # Where to put internal data for master (RRD, internal files, ...)
+-DBDIR = $(DESTDIR)/var/opt/munin
++DBDIR = $(MUNIN_DBDIR)
+
+ # Where to put internal data for node (plugin state, ...)
+-DBDIRNODE = $(DESTDIR)/var/opt/munin-node
++DBDIRNODE = $(DBDIR)
+
+ # Client only - Where the spool files are written. Must be writable by
+ # group "munin", and should be preserved between reboots
+@@ -56,23 +59,23 @@ SPOOLDIR = $(DBDIR)/spool
+ PLUGSTATE = $(DBDIRNODE)/plugin-state
+
+ # Where Munin should place its logs.
+-LOGDIR = $(PREFIX)/log/munin
++LOGDIR = $(MUNIN_LOGDIR)
+
+ # Location of PID files and other statefiles. On the server, must be
+ # writable by the user "munin".
+-STATEDIR = $(DESTDIR)/var/run/munin
++STATEDIR = $(MUNIN_STATEDIR)
+
+ # The perl interpreter to use
+-PERL := $(shell which perl)
++PERL := $(PERL5)
+
+ # The python interpreter to use (used by some plugins)
+-PYTHON := /usr/bin/env python3
++PYTHON := $(PYTHONBIN)
+
+ # The ruby interpreter to use (used by some plugins)
+-RUBY := /usr/bin/env ruby
++RUBY := $(RUBY)
+
+ # The java runtime to use (used by some plugins)
+-JAVARUN := /usr/bin/java
++JAVARUN := $(JAVA_HOME)/bin/java
+
+ # The java library dir to use (used by some plugins)
+ # this is needed in order to be able to install
+@@ -89,13 +92,14 @@ JAVALIBDIR = $(LIBDIR)
+ # On Linux /bin/sh, SunOS/Solaris /usr/xpg4/bin/sh or /bin/ksh
+ # In general: bash or ksh will work
+ #
+-GOODSH := $(shell PATH=`getconf PATH 2>/dev/null || echo $(PATH)` LANG=C sh -c 'type sh | sed "s/.* //"')
++GOODSH := $(BASH)
+
+ # Path of bash for bash specific plugins
+-BASH := /bin/bash
++BASH := $(BASH)
+
+ # Server only - Where to install the perl libraries
+-PERLLIB = $(DESTDIR)$(shell $(PERL) -V:sitelib | cut -d"'" -f2)
++PERLVENDORLIB := $(shell $(PERL) -V:vendorlib | cut -d"'" -f2)
++PERLLIB = $(DESTDIR)$(PERLVENDORLIB)
+
+ # Client only - Install plugins for this architecture
+ # the LANG=C makes tr work as expected, not regarding any locale it
+@@ -116,8 +120,8 @@ MKTEMP := $(shell ./test-mktemp)
+ VERSION := $(shell ./getversion)
+
+ # User to run munin as
+-USER := munin
+-GROUP := munin
++USER := $(MUNIN_USER)
++GROUP := $(MUNIN_GROUP)
+
+ # Default user to run the plugins as
+ PLUGINUSER := nobody
+@@ -125,32 +129,8 @@ PLUGINUSER := nobody
+ # Default user to run the cgi as
+ CGIUSER := nobody
+
+-# Which command to use to check if the USER and GROUP to run Munin as, exists.
+-ifneq ($(shell which getent),)
+- # "getent" works on most modern OS
+- CHECKUSER_COMMAND := getent passwd $(USER)
+- CHECKGROUP_COMMAND := getent group $(GROUP)
+-else
+- ifeq ($(OSTYPE),darwin)
+- # This should work for OSX 10.5 (Leopard) or later
+- CHECKUSER_COMMAND := dscl . -read /Users/$(USER)
+- CHECKGROUP_COMMAND := dscl . -read /Groups/$(GROUP)
+- else
+- ifeq ($(OSTYPE),cygwin)
+- CHECKUSER_COMMAND := id $(USER)
+- CHECKGROUP_COMMAND := grep ^$(GROUP): /etc/group
+- else
+- ifeq ($(OSTYPE),hp-ux)
+- CHECKUSER_COMMAND := pwget -n $(USER)
+- CHECKGROUP_COMMAND := grget -n $(GROUP)
+- else
+- $(warning Missing test for user existence on this platform. Skipping this check and hoping for the best ...)
+- CHECKUSER_COMMAND := true
+- CHECKGROUP_COMMAND := true
+- endif
+- endif
+- endif
+-endif
++CHECKUSER_COMMAND := true
++CHECKGROUP_COMMAND := true
+ CHECKUSER := $(shell $(CHECKUSER_COMMAND) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
+ CHECKGROUP := $(shell $(CHECKGROUP_COMMAND) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
+
+@@ -159,7 +139,7 @@ CHMOD := chmod
+ CHGRP := chgrp
+
+ # Java compiler stuff - only needed on the buildhost
+-JC := javac
++JC := $(JAVA_HOME)/bin/javac
+ JFLAGS := -g -source 1.7 -target 1.7 -Xlint
+ JAR := jar
diff --git a/sysutils/munin-common/patches/patch-common_Build.PL b/sysutils/munin-common/patches/patch-common_Build.PL
new file mode 100644
index 00000000000..9253b9d2792
--- /dev/null
+++ b/sysutils/munin-common/patches/patch-common_Build.PL
@@ -0,0 +1,14 @@
+$NetBSD: patch-common_Build.PL,v 1.1 2019/09/09 12:21:44 tm Exp $
+
+Add missing module_name so that Munin::Common becomes a valid Perl Module.
+
+--- common/Build.PL.orig 2019-01-17 12:03:08.506724040 +0000
++++ common/Build.PL
+@@ -4,6 +4,7 @@ my $version = `../getversion`;
+ chomp($version);
+
+ my $build = Module::Build->new(
++ module_name => 'Munin::Common',
+ dist_name => 'Munin::Common',
+ dist_version => $version,
+ dist_author => 'The Munin Team <munin-users@lists.sourceforge.net>',
diff --git a/sysutils/munin-common/patches/patch-lib_Munin_Common_Defaults.pm b/sysutils/munin-common/patches/patch-lib_Munin_Common_Defaults.pm
new file mode 100644
index 00000000000..53ca4f34e4b
--- /dev/null
+++ b/sysutils/munin-common/patches/patch-lib_Munin_Common_Defaults.pm
@@ -0,0 +1,41 @@
+$NetBSD: patch-lib_Munin_Common_Defaults.pm,v 1.1 2019/09/09 12:21:44 tm Exp $
+
+Initialize default paths for all Munin components.
+
+--- common/lib/Munin/Common/Defaults.pm.orig 2014-11-24 21:46:24.000000000 +0000
++++ common/lib/Munin/Common/Defaults.pm
+@@ -18,25 +18,25 @@ my $COMPONENT_ROOT = dirname(__FILE__) .
+ our $DROPDOWNLIMIT = 1;
+
+ our $MUNIN_PREFIX = '';
+-our $MUNIN_CONFDIR = "$COMPONENT_ROOT/t/config/";
++our $MUNIN_CONFDIR = '@PKG_SYSCONFDIR@/';
+ our $MUNIN_BINDIR = '';
+ our $MUNIN_SBINDIR = '';
+ our $MUNIN_DOCDIR = '';
+-our $MUNIN_LIBDIR = '';
+-our $MUNIN_HTMLDIR = '';
+-our $MUNIN_CGIDIR = '';
++our $MUNIN_LIBDIR = '@MUNIN_LIBDIR@';
++our $MUNIN_HTMLDIR = '@MUNIN_WWWDIR@/munin/data';
++our $MUNIN_CGIDIR = '@MUNIN_WWWDIR@/cgi-bin';
+ our $MUNIN_CGITMPDIR = '';
+-our $MUNIN_DBDIR = '';
+-our $MUNIN_PLUGSTATE = '';
++our $MUNIN_DBDIR = '@MUNIN_DBDIR@';
++our $MUNIN_PLUGSTATE = '@MUNIN_PLUGSTATE@';
+ our $MUNIN_SPOOLDIR = '';
+ our $MUNIN_MANDIR = '';
+-our $MUNIN_LOGDIR = "$COMPONENT_ROOT/log/";
+-our $MUNIN_STATEDIR = '';
++our $MUNIN_LOGDIR = '@MUNIN_LOGDIR@/';
++our $MUNIN_STATEDIR = '@MUNIN_STATEDIR@';
+ our $MUNIN_USER = getpwuid $UID;
+ our $MUNIN_GROUP = getgrgid $GID;
+ our $MUNIN_PLUGINUSER = getpwuid $UID;
+ our $MUNIN_VERSION = 'svn';
+-our $MUNIN_PERL = '/usr/bin/perl';
++our $MUNIN_PERL = '@PERL5@';
+ our $MUNIN_PERLLIB = '';
+ our $MUNIN_GOODSH = '';
+ our $MUNIN_BASH = '';