pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Also clone sysutils/munin-common into wip.



Module Name:	pkgsrc-wip
Committed By:	Alexander Schreiber <als%thangorodrim.de@localhost>
Pushed By:	als
Date:		Thu May 11 22:04:55 2023 +0000
Changeset:	6d72c42cd53011ae0efefe99f9ff2ed9fa27a67f

Modified Files:
	Makefile
Added Files:
	munin-common/DESCR
	munin-common/Makefile
	munin-common/Makefile.common
	munin-common/distinfo
	munin-common/patches/patch-MANIFEST
	munin-common/patches/patch-Makefile
	munin-common/patches/patch-Makefile.config
	munin-common/patches/patch-common_Build.PL
	munin-common/patches/patch-common_lib_Munin_Common_Defaults.pm
	munin-common/patches/patch-plugins_node.d.sunos_if__.in
	munin-common/patches/patch-plugins_node.d.sunos_if__err__.in

Log Message:
Also clone sysutils/munin-common into wip.

Clone sysutils/munin-common into wip as starting point.

Signed-off-by: Alexander Schreiber <als%thangorodrim.de@localhost>

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=6d72c42cd53011ae0efefe99f9ff2ed9fa27a67f

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                           |   3 +-
 munin-common/DESCR                                 |  10 ++
 munin-common/Makefile                              |  26 ++++
 munin-common/Makefile.common                       |  77 ++++++++++
 munin-common/distinfo                              |  12 ++
 munin-common/patches/patch-MANIFEST                |  30 ++++
 munin-common/patches/patch-Makefile                | 107 ++++++++++++++
 munin-common/patches/patch-Makefile.config         | 159 +++++++++++++++++++++
 munin-common/patches/patch-common_Build.PL         |  14 ++
 .../patch-common_lib_Munin_Common_Defaults.pm      |  41 ++++++
 .../patches/patch-plugins_node.d.sunos_if__.in     |  22 +++
 .../patch-plugins_node.d.sunos_if__err__.in        |  26 ++++
 12 files changed, 526 insertions(+), 1 deletion(-)

diffs:
diff --git a/Makefile b/Makefile
index 9cc293cddc..e60771d48e 100644
--- a/Makefile
+++ b/Makefile
@@ -2495,7 +2495,8 @@ SUBDIR+=	multisync-syncml-moto
 SUBDIR+=	multitail
 SUBDIR+=	mummer4
 SUBDIR+=	munge
-SUBDIR+=	munin
+SUBDIR+=	munin-common
+SUBDIR+=	munin-node
 SUBDIR+=	muon
 SUBDIR+=	mupen64plus
 SUBDIR+=	mupen64plus-extraplugins
