ports/74166: Update port: sysutils/munin-node 1.0.3 -> 1.0.4

Lupe Christoph lupe at lupe-christoph.de
Sat Nov 20 16:20:31 UTC 2004


>Number:         74166
>Category:       ports
>Synopsis:       Update port: sysutils/munin-node 1.0.3 -> 1.0.4
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 20 16:20:31 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Lupe Christoph
>Release:        FreeBSD 5.3-RELEASE i386
>Organization:
>Environment:
System: FreeBSD vmw-freebsd5.lupe-christoph.de 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Sun Nov 7 16:52:12 CET 2004 lupe at vmw-freebsd5.lupe-christoph.de:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:
	Update to support Munin 1.0.4.
	Prevent breakage my FreeBSD 5.3 ports make system (NOPRECIOUSMAKEVARS=yes).
	Support FreeBSD 5 rc system in addition to old system.
	Remove unchanged config files on deinstall as suggested by Yen-Ming Lee.
	Cosmetic changes to pkg.plist while I'm at it anyway.
	Patch Munin plugins to support FreeBSD > 5.
		(To be removed after integration into Munin.)

	Files changed:
		Makefile
		distinfo
		files/munin-node.sh
		files/pkg-message
		pkg-deinstall
		pkg-plist
	Files added:
		files/munin_node.sh
		files/patch-cpu.in
		files/patch-vmstat.in
		files/pkg-message.4
>How-To-Repeat:
	
>Fix:

	

--- munin-node-1.0.4.patch begins here ---
diff -ruN ports/sysutils/munin-node-1.0.3/Makefile ports/sysutils/munin-node/Makefile
--- ports/sysutils/munin-node-1.0.3/Makefile	Tue Nov 16 16:16:37 2004
+++ ports/sysutils/munin-node/Makefile	Sat Nov 20 13:48:04 2004
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	munin
-PORTVERSION=	1.0.3
+PORTVERSION=	1.0.4
 CATEGORIES=	sysutils perl5
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	munin
@@ -32,17 +32,30 @@
 ALL_TARGET=	DATADIR=${DATADIR} build build-man
 INSTALL_TARGET=	DATADIR=${DATADIR} install-node install-node-plugins
 MAKE_ENV=	LANG=C
+NOPRECIOUSMAKEVARS=yes
 
 MAN5=		munin-node.conf.5
 MAN8=		munin-node-configure.8 munin-node.8 munin-run.8
 
+.if ${OSVERSION} < 500000
+PKGMSG=${FILESDIR}/pkg-message.4
+STARTSTOP_SRC=${FILESDIR}/munin-node.sh
+STARTSTOP_DST=${PREFIX}/etc/rc.d/munin-node.sh
+.else
+PKGMSG=${FILESDIR}/pkg-message
+STARTSTOP_SRC=${FILESDIR}/munin_node.sh
+STARTSTOP_DST=/etc/rc.d/munin_node
+.endif
+
 pre-install:
-	@${SED} 's@%%PREFIX%%@${PREFIX}@g' ${FILESDIR}/pkg-message > ${PKGMESSAGE}
+	@${SED} 's@%%PREFIX%%@${PREFIX}@g' ${PKGMSG} > ${PKGMESSAGE}
 	@PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
 
 post-install:
-	@${SED} 's@%PREFIX%@${LOCALBASE}@g' ${FILESDIR}/munin-node.sh > ${PREFIX}/etc/rc.d/munin-node.sh
-	@${CHMOD} +x ${PREFIX}/etc/rc.d/munin-node.sh
+	@${SED} 's@%PREFIX%@${LOCALBASE}@g' ${STARTSTOP_SRC} > ${STARTSTOP_DST}
+	@${CHMOD} +x ${STARTSTOP_DST}
+	${INSTALL_DATA} ${WRKSRC}/build/node/munin-node.conf ${PREFIX}/etc/munin/munin-node.conf.sample
+	${INSTALL_DATA} ${WRKSRC}/plugins.conf ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf.sample
 	@if [ ! -f ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf ]; then \
 		${INSTALL_DATA} ${WRKSRC}/plugins.conf ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf; \
 	fi
