aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Arnold <mat@FreeBSD.org>2004-03-02 15:52:48 +0000
committerMathieu Arnold <mat@FreeBSD.org>2004-03-02 15:52:48 +0000
commit4e96c16014996a5ecdb5bddca7805028b08cb425 (patch)
treeef0b01fb8a485f86a5ef0378f198f6b807a656a9
parent46a6e076cb8c375fe9d3e25db03ba07bd96845cc (diff)
downloadports-4e96c16014996a5ecdb5bddca7805028b08cb425.tar.gz
ports-4e96c16014996a5ecdb5bddca7805028b08cb425.zip
Add Munin network-wide graphing framework
This is the collector. It is installed on the machine that shall collect and display perfromance data. PR: ports/62480 Submitted by: Lupe Christoph <lupe@lupe-christoph.de>
Notes
Notes: svn path=/head/; revision=102739
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/munin-main/Makefile58
-rw-r--r--sysutils/munin-main/distinfo2
-rw-r--r--sysutils/munin-main/files/patch-Makefile.config72
-rw-r--r--sysutils/munin-main/files/pkg-message10
-rw-r--r--sysutils/munin-main/pkg-deinstall96
-rw-r--r--sysutils/munin-main/pkg-descr14
-rw-r--r--sysutils/munin-main/pkg-install121
-rw-r--r--sysutils/munin-main/pkg-plist17
-rw-r--r--sysutils/munin-master/Makefile58
-rw-r--r--sysutils/munin-master/distinfo2
-rw-r--r--sysutils/munin-master/files/patch-Makefile.config72
-rw-r--r--sysutils/munin-master/files/pkg-message10
-rw-r--r--sysutils/munin-master/pkg-deinstall96
-rw-r--r--sysutils/munin-master/pkg-descr14
-rw-r--r--sysutils/munin-master/pkg-install121
-rw-r--r--sysutils/munin-master/pkg-plist17
17 files changed, 781 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 127291c36644..599389c73cf1 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -218,6 +218,7 @@
SUBDIR += msyslog
SUBDIR += mtxorbd
SUBDIR += multitail
+ SUBDIR += munin-main
SUBDIR += muse
SUBDIR += nagios-statd
SUBDIR += nautilus-cd-burner
diff --git a/sysutils/munin-main/Makefile b/sysutils/munin-main/Makefile
new file mode 100644
index 000000000000..e0a9104c0924
--- /dev/null
+++ b/sysutils/munin-main/Makefile
@@ -0,0 +1,58 @@
+# New ports collection makefile for: munin-main
+# Date created: 25 Januar 2004
+# Whom: Lupe Christoph <lupe@lupe-christoph.de>
+#
+# $FreeBSD$
+#
+
+PORTNAME= munin
+PORTVERSION= 1.0.0.p3
+CATEGORIES= sysutils perl5
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= munin
+PKGNAMESUFFIX= -main
+DISTNAME= munin_1.0.0pre3
+
+MAINTAINER= lupe@lupe-christoph.de
+COMMENT= Collector part of Munin
+
+BUILD_DEPENDS= ${RUN_DEPENDS}
+RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/RRDs.pm:${PORTSDIR}/net/rrdtool \
+ ${SITE_PERL}/Net/Domain.pm:${PORTSDIR}/net/p5-Net \
+ ${SITE_PERL}/HTML/Template.pm:${PORTSDIR}/www/p5-HTML-Template
+
+.include <bsd.port.pre.mk>
+
+.if ${PERL_LEVEL} <= 500800
+RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/Storable.pm:${PORTSDIR}/devel/p5-Storable \
+ ${SITE_PERL}/${PERL_ARCH}/Digest/MD5.pm:${PORTSDIR}/security/p5-Digest-MD5 \
+ ${SITE_PERL}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes
+.endif
+
+USE_GMAKE= yes
+PATCH_STRIP= -p1
+WRKSRC= ${WRKDIR}/munin-1.0.0pre3
+PKGMESSAGE= ${WRKDIR}/pkg-message
+ALL_TARGET= DATADIR=${DATADIR} build build-man
+INSTALL_TARGET= DATADIR=${DATADIR} install-main
+
+MAN5= munin.conf.5
+MAN8= munin-cron.8 munin-graph.8 munin-html.8 munin-nagios.8 munin-update.8
+
+pre-install:
+ @${SED} 's@%%PREFIX%%@${PREFIX}@g' ${FILESDIR}/pkg-message > ${PKGMESSAGE}
+ @PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
+
+post-install:
+ @${INSTALL_MAN} -d ${PREFIX}/man/man5
+ @${INSTALL_MAN} -d ${PREFIX}/man/man8
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin.conf.5 ${PREFIX}/man/man5
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-cron.8 ${PREFIX}/man/man8
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-graph.8 ${PREFIX}/man/man8
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-html.8 ${PREFIX}/man/man8
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-nagios.8 ${PREFIX}/man/man8
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-update.8 ${PREFIX}/man/man8
+ @DATADIR=${DATADIR} PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} POST-INSTALL
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.post.mk>
diff --git a/sysutils/munin-main/distinfo b/sysutils/munin-main/distinfo
new file mode 100644
index 000000000000..33d0172cbc07
--- /dev/null
+++ b/sysutils/munin-main/distinfo
@@ -0,0 +1,2 @@
+MD5 (munin_1.0.0pre3.tar.gz) = f1aea51a61304b824dd61d7ad7808f6d
+SIZE (munin_1.0.0pre3.tar.gz) = 120572
diff --git a/sysutils/munin-main/files/patch-Makefile.config b/sysutils/munin-main/files/patch-Makefile.config
new file mode 100644
index 000000000000..7e1b893d6f0f
--- /dev/null
+++ b/sysutils/munin-main/files/patch-Makefile.config
@@ -0,0 +1,72 @@
+--- munin-1.0.0pre3.orig/Makefile.config Sun Feb 1 22:05:52 2004
++++ munin-1.0.0pre3/Makefile.config Sat Feb 7 12:48:23 2004
+@@ -7,42 +7,46 @@
+ #
+ # the base of the Munin installation.
+ #
+-PREFIX = $(DESTDIR)/opt/munin
++ifdef PREFIX
++UPREFIX=$(PREFIX)
++else
++UPREFIX=/usr
++endif
+
+ # Where Munin keeps its configurations (server.conf, client.conf, ++)
+-CONFDIR = $(DESTDIR)/etc/opt/munin
++CONFDIR = $(PREFIX)/etc/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)/doc
+
+ # Where to put man pages
+-MANDIR = $(PREFIX)/man
++MANDIR = $(UPREFIX)/man
+
+ # Where to put internal binaries and plugin repository
+-LIBDIR = $(PREFIX)/lib
++LIBDIR = ${DATADIR}
+
+ # Server only - Output directory
+-HTMLDIR = $(PREFIX)/var/www
++HTMLDIR = $(PREFIX)/www/data/munin
+
+ # Client only - Where to put RRD files and other intenal data
+-DBDIR = $(DESTDIR)/var/opt/munin
++DBDIR = $(PREFIX)/var/munin
+
+ # Client only - Where plugins should put their states. Must be writable by
+ # group "munin", and should be preserved between reboots
+ PLUGSTATE = $(DBDIR)/plugin-state
+
+ # Where Munin should place its logs.
+-LOGDIR = $(DESTDIR)/var/log/munin
++LOGDIR = /var/log
+
+ # Location of PID files and other statefiles. On the server, must be
+ # writable by the user "munin".
+-STATEDIR = $(DESTDIR)/var/run/munin
++STATEDIR = /var/run/munin
+
+ # The perl interpreter to use
+ PERL = $(shell which perl)
+@@ -65,9 +69,8 @@
+ GROUP = munin
+
+ # Which command to use to check if the USER and GROUP to run Munin as, exists.
+-GETENT = $(shell which getent || which true 2>/dev/null)
+-CHECKUSER = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
+-CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
++CHECKUSER:= $(shell grep $(USER) /etc/passwd >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
++CHECKGROUP:= $(shell grep $(GROUP) /etc/group >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
+
+ CHOWN = chown
+ CHMOD = chmod
diff --git a/sysutils/munin-main/files/pkg-message b/sysutils/munin-main/files/pkg-message
new file mode 100644
index 000000000000..2d56e5464b2f
--- /dev/null
+++ b/sysutils/munin-main/files/pkg-message
@@ -0,0 +1,10 @@
+
+********************************************************************
+Unless this file already existed, a sample configuration file
+has been placed in %%PREFIX%%/etc/munin/munin.conf.
+
+Please edit it according to your needs.
+
+The Munin server will be run from cron under the user 'munin'.
+********************************************************************
+
diff --git a/sysutils/munin-main/pkg-deinstall b/sysutils/munin-main/pkg-deinstall
new file mode 100644
index 000000000000..261b7b15a8b3
--- /dev/null
+++ b/sysutils/munin-main/pkg-deinstall
@@ -0,0 +1,96 @@
+#! /bin/sh
+#
+# $Log$
+#
+
+ask() {
+ local question default answer
+
+ question=$1
+ default=$2
+ if [ -z "${PACKAGE_BUILDING}" ]; then
+ read -p "${question} [${default}]? " answer
+ fi
+ if [ x${answer} = x ]; then
+ answer=${default}
+ fi
+ echo ${answer}
+}
+
+yesno() {
+ local dflt question answer
+
+ question=$1
+ dflt=$2
+ while :; do
+ answer=$(ask "${question}" "${dflt}")
+ case "${answer}" in
+ [Yy]*) return 0;;
+ [Nn]*) return 1;;
+ esac
+ echo "Please answer yes or no."
+ done
+}
+
+delete_account() {
+ local u g home
+
+ u=$1
+ g=$2
+ if pw group show ${g} > /dev/null 2>&1; then
+ if yesno "Do you want me to remove group \"${g}\"" y; then
+ pw group del -n ${g}
+ echo "Done."
+ else
+ GID=`pw group show ${g} | awk -F: '{ print $3 }'`
+ fi
+ fi
+ if pw user show ${u} > /dev/null 2>&1; then
+ if yesno "Do you want me to remove user \"${u}\"" y; then
+ eval home=~${u}
+ pw user del -n ${u} -r
+ echo "Done."
+ if [ -d "${home}" ]; then
+ echo "Please remember to remove the home directory \"${home}\""
+ fi
+
+ # pw user del may have removed the group, too.
+ # Put it back if the admin asked us to retain it.
+ if [ -n "$GID" ]; then
+ pw group show ${g} > /dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ pw group add ${g}
+ fi
+ fi
+ fi
+ fi
+}
+
+delete_crontab_entries() {
+ local b e
+ b=$1
+ e=$2
+
+ TMPFILE=`mktemp -t munin` || exit 1
+ crontab -u munin -l | sed -e "/^$b\$/,/^$e\$/d" -e '/^[ ]*#/d' -e '/^$/d' > $TMPFILE
+ if [ -s $TMPFILE ]; then
+ crontab -u munin -l | sed -e "/^$b\$/,/^$e\$/d" | crontab -u munin -
+ echo "The crontab for user munin had manually created entries."
+ echo "Only the automatically created entries have been removed."
+ echo "These are the remaining lines:"
+ crontab -u munin -l
+ else
+ crontab -u munin -r
+ echo "crontab for user munin removed"
+ fi
+ rm $TMPFILE
+}
+
+case $2 in
+ DEINSTALL)
+ delete_crontab_entries '#BEGIN_MUNIN' '#END_MUNIN'
+ ;;
+ POST-DEINSTALL)
+ delete_account munin munin
+ ;;
+esac
diff --git a/sysutils/munin-main/pkg-descr b/sysutils/munin-main/pkg-descr
new file mode 100644
index 000000000000..69168aa584ca
--- /dev/null
+++ b/sysutils/munin-main/pkg-descr
@@ -0,0 +1,14 @@
+Munin network-wide graphing framework (node)
+
+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 have been ease
+of creating own "plugins" (graphs).
+
+This is the collector. It is installed on the machine that shall collect
+and display perfromance data.
+
+WWW: http://www.linpro.no/projects/munin/
diff --git a/sysutils/munin-main/pkg-install b/sysutils/munin-main/pkg-install
new file mode 100644
index 000000000000..4f1614bfbf6c
--- /dev/null
+++ b/sysutils/munin-main/pkg-install
@@ -0,0 +1,121 @@
+#! /bin/sh
+#
+# $Log$
+#
+
+ask() {
+ local question default answer
+
+ question=$1
+ default=$2
+ if [ -z "${PACKAGE_BUILDING}" ]; then
+ read -p "${question} [${default}]? " answer
+ fi
+ if [ x${answer} = x ]; then
+ answer=${default}
+ fi
+ echo ${answer}
+}
+
+yesno() {
+ local dflt question answer
+
+ question=$1
+ dflt=$2
+ while :; do
+ answer=$(ask "${question}" "${dflt}")
+ case "${answer}" in
+ [Yy]*) return 0;;
+ [Nn]*) return 1;;
+ esac
+ echo "Please answer yes or no."
+ done
+}
+
+make_account() {
+ local u g gcos
+
+ u=$1
+ g=$2
+ gcos=$3
+
+ if pw group show "${g}" >/dev/null 2>&1; then
+ echo "You already have a group \"${g}\", so I will use it."
+ else
+ echo "You need a group \"${g}\"."
+ if which -s pw && yesno "Would you like me to create it" y; then
+ pw groupadd ${g} || exit
+ echo "Done."
+ else
+ echo "Please create it, and try again."
+ if ! grep -q "^${u}:" /etc/passwd; then
+ echo "While you're at it, please create a user \"${u}\" too,"
+ echo "with a default group of \"${g}\"."
+ fi
+ exit 1
+ fi
+ fi
+
+ if pw user show "${u}" >/dev/null 2>&1; then
+ echo "You already have a user \"${u}\", so I will use it."
+ else
+ echo "You need a user \"${u}\"."
+ if which -s pw && yesno "Would you like me to create it" y; then
+ pw useradd ${u} -g ${g} -h - \
+ -s /bin/sh -c "${gcos}" || exit
+ echo "Done."
+ else
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+}
+
+make_directories() {
+ for dir in ${PKG_PREFIX}/www/data/munin \
+ ${PKG_PREFIX}/var/munin \
+ /var/run/munin; do
+ mkdir -p $dir
+ chown munin $dir
+ done
+}
+
+create_crontab_entries() {
+ local b e
+ b=$1
+ e=$2
+
+ if [ crontab -u munin -l > /dev/null 2>&1 ]; then
+ TMPFILE=`mktemp -t munin` || exit 1
+ sed -n -e "/^$b\$/,/^$e\$/p" > $TMPFILE
+ crontab -u munin -l | sed -e '/^#BEGIN_MUNIN$/,/^#END_MUNIN$/d' | \
+ cat - $TMPFILE | crontab -u munin -
+ rm $TMPFILE
+ else
+ crontab -u munin -
+ fi
+}
+
+
+########################################################################
+
+case $2 in
+ PRE-INSTALL)
+ make_account munin munin "Munin owner"
+ make_directories
+ ;;
+ POST-INSTALL)
+ create_crontab_entries '#BEGIN_MUNIN' '#END_MUNIN' <<EOT
+#
+# cron-jobs for munin
+#
+
+#BEGIN_MUNIN
+MAILTO=root
+
+*/5 * * * * ${PKG_PREFIX}/bin/munin-cron
+10 10 * * * ${DATADIR:=${PKG_PREFIX}/share/munin}/munin-nagios --removeok
+#END_MUNIN
+EOT
+ ;;
+esac
diff --git a/sysutils/munin-main/pkg-plist b/sysutils/munin-main/pkg-plist
new file mode 100644
index 000000000000..9097eed51f12
--- /dev/null
+++ b/sysutils/munin-main/pkg-plist
@@ -0,0 +1,17 @@
+bin/munin-cron
+etc/munin/munin.conf
+etc/munin/templates/logo.gif
+etc/munin/templates/munin-domainview.tmpl
+etc/munin/templates/munin-nodeview.tmpl
+etc/munin/templates/munin-overview.tmpl
+etc/munin/templates/munin-serviceview.tmpl
+etc/munin/templates/style.css
+share/munin/munin-graph
+share/munin/munin-html
+share/munin/munin-nagios
+share/munin/munin-update
+@unexec rmdir %D/www/data/munin 2>/dev/null || true
+@unexec rmdir %D/var/munin 2>/dev/null || true
+@unexec rmdir %D/share/munin 2>/dev/null || true
+@dirrm etc/munin/templates
+@unexec rmdir %D/etc/munin 2>/dev/null || true
diff --git a/sysutils/munin-master/Makefile b/sysutils/munin-master/Makefile
new file mode 100644
index 000000000000..e0a9104c0924
--- /dev/null
+++ b/sysutils/munin-master/Makefile
@@ -0,0 +1,58 @@
+# New ports collection makefile for: munin-main
+# Date created: 25 Januar 2004
+# Whom: Lupe Christoph <lupe@lupe-christoph.de>
+#
+# $FreeBSD$
+#
+
+PORTNAME= munin
+PORTVERSION= 1.0.0.p3
+CATEGORIES= sysutils perl5
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= munin
+PKGNAMESUFFIX= -main
+DISTNAME= munin_1.0.0pre3
+
+MAINTAINER= lupe@lupe-christoph.de
+COMMENT= Collector part of Munin
+
+BUILD_DEPENDS= ${RUN_DEPENDS}
+RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/RRDs.pm:${PORTSDIR}/net/rrdtool \
+ ${SITE_PERL}/Net/Domain.pm:${PORTSDIR}/net/p5-Net \
+ ${SITE_PERL}/HTML/Template.pm:${PORTSDIR}/www/p5-HTML-Template
+
+.include <bsd.port.pre.mk>
+
+.if ${PERL_LEVEL} <= 500800
+RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/Storable.pm:${PORTSDIR}/devel/p5-Storable \
+ ${SITE_PERL}/${PERL_ARCH}/Digest/MD5.pm:${PORTSDIR}/security/p5-Digest-MD5 \
+ ${SITE_PERL}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes
+.endif
+
+USE_GMAKE= yes
+PATCH_STRIP= -p1
+WRKSRC= ${WRKDIR}/munin-1.0.0pre3
+PKGMESSAGE= ${WRKDIR}/pkg-message
+ALL_TARGET= DATADIR=${DATADIR} build build-man
+INSTALL_TARGET= DATADIR=${DATADIR} install-main
+
+MAN5= munin.conf.5
+MAN8= munin-cron.8 munin-graph.8 munin-html.8 munin-nagios.8 munin-update.8
+
+pre-install:
+ @${SED} 's@%%PREFIX%%@${PREFIX}@g' ${FILESDIR}/pkg-message > ${PKGMESSAGE}
+ @PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
+
+post-install:
+ @${INSTALL_MAN} -d ${PREFIX}/man/man5
+ @${INSTALL_MAN} -d ${PREFIX}/man/man8
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin.conf.5 ${PREFIX}/man/man5
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-cron.8 ${PREFIX}/man/man8
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-graph.8 ${PREFIX}/man/man8
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-html.8 ${PREFIX}/man/man8
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-nagios.8 ${PREFIX}/man/man8
+ @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-update.8 ${PREFIX}/man/man8
+ @DATADIR=${DATADIR} PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} POST-INSTALL
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.post.mk>
diff --git a/sysutils/munin-master/distinfo b/sysutils/munin-master/distinfo
new file mode 100644
index 000000000000..33d0172cbc07
--- /dev/null
+++ b/sysutils/munin-master/distinfo
@@ -0,0 +1,2 @@
+MD5 (munin_1.0.0pre3.tar.gz) = f1aea51a61304b824dd61d7ad7808f6d
+SIZE (munin_1.0.0pre3.tar.gz) = 120572
diff --git a/sysutils/munin-master/files/patch-Makefile.config b/sysutils/munin-master/files/patch-Makefile.config
new file mode 100644
index 000000000000..7e1b893d6f0f
--- /dev/null
+++ b/sysutils/munin-master/files/patch-Makefile.config
@@ -0,0 +1,72 @@
+--- munin-1.0.0pre3.orig/Makefile.config Sun Feb 1 22:05:52 2004
++++ munin-1.0.0pre3/Makefile.config Sat Feb 7 12:48:23 2004
+@@ -7,42 +7,46 @@
+ #
+ # the base of the Munin installation.
+ #
+-PREFIX = $(DESTDIR)/opt/munin
++ifdef PREFIX
++UPREFIX=$(PREFIX)
++else
++UPREFIX=/usr
++endif
+
+ # Where Munin keeps its configurations (server.conf, client.conf, ++)
+-CONFDIR = $(DESTDIR)/etc/opt/munin
++CONFDIR = $(PREFIX)/etc/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)/doc
+
+ # Where to put man pages
+-MANDIR = $(PREFIX)/man
++MANDIR = $(UPREFIX)/man
+
+ # Where to put internal binaries and plugin repository
+-LIBDIR = $(PREFIX)/lib
++LIBDIR = ${DATADIR}
+
+ # Server only - Output directory
+-HTMLDIR = $(PREFIX)/var/www
++HTMLDIR = $(PREFIX)/www/data/munin
+
+ # Client only - Where to put RRD files and other intenal data
+-DBDIR = $(DESTDIR)/var/opt/munin
++DBDIR = $(PREFIX)/var/munin
+
+ # Client only - Where plugins should put their states. Must be writable by
+ # group "munin", and should be preserved between reboots
+ PLUGSTATE = $(DBDIR)/plugin-state
+
+ # Where Munin should place its logs.
+-LOGDIR = $(DESTDIR)/var/log/munin
++LOGDIR = /var/log
+
+ # Location of PID files and other statefiles. On the server, must be
+ # writable by the user "munin".
+-STATEDIR = $(DESTDIR)/var/run/munin
++STATEDIR = /var/run/munin
+
+ # The perl interpreter to use
+ PERL = $(shell which perl)
+@@ -65,9 +69,8 @@
+ GROUP = munin
+
+ # Which command to use to check if the USER and GROUP to run Munin as, exists.
+-GETENT = $(shell which getent || which true 2>/dev/null)
+-CHECKUSER = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
+-CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
++CHECKUSER:= $(shell grep $(USER) /etc/passwd >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
++CHECKGROUP:= $(shell grep $(GROUP) /etc/group >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
+
+ CHOWN = chown
+ CHMOD = chmod
diff --git a/sysutils/munin-master/files/pkg-message b/sysutils/munin-master/files/pkg-message
new file mode 100644
index 000000000000..2d56e5464b2f
--- /dev/null
+++ b/sysutils/munin-master/files/pkg-message
@@ -0,0 +1,10 @@
+
+********************************************************************
+Unless this file already existed, a sample configuration file
+has been placed in %%PREFIX%%/etc/munin/munin.conf.
+
+Please edit it according to your needs.
+
+The Munin server will be run from cron under the user 'munin'.
+********************************************************************
+
diff --git a/sysutils/munin-master/pkg-deinstall b/sysutils/munin-master/pkg-deinstall
new file mode 100644
index 000000000000..261b7b15a8b3
--- /dev/null
+++ b/sysutils/munin-master/pkg-deinstall
@@ -0,0 +1,96 @@
+#! /bin/sh
+#
+# $Log$
+#
+
+ask() {
+ local question default answer
+
+ question=$1
+ default=$2
+ if [ -z "${PACKAGE_BUILDING}" ]; then
+ read -p "${question} [${default}]? " answer
+ fi
+ if [ x${answer} = x ]; then
+ answer=${default}
+ fi
+ echo ${answer}
+}
+
+yesno() {
+ local dflt question answer
+
+ question=$1
+ dflt=$2
+ while :; do
+ answer=$(ask "${question}" "${dflt}")
+ case "${answer}" in
+ [Yy]*) return 0;;
+ [Nn]*) return 1;;
+ esac
+ echo "Please answer yes or no."
+ done
+}
+
+delete_account() {
+ local u g home
+
+ u=$1
+ g=$2
+ if pw group show ${g} > /dev/null 2>&1; then
+ if yesno "Do you want me to remove group \"${g}\"" y; then
+ pw group del -n ${g}
+ echo "Done."
+ else
+ GID=`pw group show ${g} | awk -F: '{ print $3 }'`
+ fi
+ fi
+ if pw user show ${u} > /dev/null 2>&1; then
+ if yesno "Do you want me to remove user \"${u}\"" y; then
+ eval home=~${u}
+ pw user del -n ${u} -r
+ echo "Done."
+ if [ -d "${home}" ]; then
+ echo "Please remember to remove the home directory \"${home}\""
+ fi
+
+ # pw user del may have removed the group, too.
+ # Put it back if the admin asked us to retain it.
+ if [ -n "$GID" ]; then
+ pw group show ${g} > /dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ pw group add ${g}
+ fi
+ fi
+ fi
+ fi
+}
+
+delete_crontab_entries() {
+ local b e
+ b=$1
+ e=$2
+
+ TMPFILE=`mktemp -t munin` || exit 1
+ crontab -u munin -l | sed -e "/^$b\$/,/^$e\$/d" -e '/^[ ]*#/d' -e '/^$/d' > $TMPFILE
+ if [ -s $TMPFILE ]; then
+ crontab -u munin -l | sed -e "/^$b\$/,/^$e\$/d" | crontab -u munin -
+ echo "The crontab for user munin had manually created entries."
+ echo "Only the automatically created entries have been removed."
+ echo "These are the remaining lines:"
+ crontab -u munin -l
+ else
+ crontab -u munin -r
+ echo "crontab for user munin removed"
+ fi
+ rm $TMPFILE
+}
+
+case $2 in
+ DEINSTALL)
+ delete_crontab_entries '#BEGIN_MUNIN' '#END_MUNIN'
+ ;;
+ POST-DEINSTALL)
+ delete_account munin munin
+ ;;
+esac
diff --git a/sysutils/munin-master/pkg-descr b/sysutils/munin-master/pkg-descr
new file mode 100644
index 000000000000..69168aa584ca
--- /dev/null
+++ b/sysutils/munin-master/pkg-descr
@@ -0,0 +1,14 @@
+Munin network-wide graphing framework (node)
+
+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 have been ease
+of creating own "plugins" (graphs).
+
+This is the collector. It is installed on the machine that shall collect
+and display perfromance data.
+
+WWW: http://www.linpro.no/projects/munin/
diff --git a/sysutils/munin-master/pkg-install b/sysutils/munin-master/pkg-install
new file mode 100644
index 000000000000..4f1614bfbf6c
--- /dev/null
+++ b/sysutils/munin-master/pkg-install
@@ -0,0 +1,121 @@
+#! /bin/sh
+#
+# $Log$
+#
+
+ask() {
+ local question default answer
+
+ question=$1
+ default=$2
+ if [ -z "${PACKAGE_BUILDING}" ]; then
+ read -p "${question} [${default}]? " answer
+ fi
+ if [ x${answer} = x ]; then
+ answer=${default}
+ fi
+ echo ${answer}
+}
+
+yesno() {
+ local dflt question answer
+
+ question=$1
+ dflt=$2
+ while :; do
+ answer=$(ask "${question}" "${dflt}")
+ case "${answer}" in
+ [Yy]*) return 0;;
+ [Nn]*) return 1;;
+ esac
+ echo "Please answer yes or no."
+ done
+}
+
+make_account() {
+ local u g gcos
+
+ u=$1
+ g=$2
+ gcos=$3
+
+ if pw group show "${g}" >/dev/null 2>&1; then
+ echo "You already have a group \"${g}\", so I will use it."
+ else
+ echo "You need a group \"${g}\"."
+ if which -s pw && yesno "Would you like me to create it" y; then
+ pw groupadd ${g} || exit
+ echo "Done."
+ else
+ echo "Please create it, and try again."
+ if ! grep -q "^${u}:" /etc/passwd; then
+ echo "While you're at it, please create a user \"${u}\" too,"
+ echo "with a default group of \"${g}\"."
+ fi
+ exit 1
+ fi
+ fi
+
+ if pw user show "${u}" >/dev/null 2>&1; then
+ echo "You already have a user \"${u}\", so I will use it."
+ else
+ echo "You need a user \"${u}\"."
+ if which -s pw && yesno "Would you like me to create it" y; then
+ pw useradd ${u} -g ${g} -h - \
+ -s /bin/sh -c "${gcos}" || exit
+ echo "Done."
+ else
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+}
+
+make_directories() {
+ for dir in ${PKG_PREFIX}/www/data/munin \
+ ${PKG_PREFIX}/var/munin \
+ /var/run/munin; do
+ mkdir -p $dir
+ chown munin $dir
+ done
+}
+
+create_crontab_entries() {
+ local b e
+ b=$1
+ e=$2
+
+ if [ crontab -u munin -l > /dev/null 2>&1 ]; then
+ TMPFILE=`mktemp -t munin` || exit 1
+ sed -n -e "/^$b\$/,/^$e\$/p" > $TMPFILE
+ crontab -u munin -l | sed -e '/^#BEGIN_MUNIN$/,/^#END_MUNIN$/d' | \
+ cat - $TMPFILE | crontab -u munin -
+ rm $TMPFILE
+ else
+ crontab -u munin -
+ fi
+}
+
+
+########################################################################
+
+case $2 in
+ PRE-INSTALL)
+ make_account munin munin "Munin owner"
+ make_directories
+ ;;
+ POST-INSTALL)
+ create_crontab_entries '#BEGIN_MUNIN' '#END_MUNIN' <<EOT
+#
+# cron-jobs for munin
+#
+
+#BEGIN_MUNIN
+MAILTO=root
+
+*/5 * * * * ${PKG_PREFIX}/bin/munin-cron
+10 10 * * * ${DATADIR:=${PKG_PREFIX}/share/munin}/munin-nagios --removeok
+#END_MUNIN
+EOT
+ ;;
+esac
diff --git a/sysutils/munin-master/pkg-plist b/sysutils/munin-master/pkg-plist
new file mode 100644
index 000000000000..9097eed51f12
--- /dev/null
+++ b/sysutils/munin-master/pkg-plist
@@ -0,0 +1,17 @@
+bin/munin-cron
+etc/munin/munin.conf
+etc/munin/templates/logo.gif
+etc/munin/templates/munin-domainview.tmpl
+etc/munin/templates/munin-nodeview.tmpl
+etc/munin/templates/munin-overview.tmpl
+etc/munin/templates/munin-serviceview.tmpl
+etc/munin/templates/style.css
+share/munin/munin-graph
+share/munin/munin-html
+share/munin/munin-nagios
+share/munin/munin-update
+@unexec rmdir %D/www/data/munin 2>/dev/null || true
+@unexec rmdir %D/var/munin 2>/dev/null || true
+@unexec rmdir %D/share/munin 2>/dev/null || true
+@dirrm etc/munin/templates
+@unexec rmdir %D/etc/munin 2>/dev/null || true