diff --git a/munin-common/DESCR b/munin-common/DESCR
new file mode 100644
index 0000000000..b8c39d5aee
--- /dev/null
+++ b/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/munin-common/Makefile b/munin-common/Makefile
new file mode 100644
index 0000000000..d6b461baa0
--- /dev/null
+++ b/munin-common/Makefile
@@ -0,0 +1,26 @@
+# $NetBSD: Makefile,v 1.7 2022/06/28 11:35:58 wiz Exp $
+#
+
+PKGNAME=	${DISTNAME:S/munin/munin-common/}
+PKGREVISION=	1
+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/munin-common/Makefile.common b/munin-common/Makefile.common
new file mode 100644
index 0000000000..740d5920c4
--- /dev/null
+++ b/munin-common/Makefile.common
@@ -0,0 +1,77 @@
+# $NetBSD: Makefile.common,v 1.7 2022/04/04 11:45:33 jperkin Exp $
+#
+# used by sysutils/munin-common/Makefile
+# used by sysutils/munin-master/Makefile
+# used by sysutils/munin-node/Makefile
+
+VERSION=	2.0.69
+DISTNAME=	munin-${VERSION}
+CATEGORIES=	sysutils
+MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=munin/}
+
+MAINTAINER=	tm%NetBSD.org@localhost
+HOMEPAGE=	http://munin-monitoring.org/
+LICENSE=	gnu-gpl-v2
+
+BUILD_DEPENDS+=	p5-Module-Build>=0.42050:../../devel/p5-Module-Build
+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=		${WRKDIR}/${DISTNAME}/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/munin-common/distinfo b/munin-common/distinfo
new file mode 100644
index 0000000000..c5764bb1e1
--- /dev/null
+++ b/munin-common/distinfo
@@ -0,0 +1,12 @@
+$NetBSD: distinfo,v 1.8 2022/04/04 11:45:33 jperkin Exp $
+
+BLAKE2s (munin-2.0.69.tar.gz) = e1dbd5bf8ad7385c12de8ccfb4807aa2dcd9f2bd697068e8e027ae15fad45bbe
+SHA512 (munin-2.0.69.tar.gz) = e79c446d04df97d77b36972203667163ee662e0894e264c5dd84bd9402df780c5e67b69314bfdaddd87f102c4cdedb8fa7d2c07aeea46a8e4e9f08e50a08408f
+Size (munin-2.0.69.tar.gz) = 2250283 bytes
+SHA1 (patch-MANIFEST) = 538cec30723a6d41b732c9dc4a175472fb821609
+SHA1 (patch-Makefile) = f3fd52b56fcddda3efca61453c23243fac35568a
+SHA1 (patch-Makefile.config) = aeaae9374c58c6baf1901ddb9b55a8fac77cf30c
+SHA1 (patch-common_Build.PL) = 7d7f5afde978d0e5641f931d3f2585651ff40c1a
+SHA1 (patch-common_lib_Munin_Common_Defaults.pm) = 09b464d828e12da26d8f41916eb876863b4b4cb3
+SHA1 (patch-plugins_node.d.sunos_if__.in) = 9fe08aebbd759c6fc374e8a43740d28ec8004c90
+SHA1 (patch-plugins_node.d.sunos_if__err__.in) = e905228aa8c5c0d1c3a4d9562d550a0d8c0fbd4c
diff --git a/munin-common/patches/patch-MANIFEST b/munin-common/patches/patch-MANIFEST
new file mode 100644
index 0000000000..08b80ec376
--- /dev/null
+++ b/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/munin-common/patches/patch-Makefile b/munin-common/patches/patch-Makefile
new file mode 100644
index 0000000000..6a580b8367
--- /dev/null
+++ b/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/munin-common/patches/patch-Makefile.config b/munin-common/patches/patch-Makefile.config
new file mode 100644
index 0000000000..486bcf9ff5
--- /dev/null
+++ b/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/munin-common/patches/patch-common_Build.PL b/munin-common/patches/patch-common_Build.PL
new file mode 100644
index 0000000000..9253b9d279
--- /dev/null
+++ b/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@localhost>',
diff --git a/munin-common/patches/patch-common_lib_Munin_Common_Defaults.pm b/munin-common/patches/patch-common_lib_Munin_Common_Defaults.pm
new file mode 100644
index 0000000000..1fb9468b38
--- /dev/null
+++ b/munin-common/patches/patch-common_lib_Munin_Common_Defaults.pm
@@ -0,0 +1,41 @@
+$NetBSD: patch-common_lib_Munin_Common_Defaults.pm,v 1.1 2022/04/04 11:45:33 jperkin Exp $
+
+Initialize default paths for all Munin components.
+
+--- common/lib/Munin/Common/Defaults.pm.orig	2019-05-09 03:45:43.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       = '';
diff --git a/munin-common/patches/patch-plugins_node.d.sunos_if__.in b/munin-common/patches/patch-plugins_node.d.sunos_if__.in
new file mode 100644
index 0000000000..024aa7c139
--- /dev/null
+++ b/munin-common/patches/patch-plugins_node.d.sunos_if__.in
@@ -0,0 +1,22 @@
+$NetBSD: patch-plugins_node.d.sunos_if__.in,v 1.1 2022/04/04 11:45:33 jperkin Exp $
+
+Fix kstats.
+
+--- plugins/node.d.sunos/if_.in.orig	2021-11-22 22:12:17.000000000 +0000
++++ plugins/node.d.sunos/if_.in
+@@ -56,7 +56,7 @@ fi
+ 
+ if [ "$1" = "suggest" ]; then
+ 	if [ -x /usr/bin/kstat ]; then
+-		kstat -p -m '/^(?!unix)/' -n '/^(?!mac$)/' -s rbytes64 | awk -F: '{ print $3 }'
++		kstat -p -s rbytes64 | awk -F: '$3 != "mac" { print $3 }'
+ 		exit 0
+ 	else
+ 		exit 1
+@@ -87,5 +87,5 @@ if [ "$1" = "config" ]; then
+ 	exit 0
+ fi;
+ 
+-kstat -p -m '/^(?!unix)/' -n $INTERFACE -s '*bytes64' | sed \
++kstat -p -n $INTERFACE -s '*bytes64' | sed \
+ 	's/.*\(.bytes\)64./\1.value /'
diff --git a/munin-common/patches/patch-plugins_node.d.sunos_if__err__.in b/munin-common/patches/patch-plugins_node.d.sunos_if__err__.in
new file mode 100644
index 0000000000..2630ce39dc
--- /dev/null
+++ b/munin-common/patches/patch-plugins_node.d.sunos_if__err__.in
@@ -0,0 +1,26 @@
+$NetBSD: patch-plugins_node.d.sunos_if__err__.in,v 1.1 2022/04/04 11:45:33 jperkin Exp $
+
+Fix kstats.
+
+--- plugins/node.d.sunos/if_err_.in.orig	2021-11-22 22:12:17.000000000 +0000
++++ plugins/node.d.sunos/if_err_.in
+@@ -56,7 +56,7 @@ fi
+ 
+ if [ "$1" = "suggest" ]; then
+ 	if [ -x /usr/bin/kstat ]; then
+-		kstat -p -m '/^(?!unix)/' -n '/^(?!mac$)/' -s ierrors | awk -F: '{ print $3 }'
++		kstat -p -s ierrors | awk -F: '$1 != "unix" && $3 != "mac" { print $3 }'
+ 		exit 0
+ 	else
+ 		exit 1
+@@ -88,8 +88,8 @@ if [ "$1" = "config" ]; then
+ 	exit 0
+ fi
+ 
+-kstat -p -m '/^(?!unix)/' -n $INTERFACE -s '/^([io]errors|collisions)$/' | awk -F: '
+-{
++kstat -p -n $INTERFACE -s '/^([io]errors|collisions)$/' | awk -F: '
++$1 != "unix" {
+ 	split($4, four, "\t")
+ 	print four[1] ".value", four[2]
+ }'


Home | Main Index | Thread Index | Old Index