ports/77720: [maintainer update] sysutils/munin-main 1.0.4 -> 1.2.0

Lupe Christoph lupe at lupe-christoph.de
Sat Feb 19 08:20:16 UTC 2005


>Number:         77720
>Category:       ports
>Synopsis:       [maintainer update] sysutils/munin-main 1.0.4 -> 1.2.0
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 19 08:20:14 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Lupe Christoph
>Release:        FreeBSD 4.10-RELEASE i386
>Organization:
>Environment:
System: FreeBSD vmw-freebsd4.lupe-christoph.de 4.10-RELEASE FreeBSD 4.10-RELEASE #0: Tue May 25 22:47:12 GMT 2004 root at perseus.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:
	Update to support Munin 1.2.0
	Changes that were in the 1.0.5 update that did not get applied:
		Put logfiles in /var/log/munin-main rather than /var/log.
		Create /var/log/munin-main, munin:munin.
		Change group of all munin-main directories to munin.
	New changes:
		Use SUB_FILES
		Install MANPAGES with loops over ${MAN5} and ${MAN8}
		Add chown/chgrp to munin for a few directories
		Add log rotation support.
		Add @exec mkdir to pkg-plist for package installation
	Files changed:
		Makefile
		distinfo
		pkg-deinstall
		pkg-install
		pkg-plist
>How-To-Repeat:
	
>Fix:

	

--- munin-main-1.2.0.patch begins here ---
diff -duN munin-main-1.0.4/Makefile munin-main-1.2.0/Makefile
--- munin-main-1.0.4/Makefile	Wed Nov 24 23:03:19 2004
+++ munin-main-1.2.0/Makefile	Thu Feb 17 17:41:59 2005
@@ -2,23 +2,24 @@
 # Date created:				25 Januar 2004
 # Whom:					Lupe Christoph <lupe at lupe-christoph.de>
 #
-# $FreeBSD: ports/sysutils/munin-main/Makefile,v 1.6 2004/11/16 13:39:54 vs Exp $
+# $FreeBSD: ports/sysutils/munin-main/Makefile,v 1.7 2004/12/14 01:43:10 sem Exp $
 #
 
 PORTNAME=	munin
-PORTVERSION=	1.0.4
+PORTVERSION=	1.2.0
 CATEGORIES=	sysutils perl5
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	munin
 PKGNAMESUFFIX=	-main
-DISTNAME=	${PORTNAME}_${PORTVERSION:S/.p/pre/}
+DISTNAME=	${PORTNAME}_${PORTVERSION:S/.r/rc/}
 
 MAINTAINER=	lupe at lupe-christoph.de
 COMMENT=	Collector part of Munin
 
 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
+		${SITE_PERL}/HTML/Template.pm:${PORTSDIR}/www/p5-HTML-Template \
+		${SITE_PERL}/Date/Manip.pm:${PORTSDIR}/devel/p5-Date-Manip
 BUILD_DEPENDS=	${RUN_DEPENDS}
 
 .include <bsd.port.pre.mk>
@@ -26,37 +27,36 @@
 .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
+		${SITE_PERL}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes \
+		${SITE_PERL}/Text/Balanced.pm:${PORTSDIR}/textproc/p5-Text-Balanced
 .endif
 
 USE_GMAKE=	yes
 PATCH_STRIP=	-p1
-WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION:S/.p/pre/}
+WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION:S/.r/rc/}
 PKGMESSAGE=	${WRKDIR}/pkg-message
-ALL_TARGET=	DATADIR=${DATADIR} build build-man
-INSTALL_TARGET=	DATADIR=${DATADIR} install-main
+ALL_TARGET=	DATADIR=${DATADIR} PERL=${PERL} build build-man
+INSTALL_TARGET=	DATADIR=${DATADIR} PERL=${PERL} install-main
 
 MAN5=		munin.conf.5
-MAN8=		munin-cron.8 munin-graph.8 munin-html.8 munin-nagios.8 munin-update.8
+MAN8=		munin-cron.8 munin-graph.8 munin-html.8 munin-limits.8 munin-update.8
+
+SUB_FILES=pkg-message
 
 pre-install:
-	@${SED} 's@%%PREFIX%%@${PREFIX}@g' ${FILESDIR}/pkg-message > ${PKGMESSAGE}
 	@PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
 
 post-install:
-	@if [ ! -f ${PREFIX}/www/data/munin/style.css ]; then \
-		${INSTALL_DATA} ${PREFIX}/etc/munin/templates/style.css ${PREFIX}/www/data/munin/style.css; \
-	fi
-	@if [ ! -f ${PREFIX}/www/data/munin/logo.png ]; then \
-		${INSTALL_DATA} ${PREFIX}/etc/munin/templates/logo.png ${PREFIX}/www/data/munin/logo.png; \
-	fi
-	@${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
+	@${INSTALL_DATA} ${WRKSRC}/build/server/munin.conf ${PREFIX}/etc/munin/munin.conf.sample
+	@for man in ${MAN5}; do \
+		${INSTALL_MAN} -C ${WRKSRC}/build/doc/$$man ${PREFIX}/man/man5; \
+	done
+	@for man in ${MAN8}; do \
+		${INSTALL_MAN} -C ${WRKSRC}/build/doc/$$man ${PREFIX}/man/man8; \
+	done
 	@DATADIR=${DATADIR} PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} POST-INSTALL