diff -ruN ports/sysutils/munin-node-1.0.3/distinfo ports/sysutils/munin-node/distinfo
--- ports/sysutils/munin-node-1.0.3/distinfo	Thu Nov 18 06:56:53 2004
+++ ports/sysutils/munin-node/distinfo	Thu Nov 18 07:42:44 2004
@@ -1,2 +1,2 @@
-MD5 (munin_1.0.3.tar.gz) = 8114e4d716e0ec7ac70357a697af28cf
-SIZE (munin_1.0.3.tar.gz) = 214362
+MD5 (munin_1.0.4.tar.gz) = 00721181e1ff81be85ad89307457d998
+SIZE (munin_1.0.4.tar.gz) = 214902
diff -ruN ports/sysutils/munin-node-1.0.3/files/munin-node.sh ports/sysutils/munin-node/files/munin-node.sh
--- ports/sysutils/munin-node-1.0.3/files/munin-node.sh	Tue Mar  2 16:54:05 2004
+++ ports/sysutils/munin-node/files/munin-node.sh	Fri Nov 19 08:23:38 2004
@@ -14,7 +14,13 @@
 		if [ -f $CONFIG ]; then
 			PIDFILE=`awk '$1 == "pid_file" { print $2 }' $CONFIG`
 			if [ -f $PIDFILE ]; then
-				/bin/kill `cat $PIDFILE` && echo -n ' munin-node'
+				PID=`cat $PIDFILE`
+				CMD=`ps -xa -o command -p $PID | sed 1d`
+				case "$CMD" in
+				*munin-node*)
+					/bin/kill $PID && echo -n ' munin-node'
+					;;
+				esac
 			fi
 		fi
 	;;
