pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/sysutils/munin-node Use PKG_SYSCONFSUBDIR so PKG_SYSCO...
details: https://anonhg.NetBSD.org/pkgsrc/rev/a2c25bdb71ea
branches: trunk
changeset: 516496:a2c25bdb71ea
user: abs <abs%pkgsrc.org@localhost>
date: Fri Jul 21 23:28:37 2006 +0000
description:
Use PKG_SYSCONFSUBDIR so PKG_SYSCONFBASE can be set
Use REPLACE_PERL on all plugins
Adjust sensors_ to work with NetBSD 3
Bump PKGREVISION
diffstat:
sysutils/munin-node/Makefile | 9 +-
sysutils/munin-node/distinfo | 5 +-
sysutils/munin-node/files/munin-node.sh | 4 +-
sysutils/munin-node/files/node/node.d.netbsd/sensors_.in | 122 ++++++--------
sysutils/munin-node/patches/patch-aa | 6 +-
sysutils/munin-node/patches/patch-ae | 15 +
6 files changed, 79 insertions(+), 82 deletions(-)
diffs (281 lines):
diff -r 1ef1dbd1febb -r a2c25bdb71ea sysutils/munin-node/Makefile
--- a/sysutils/munin-node/Makefile Fri Jul 21 23:21:20 2006 +0000
+++ b/sysutils/munin-node/Makefile Fri Jul 21 23:28:37 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2006/07/07 22:10:07 jlam Exp $
+# $NetBSD: Makefile,v 1.7 2006/07/21 23:28:37 abs Exp $
#
DISTNAME= munin_${VER}
@@ -6,7 +6,7 @@
PKGNAME= munin-node-${VER}
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=munin/}
-PKGREVISION= 3
+PKGREVISION= 4
MAINTAINER= pkgsrc-users%NetBSD.org@localhost
HOMEPAGE= http://munin.sourceforge.net/
@@ -27,6 +27,8 @@
PKG_GROUPS= ${MUNIN_GROUP}
PKG_USERS= ${MUNIN_USER}:${MUNIN_GROUP}::Munin\\ user
+PKG_SYSCONFSUBDIR?= munin
+REPLACE_PERL+= node/node.d/*.in
STATEDIR?= ${VARBASE}/munin/plugin-state
MUNIN_RUN?= ${VARBASE}/run/munin
@@ -51,6 +53,7 @@
BUILD_TARGET= build
#MAKE_ENV+= PERL5_SITELIB=${PERL5_SITELIB}
+MAKE_ENV+= CONFDIR=${PKG_SYSCONFDIR}
MAKE_ENV+= MUNIN_USER=${MUNIN_USER}
MAKE_ENV+= MUNIN_GROUP=${MUNIN_GROUP}
MAKE_ENV+= PERL5=${PERL5:Q}
@@ -68,7 +71,7 @@
EGDIR= ${PREFIX}/share/examples/munin
-CONF_FILES+= ${EGDIR}/munin-node.conf ${PKG_SYSCONFDIR}/munin/munin-node.conf
+CONF_FILES+= ${EGDIR}/munin-node.conf ${PKG_SYSCONFDIR}/munin-node.conf
pre-configure:
diff -r 1ef1dbd1febb -r a2c25bdb71ea sysutils/munin-node/distinfo
--- a/sysutils/munin-node/distinfo Fri Jul 21 23:21:20 2006 +0000
+++ b/sysutils/munin-node/distinfo Fri Jul 21 23:28:37 2006 +0000
@@ -1,9 +1,10 @@
-$NetBSD: distinfo,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
+$NetBSD: distinfo,v 1.2 2006/07/21 23:28:37 abs Exp $
SHA1 (munin_1.3.1.tar.gz) = f7783b645abbb25524c3f1b6e0fe27185f1de3db
RMD160 (munin_1.3.1.tar.gz) = a6ea4e1839f4c787457e4051d55007b7bcebd1d4
Size (munin_1.3.1.tar.gz) = 315743 bytes
-SHA1 (patch-aa) = f4c75a11a5fa026d968a2685f55061c74f51e537
+SHA1 (patch-aa) = df9b128721166912c086a54b29b7971a00581ea0
SHA1 (patch-ab) = bb0f63cdef893d8c224cdd03a4a4125d03f85f80
SHA1 (patch-ac) = 9ef503b4d20f65e990c332c7789188a6fbad618e
SHA1 (patch-ad) = 8accd3875324035f2c95903fc37cee4b4a55948a
+SHA1 (patch-ae) = 63b6acf126bc8baaed0ff429cfa0fa63945e5915
diff -r 1ef1dbd1febb -r a2c25bdb71ea sysutils/munin-node/files/munin-node.sh
--- a/sysutils/munin-node/files/munin-node.sh Fri Jul 21 23:21:20 2006 +0000
+++ b/sysutils/munin-node/files/munin-node.sh Fri Jul 21 23:28:37 2006 +0000
@@ -1,6 +1,6 @@
#! /bin/sh
#
-# $NetBSD: munin-node.sh,v 1.2 2006/06/27 13:05:49 he Exp $
+# $NetBSD: munin-node.sh,v 1.3 2006/07/21 23:28:37 abs Exp $
#
# PROVIDE: munin-node
# REQUIRE: DAEMON
@@ -20,7 +20,7 @@
rcvar=$name
command=@PREFIX@/sbin/munin-node
command_interpreter=@PERL@
-required_files=@PKG_SYSCONFDIR@/munin/munin-node.conf
+required_files=@PKG_SYSCONFDIR@/munin-node.conf
if [ ! -d @STATEDIR@ ]; then
mkdir @STATEDIR@
diff -r 1ef1dbd1febb -r a2c25bdb71ea sysutils/munin-node/files/node/node.d.netbsd/sensors_.in
--- a/sysutils/munin-node/files/node/node.d.netbsd/sensors_.in Fri Jul 21 23:21:20 2006 +0000
+++ b/sysutils/munin-node/files/node/node.d.netbsd/sensors_.in Fri Jul 21 23:28:37 2006 +0000
@@ -14,6 +14,12 @@
# suggest
#
# $Log: sensors_.in,v $
+# Revision 1.2 2006/07/21 23:28:37 abs
+# Use PKG_SYSCONFSUBDIR so PKG_SYSCONFBASE can be set
+# Use REPLACE_PERL on all plugins
+# Adjust sensors_ to work with NetBSD 3
+# Bump PKGREVISION
+#
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
@@ -65,18 +71,14 @@
exit 0
fi
-
-if [ "$1" = "config" ]; then
- case $0 in
- sensors_temp)
- echo 'graph_title Fans'
- echo 'graph_vtitle RPM'
- echo 'graph_args --base 1000 -l 0'
- /usr/sbin/envstat -r | awk '
+envstat_config()
+{
+ /usr/sbin/envstat -r | awk -v "lookfor=$1" -F: '
BEGIN { p=0 }
-/degC$/ {
- gsub(":", "", $1);
- print "temp." $1 ".label " $1;
+match($0, lookfor "$") {
+ l=$1
+ gsub("[^A-Za-z0-9\\-]", "", $1);
+ print tolower(lookfor) "_" tolower($1) ".label " l;
p=1;
}
END {
@@ -84,52 +86,43 @@
exit 1;
}
}'
- if [ $? != 0 ]; then
- echo 'No temperature sensors found' >&2
- exit 1
- fi
- ;;
- sensors_fans)
+ if [ $? != 0 ]; then
+ echo "No $1 sensors found" >&2
+ exit 1
+ fi
+}
+
+envstat_value()
+{
+ /usr/sbin/envstat -r | awk -v "lookfor=$1" -F: '
+match($0, lookfor "$") {
+ gsub("[^A-Za-z0-9\\-]", "", $1);
+ sub(" *", "", $2);
+ sub(" .*", "", $2);
+ print tolower(lookfor) "_" tolower($1) ".value " $2;
+}
+'
+}
+
+if [ "$1" = "config" ]; then
+ case $0 in
+ *sensors_temp)
echo 'graph_title Temperatures'
echo 'graph_vtitle deg Celcius'
echo 'graph_args --base 1000 -l 0'
- /usr/sbin/envstat -r | awk '
-BEGIN { p=0 }
-/RPM$/ {
- gsub(":", "", $1);
- print "fans." $1 ".label " $1;
- p=1;
-}
-END {
- if (!p) {
- exit 1;
- }
-}'
- if [ $? != 0 ]; then
- echo 'No fan sensors found' >&2
- exit 1
- fi
+ envstat_config degC
;;
- sensors_volt)
+ *sensors_fans)
+ echo 'graph_title Fans'
+ echo 'graph_vtitle RPM'
+ echo 'graph_args --base 1000 -l 0'
+ envstat_config RPM
+ ;;
+ *sensors_volt)
echo 'graph_title Voltages'
echo 'graph_vtitle Volt'
echo 'graph_args --base 1000 --logarithmic'
- /usr/sbin/envstat -r | awk '
-BEGIN { p=0 }
-/V$/ {
- gsub(":", "", $1);
- print "volt." $1 ".label " $1;
- p=1;
-}
-END {
- if (!p) {
- exit 1;
- }
-}'
- if [ $? != 0 ]; then
- echo 'No voltage sensors found' >&2
- exit 1
- fi
+ envstat_config V
;;
esac
echo 'graph_category sensors'
@@ -139,28 +132,13 @@
case $0 in
- sensors_temp)
- /usr/sbin/envstat -r | awk '
-/degC$/ {
- gsub(":", "", $1);
- print "temp." $1 ".value " $2;
-}
-'
+ *sensors_temp)
+ envstat_value degC
;;
- sensors_fans)
- /usr/sbin/envstat -r | awk '
-/RPM$/ {
- gsub(":", "", $1);
- print "fans." $1 ".value " $2;
-}
-'
+ *sensors_fans)
+ envstat_value RPM
;;
- sensors_volt)
-/usr/sbin/envstat -r | awk '
-/V$/ {
- gsub(":", "", $1);
- print "volt." $1 ".value " $2;
-}
-'
- ;;
+ *sensors_volt)
+ envstat_value V
+ ;;
esac
diff -r 1ef1dbd1febb -r a2c25bdb71ea sysutils/munin-node/patches/patch-aa
--- a/sysutils/munin-node/patches/patch-aa Fri Jul 21 23:21:20 2006 +0000
+++ b/sysutils/munin-node/patches/patch-aa Fri Jul 21 23:28:37 2006 +0000
@@ -1,6 +1,6 @@
-$NetBSD: patch-aa,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
+$NetBSD: patch-aa,v 1.2 2006/07/21 23:28:37 abs Exp $
---- Makefile.config.orig 2005-01-10 11:38:22.000000000 +0100
+--- Makefile.config.orig 2005-01-10 10:38:22.000000000 +0000
+++ Makefile.config
@@ -7,32 +7,36 @@
#
@@ -15,7 +15,7 @@
# Where Munin keeps its configurations (server.conf, client.conf, ++)
-CONFDIR = $(DESTDIR)/etc/opt/munin
-+CONFDIR = $(UPREFIX)/etc/munin
++CONFDIR ?= $(UPREFIX)/etc/munin
# Server only - where to put munin-cron
-BINDIR = $(PREFIX)/bin
diff -r 1ef1dbd1febb -r a2c25bdb71ea sysutils/munin-node/patches/patch-ae
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/munin-node/patches/patch-ae Fri Jul 21 23:28:37 2006 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-ae,v 1.1 2006/07/21 23:28:37 abs Exp $
+
+--- node/node.d/hddtemp_smartctl.in.orig 2005-01-29 22:14:02.000000000 +0000
++++ node/node.d/hddtemp_smartctl.in
+@@ -93,6 +93,10 @@ if ($^O eq 'linux') {
+ }
+ } elsif ($^O eq 'solaris') {
+ @drives = map { s@.*/@@ } glob '/dev/rdsk/c*t*d*s2';
++} elsif ($^O eq 'netbsd') {
++ my $rawpart = chr(`sysctl -n kern.rawpartition` + 97); # 'c' or 'd'
++ @drives = map { $_ . $rawpart } grep { /^wd/ } split ' ',
++ `sysctl -n hw.disknames`;
+ }
+
+ @drives = split ' ', $ENV{drives} if exists $ENV{drives};
Home |
Main Index |
Thread Index |
Old Index