+	@${CHOWN} munin /var/log/munin-main
+	@${CHGRP} munin /var/run/munin /var/log/munin-main ${PREFIX}/www/data/munin ${PREFIX}/var/munin
 	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.post.mk>
diff -duN munin-main-1.0.4/distinfo munin-main-1.2.0/distinfo
--- munin-main-1.0.4/distinfo	Wed Nov 24 22:59:37 2004
+++ munin-main-1.2.0/distinfo	Thu Feb 17 17:40:50 2005
@@ -1,2 +1,2 @@
-MD5 (munin_1.0.4.tar.gz) = 00721181e1ff81be85ad89307457d998
-SIZE (munin_1.0.4.tar.gz) = 214902
+MD5 (munin_1.2.0.tar.gz) = bbab7bf91ac837e4c72889aaef7cf2e8
+SIZE (munin_1.2.0.tar.gz) = 318364
Common subdirectories: munin-main-1.0.4/files and munin-main-1.2.0/files
diff -duN munin-main-1.0.4/pkg-deinstall munin-main-1.2.0/pkg-deinstall
--- munin-main-1.0.4/pkg-deinstall	Tue Mar  2 16:52:48 2004
+++ munin-main-1.2.0/pkg-deinstall	Thu Feb  3 15:41:11 2005
@@ -1,7 +1,4 @@
 #! /bin/sh
-#
-# $Log$
-#
 
 ask() {
     local question default answer
@@ -80,15 +77,38 @@
 	echo "These are the remaining lines:"
 	crontab -u munin -l
     else
-	crontab -u munin -r
+	echo y | crontab -u munin -r
 	echo "crontab for user munin removed"
     fi
     rm $TMPFILE
 }
 
+delnewsyslog() {
+    tmp="/etc/#munin-node$$"
+    sed -e '/^\/var\/log\/munin-main\/\*\.log[ 	]/d' /etc/newsyslog.conf >${tmp}
+    cat ${tmp} > /etc/newsyslog.conf
+    rm ${tmp}
+}
+
+newsyslog() {
+    ENTRY=`fgrep '/var/log/munin-main/*' /etc/newsyslog.conf`
+    DEFAULT='/var/log/munin-main/*.log munin:munin	644  7	   *	@T00  GNWZ'
+    if [ -z "$ENTRY" ]; then
+        exit 0
+    elif [ "$ENTRY" = "$DEFAULT" ]; then
+        delnewsyslog
+    elif yesno "You have changed the default munin-main entry in \"/etc/newsyslog.conf\".
+Do you want me to delete it?" y; then
+        delnewsyslog
+        echo "Done."
+    fi
+}
+
+
 case $2 in
     DEINSTALL)
-	delete_crontab_entries '#BEGIN_MUNIN' '#END_MUNIN'
+	delete_crontab_entries '#BEGIN_MUNIN_MAIN' '#END_MUNIN_MAIN'
+	newsyslog
 	;;
     POST-DEINSTALL)
 	delete_account munin munin
diff -duN munin-main-1.0.4/pkg-install munin-main-1.2.0/pkg-install
--- munin-main-1.0.4/pkg-install	Sat Jun 12 19:41:59 2004
+++ munin-main-1.2.0/pkg-install	Sun Feb  6 12:27:20 2005
@@ -1,7 +1,4 @@
 #! /bin/sh
-#
-# $Log$
-#
 
 ask() {
     local question default answer
@@ -71,24 +68,15 @@
     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
+    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 -l | sed -e "/^$b$/,/^$e$/d" | \
 	cat - $TMPFILE | crontab -u munin -
 	rm $TMPFILE
     else
@@ -96,33 +84,34 @@
     fi
 }
 