diff -ruN ports/sysutils/munin-node-1.0.3/files/munin_node.sh ports/sysutils/munin-node/files/munin_node.sh
--- ports/sysutils/munin-node-1.0.3/files/munin_node.sh	Thu Jan  1 01:00:00 1970
+++ ports/sysutils/munin-node/files/munin_node.sh	Sat Nov 20 12:18:37 2004
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+
+# PROVIDE: munin-node
+# REQUIRE: DAEMON
+# BEFORE:  cron
+# KEYWORD: FreeBSD
+
+#
+# Add the following lines to /etc/rc.conf to enable munin-node:
+# munin_node_enable (bool):      Set to "NO" by default.
+#                                Set it to "YES" to enable munin-node
+# munin_node_config (path):      Set to "%PREFIX%/etc/munin/munin-node.conf" by default.
+#
+
+. /etc/rc.subr
+
+name="munin_node"
+rcvar=`set_rcvar`
+
+[ -z "$munin_node_enable" ] && munin_node_enable="NO"
+[ -z "$munin_node_config" ] && munin_node_config="/usr/local/etc/munin/munin-node.conf"
+
+command="/usr/local/sbin/munin-node"
+pidfile=`awk '$1 == "pid_file" { print $2 }' $munin_node_config`
+
+load_rc_config $name
+run_rc_command "$1"
diff -ruN ports/sysutils/munin-node-1.0.3/files/patch-cpu.in ports/sysutils/munin-node/files/patch-cpu.in
--- ports/sysutils/munin-node-1.0.3/files/patch-cpu.in	Thu Jan  1 01:00:00 1970
+++ ports/sysutils/munin-node/files/patch-cpu.in	Sat Nov 20 15:33:32 2004
@@ -0,0 +1,15 @@
+--- munin-1.0.4.orig/node/node.d.freebsd/cpu.in	Sun May  9 21:18:35 2004
++++ munin-1.0.4/node/node.d.freebsd/cpu.in	Sat Nov 20 15:32:50 2004
+@@ -59,10 +59,10 @@
+ 	OSV=`/sbin/sysctl -n kern.osrelease | cut -f1 -d.`
+ 	if [ "$OSV" = "4" ]; then
+ 		STATUNITS=`/sbin/sysctl -n kern.clockrate | cut -f16 -d' '`
+-	elif [ "$OSV" = "5" ]; then
++	elif [ "$OSV" -ge "5" ]; then
+ 		STATUNITS=`/sbin/sysctl -n kern.clockrate | cut -f13 -d' '`
+ 	fi
+-#	PERCENT=`/sbin/sysctl -n hw.ncpu | awk '{print ($1)*100}'`
++	PERCENT=`/sbin/sysctl -n hw.ncpu | awk '{print ($1)*100}'`
+ 	SCALE=`echo 'scale=5;' $PERCENT/$STATUNITS | bc -q `
+ 	NCPU=`/sbin/sysctl -n hw.ncpu`
+ 	if [ "$scaleto100" = yes ]; then
diff -ruN ports/sysutils/munin-node-1.0.3/files/patch-vmstat.in ports/sysutils/munin-node/files/patch-vmstat.in
--- ports/sysutils/munin-node-1.0.3/files/patch-vmstat.in	Thu Jan  1 01:00:00 1970
+++ ports/sysutils/munin-node/files/patch-vmstat.in	Sat Nov 20 14:16:59 2004
@@ -0,0 +1,29 @@
+--- munin-1.0.4.orig/node/node.d.freebsd/vmstat.in	Sun Feb  1 19:59:54 2004
++++ munin-1.0.4/node/node.d.freebsd/vmstat.in	Sat Nov 20 14:14:54 2004
+@@ -32,7 +32,7 @@
+ OSV=`/sbin/sysctl -n kern.osrelease | cut -f1 -d.`
+ 
+ if [ "$1" = "autoconf" ]; then
+-	if [ "$OSV" = "5" ]; then
++	if [ "$OSV" -ge "5" ]; then
+ 		/sbin/sysctl -n vm.vmtotal 2>/dev/null >/dev/null
+ 		RESULT=$?
+ 		NAME=/sbin/sysctl
+@@ -59,7 +59,7 @@
+ 	echo 'graph_title VMstat'
+ 	echo 'graph_args --base 1000 -l 0'
+ 	echo 'graph_vlabel process states'
+-	if [ "$OSV" = "5" ]; then
++	if [ "$OSV" -ge "5" ]; then
+ 		echo 'running.label running'
+ 		echo 'running.type GAUGE'
+ 		echo 'diskwait.label diskwait'
+@@ -77,7 +77,7 @@
+ 	exit 0
+ fi
+ 
+-if [ "$OSV" = "5" ]; then
++if [ "$OSV" -ge "5" ]; then
+ 	sysctl -n vm.vmtotal | awk '
+ /^Processes:/ {
+ 	print "running.value", $3;
diff -ruN ports/sysutils/munin-node-1.0.3/files/pkg-message ports/sysutils/munin-node/files/pkg-message
--- ports/sysutils/munin-node-1.0.3/files/pkg-message	Tue Mar  2 16:54:05 2004
+++ ports/sysutils/munin-node/files/pkg-message	Sat Nov 20 12:24:45 2004
@@ -5,8 +5,16 @@
 
 Please edit it according to your needs.
 
-The Munin client will be started at system boot automatically.
-You can start it manually with:
-    %%PREFIX%%/etc/rc.d/munin-node.sh start
+********************************************************************
+
+The Munin client will *not* be started automatically. To allow it
+to start, put this line in /etc/rc.conf:
+
+munin_node_enable="YES"
+
+Then, it will be started on the next boot. To start it now, use
+this command:
+
+    /etc/rc.d/munin_node start
 ********************************************************************
 
diff -ruN ports/sysutils/munin-node-1.0.3/files/pkg-message.4 ports/sysutils/munin-node/files/pkg-message.4
--- ports/sysutils/munin-node-1.0.3/files/pkg-message.4	Thu Jan  1 01:00:00 1970
+++ ports/sysutils/munin-node/files/pkg-message.4	Tue Mar  2 16:54:05 2004
@@ -0,0 +1,12 @@
+
+********************************************************************
+Unless this file already existed, a sample configuration file
+has been placed in %%PREFIX%%/etc/munin/munin-node.conf.
+
+Please edit it according to your needs.
+
+The Munin client will be started at system boot automatically.
+You can start it manually with:
+    %%PREFIX%%/etc/rc.d/munin-node.sh start
+********************************************************************
+
diff -ruN ports/sysutils/munin-node-1.0.3/pkg-deinstall ports/sysutils/munin-node/pkg-deinstall
--- ports/sysutils/munin-node-1.0.3/pkg-deinstall	Tue Mar  2 16:54:05 2004
+++ ports/sysutils/munin-node/pkg-deinstall	Sat Nov 20 13:49:49 2004
@@ -36,8 +36,8 @@
 }
 
 stop_process() {
-    if [ -x ${PKG_PREFIX}/etc/rc.d/munin-node.sh ]; then
-	${PKG_PREFIX}/etc/rc.d/munin-node.sh stop
+    if [ -x $STARTSTOP ]; then
+	$STARTSTOP stop
     fi
 }
 
