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

Lupe Christoph lupe at lupe-christoph.de
Fri Nov 26 07:30:37 UTC 2004


The following reply was made to PR ports/74166; it has been noted by GNATS.

From: lupe at lupe-christoph.de (Lupe Christoph)
To: FreeBSD-gnats-submit at FreeBSD.org
Cc: Sergey Matveychuk <sem at FreeBSD.org>
Subject: Re: ports/74166: Update port: sysutils/munin-node 1.0.3 -> 1.0.4
Date: Fri, 26 Nov 2004 08:23:01 +0100

 Second version of the update patch. The deinstall message is corrected to
 omit parts that belong to munin-main. The deinstall message in munin-main
 gets corrected by a correspondingly changed update patch. Both messages
 refer to the other port for common parts.
 
 Lupe Christoph
 --- munin-node-1.0.4.patch begins here ---
 diff -ruN /usr/ports/sysutils/munin-node/Makefile munin-node-1.0.4/Makefile
 --- /usr/ports/sysutils/munin-node/Makefile	Tue Nov 16 16:16:37 2004
 +++ munin-node-1.0.4/Makefile	Sun Nov 21 11:47:09 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 /usr/ports/sysutils/munin-node/distinfo munin-node-1.0.4/distinfo
 --- /usr/ports/sysutils/munin-node/distinfo	Tue Nov 16 16:16:37 2004
 +++ munin-node-1.0.4/distinfo	Sun Nov 21 11:42:35 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 /usr/ports/sysutils/munin-node/files/munin-node.sh munin-node-1.0.4/files/munin-node.sh
 --- /usr/ports/sysutils/munin-node/files/munin-node.sh	Tue Mar  2 16:54:05 2004
 +++ munin-node-1.0.4/files/munin-node.sh	Sun Nov 21 11:44:10 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 /usr/ports/sysutils/munin-node/files/munin_node.sh munin-node-1.0.4/files/munin_node.sh
 --- /usr/ports/sysutils/munin-node/files/munin_node.sh	Thu Jan  1 01:00:00 1970
 +++ munin-node-1.0.4/files/munin_node.sh	Sun Nov 21 11:55:43 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 /usr/ports/sysutils/munin-node/files/patch-cpu.in munin-node-1.0.4/files/patch-cpu.in
 --- /usr/ports/sysutils/munin-node/files/patch-cpu.in	Thu Jan  1 01:00:00 1970
 +++ munin-node-1.0.4/files/patch-cpu.in	Sun Nov 21 11:55:43 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 /usr/ports/sysutils/munin-node/files/patch-vmstat.in munin-node-1.0.4/files/patch-vmstat.in
 --- /usr/ports/sysutils/munin-node/files/patch-vmstat.in	Thu Jan  1 01:00:00 1970
 +++ munin-node-1.0.4/files/patch-vmstat.in	Sun Nov 21 11:55:43 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 /usr/ports/sysutils/munin-node/files/pkg-message munin-node-1.0.4/files/pkg-message
 --- /usr/ports/sysutils/munin-node/files/pkg-message	Tue Mar  2 16:54:05 2004
 +++ munin-node-1.0.4/files/pkg-message	Sun Nov 21 11:45:15 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 /usr/ports/sysutils/munin-node/files/pkg-message.4 munin-node-1.0.4/files/pkg-message.4
 --- /usr/ports/sysutils/munin-node/files/pkg-message.4	Thu Jan  1 01:00:00 1970
 +++ munin-node-1.0.4/files/pkg-message.4	Sun Nov 21 11:55:43 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 /usr/ports/sysutils/munin-node/pkg-deinstall munin-node-1.0.4/pkg-deinstall
 --- /usr/ports/sysutils/munin-node/pkg-deinstall	Tue Mar  2 16:54:05 2004
 +++ munin-node-1.0.4/pkg-deinstall	Sun Nov 21 11:52:27 2004
 @@ -1,6 +1,9 @@
  #! /bin/sh
  #
  # $Log: pkg-deinstall,v $
 +# Revision 1.2.2.1  2004/11/21 10:52:27  lupe
 +# make stop_process use old or new start-stop script.
 +#
  # Revision 1.2  2004/02/06 18:49:58  lupe
  # Fixes for pkg_add compatibility.
  #
 @@ -36,8 +39,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 +54,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 /usr/ports/sysutils/munin-node/pkg-plist munin-node-1.0.4/pkg-plist
 --- /usr/ports/sysutils/munin-node/pkg-plist	Tue Nov 16 16:16:37 2004
 +++ munin-node-1.0.4/pkg-plist	Fri Nov 26 07:57:23 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,19 @@
  @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 "They have to be left on the system because you may be performing"
 - at unexec echo "an update. This process can't tell."
 + at unexec echo
 + at unexec echo "    rm -rf %D/var/munin/plugin-state %D/etc/munin/VERSION.node \\"
 + at unexec echo "           %D/etc/munin/munin-node.conf %D/etc/munin/plugins \\"
 + at unexec echo "           /var/log/munin-node.log*"
 + at unexec echo
 + at unexec echo "If you have already deinstalled munin-main, you can also"
 + at unexec echo
 + at unexec echo "    rmdir %D/etc/munin %D/var/munin"
 + at unexec echo
 + at unexec echo "These files and directories have to be left on the system because"
 + at unexec echo "you may be performing an update. This process can't tell."
 + at unexec echo '********************************************************************'
 + at unexec echo
 --- munin-node-1.0.4.patch ends here ---
 -- 
 | lupe at lupe-christoph.de       |           http://www.lupe-christoph.de/ |
 | "... putting a mail server on the Internet without filtering is like   |
 | covering yourself with barbecue sauce and breaking into the Charity    |
 | Home for Badgers with Rabies.                            Michael Lucas |



More information about the freebsd-ports-bugs mailing list