+mklogdir() {
+}
+
+newsyslog() {
+    if fgrep -q '/var/log/munin-main/*' /etc/newsyslog.conf; then
+        :
+    else
+        cat >> /etc/newsyslog.conf <<EOT
+/var/log/munin-main/*.log munin:munin	644  7	   *	@T00  GNWZ
+EOT
+    fi  
+}
+
 
 ########################################################################
 
 case $2 in
     PRE-INSTALL)
-	# Munin had a logo.gif up to 1.0.0pre3.
-	# Remove it, it's been replaced by logo.png
-	rm -f ${PKG_PREFIX}/www/data/munin/logo.gif
-	# The old stylesheet must go, too.
-	rm -f ${PKG_PREFIX}/www/data/munin/style.css
-	# Both new files will be put in place by munin-html
-
 	make_account munin munin "Munin owner"
-	make_directories
 	;;      
     POST-INSTALL)
-	create_crontab_entries '#BEGIN_MUNIN' '#END_MUNIN' <<EOT
-#
-# cron-jobs for munin
-#
-
-#BEGIN_MUNIN
+	newsyslog
+	create_crontab_entries '#BEGIN_MUNIN_MAIN' '#END_MUNIN_MAIN' <<EOT
+#BEGIN_MUNIN_MAIN
 MAILTO=root
 
 */5 * * * *     ${PKG_PREFIX}/bin/munin-cron
-10 10 * * *     ${DATADIR:=${PKG_PREFIX}/share/munin}/munin-nagios --removeok
-#END_MUNIN
+#END_MUNIN_MAIN
 EOT
 	;;      
 esac
diff -duN munin-main-1.0.4/pkg-plist munin-main-1.2.0/pkg-plist
--- munin-main-1.0.4/pkg-plist	Fri Nov 26 07:56:37 2004
+++ munin-main-1.2.0/pkg-plist	Fri Feb 18 11:53:17 2005
@@ -1,35 +1,48 @@
+ at exec mkdir -p /var/run/munin && chown munin:munin /var/run/munin
+ at exec mkdir -p /var/log/munin-main && chown munin:munin /var/log/munin-main
+ at exec mkdir -p %D/www/data/munin && chown munin:munin %D/www/data/munin
+ at exec mkdir -p %D/var/munin && chown munin:munin %D/var/munin
 bin/munin-cron
- at unexec if cmp -s %D/etc/munin/templates/style.css %D/www/data-dist/munin/style.css; then rm -f %D/www/data-dist/munin/style.css; fi
- at unexec if cmp -s %D/etc/munin/templates/logo.png %D/www/data-dist/munin/logo.png; then rm -f %D/www/data-dist/munin/logo.png; fi
-etc/munin/munin.conf
+ at unexec if cmp -s %D/etc/munin/munin.conf.sample %D/etc/munin/munin.conf; then rm -f %D/etc/munin/munin.conf; fi
+etc/munin/munin.conf.sample
+etc/munin/templates/definitions.html
+ at unexec if cmp -s %D/etc/munin/templates/logo.png %D/www/data/munin/logo.png; then rm -f %D/www/data/munin/logo.png; fi
 etc/munin/templates/logo.png
+etc/munin/templates/munin-comparison-day.tmpl
+etc/munin/templates/munin-comparison-month.tmpl
+etc/munin/templates/munin-comparison-week.tmpl
+etc/munin/templates/munin-comparison-year.tmpl
 etc/munin/templates/munin-domainview.tmpl
 etc/munin/templates/munin-nodeview.tmpl
 etc/munin/templates/munin-overview.tmpl
 etc/munin/templates/munin-serviceview.tmpl
+ at unexec if cmp -s %D/etc/munin/templates/style.css %D/www/data/munin/style.css; then rm -f %D/www/data/munin/style.css; fi
 etc/munin/templates/style.css
 %%SITE_PERL%%/Munin.pm
 share/munin/munin-graph
 share/munin/munin-html
-share/munin/munin-nagios
+share/munin/munin-limits
 share/munin/munin-update
+www/cgi-bin/munin-cgi-graph
+ at unexec rm -f /var/run/munin/munin-*.lock
+ at unexec rmdir /var/run/munin 2>/dev/null || true
+ at unexec rmdir /var/log/munin-main 2>/dev/null || true
 @unexec rmdir %D/www/data/munin 2>/dev/null || true
 @unexec rmdir %D/www/data 2>/dev/null || true
+ at unexec rmdir %D/www/cgi-bin 2>/dev/null || true
 @unexec rmdir %D/var/munin 2>/dev/null || true
- at unexec rmdir %D/var 2>/dev/null || true
 @unexec rmdir %D/share/munin 2>/dev/null || true
- at dirrm etc/munin/templates
+ at unexec rmdir %D/etc/munin/templates 2>/dev/null || true
 @unexec rmdir %D/etc/munin 2>/dev/null || true
 @unexec echo
 @unexec echo '********************************************************************'
 @unexec echo "If you want to *completely* remove munin-main, you have to"
 @unexec echo
- at unexec echo "    rm -rf %D/var/munin/datafile %D/www/data/munin \\"
- at unexec echo "          "`ls -d /usr/local/var/munin/* | grep -v plugin-state`" \\"
+ at unexec if [ -d %D/www/data/munin ]; then echo "    rm -rf %D/www/data/munin \\"; fi
+ at unexec if [ -d %D/var/munin ]; then ls -d %D/var/munin/* | grep -v plugin-state | fmt -40 | sed -e 's/^/           /' -e 's/$/ \\/'; fi
 @unexec if [ -f %D/etc/munin/munin.conf ]; then echo "           %D/etc/munin/munin.conf \\"; fi
 @unexec if [ -d %D/etc/munin/templates ]; then echo "           %D/etc/munin/templates \\"; fi
- at unexec echo "           %D/etc/munin/munin-node.conf %D/etc/munin/plugins \\"
- at unexec echo "           /var/log/munin"
+ at unexec echo "           /var/log/munin-main"
 @unexec echo
 @unexec echo "If you have already deinstalled munin-node, you can also"
 @unexec echo
--- munin-main-1.2.0.patch ends here ---


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



More information about the freebsd-ports-bugs mailing list