@@ -51,9 +51,17 @@
     fi
 }
 
+OSVERSION=`/sbin/sysctl -n kern.osreldate`
+if [ $OSVERSION -lt 500000 ]; then
+    STARTSTOP=${PKG_PREFIX}/etc/rc.d/munin-node.sh
+else
+    STARTSTOP=/etc/rc.d/munin_node
+fi
+
 case $2 in
     DEINSTALL)
 	stop_process
+	exit 0 # ignore error
 	;;
     POST-DEINSTALL)
 	delete_group munin
diff -ruN ports/sysutils/munin-node-1.0.3/pkg-plist ports/sysutils/munin-node/pkg-plist
--- ports/sysutils/munin-node-1.0.3/pkg-plist	Thu Nov 18 06:56:53 2004
+++ ports/sysutils/munin-node/pkg-plist	Sat Nov 20 13:53:17 2004
@@ -1,7 +1,10 @@
 @comment etc/munin/VERSION.node must remain for upgrade version check
-etc/munin/munin-node.conf
-etc/munin/plugin-conf.d/plugins.conf
-etc/rc.d/munin-node.sh
+ at unexec if cmp -s %D/etc/munin/munin-node.conf %D/etc/munin/munin-node.conf.sample; then rm -f %D/etc/munin/munin-node.conf; fi
+etc/munin/munin-node.conf.sample
+ at unexec if cmp -s %D/etc/munin/plugin-conf.d/plugins.conf %D/etc/munin/plugin-conf.d/plugins.conf.sample; then rm -f %D/etc/munin/plugin-conf.d/plugins.conf; fi
+etc/munin/plugin-conf.d/plugins.conf.sample
+ at unexec rm %D/etc/rc.d/munin-node.sh 2>/dev/null || true
+ at unexec rm /etc/rc.d/munin_node 2>/dev/null || true
 sbin/munin-node
 sbin/munin-node-configure
 sbin/munin-run
@@ -73,7 +76,11 @@
 @unexec rmdir %D/%%DATADIR%% 2>/dev/null || true
 @unexec rmdir %D/etc/munin/plugin-conf.d 2>/dev/null || true
 @unexec rmdir %D/etc/munin 2>/dev/null || true
+ at unexec echo
+ at unexec echo '********************************************************************'
 @unexec echo "If you want to *completely* remove munin-node, you have to"
- at unexec echo "    rm -rf %D/var/munin and %D/etc/munin %D/www/data/munin"
+ at unexec echo "    rm -rf %D/var/munin %D/etc/munin %D/www/data/munin"
 @unexec echo "They have to be left on the system because you may be performing"
 @unexec echo "an update. This process can't tell."
+ at unexec echo '********************************************************************'
+ at unexec echo
--- munin-node-1.0.4.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list