Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Dec 2016 17:30:00 +0000 (UTC)
From:      Mathieu Arnold <mat@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r429557 - in head/sysutils: munin-master munin-node munin-node/files
Message-ID:  <201612261730.uBQHU08J018202@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mat
Date: Mon Dec 26 17:30:00 2016
New Revision: 429557
URL: https://svnweb.freebsd.org/changeset/ports/429557

Log:
  Drop newsyslog's configuration into etc/newsyslog.conf.d.
  
  Sponsored by:	Absolight

Added:
  head/sysutils/munin-node/files/newsyslog   (contents, props changed)
Deleted:
  head/sysutils/munin-node/pkg-deinstall
Modified:
  head/sysutils/munin-master/Makefile   (contents, props changed)
  head/sysutils/munin-master/pkg-deinstall   (contents, props changed)
  head/sysutils/munin-master/pkg-install   (contents, props changed)
  head/sysutils/munin-master/pkg-plist   (contents, props changed)
  head/sysutils/munin-node/Makefile   (contents, props changed)
  head/sysutils/munin-node/pkg-install   (contents, props changed)
  head/sysutils/munin-node/pkg-plist   (contents, props changed)

Modified: head/sysutils/munin-master/Makefile
==============================================================================
--- head/sysutils/munin-master/Makefile	Mon Dec 26 17:27:57 2016	(r429556)
+++ head/sysutils/munin-master/Makefile	Mon Dec 26 17:30:00 2016	(r429557)
@@ -3,6 +3,7 @@
 
 PORTNAME=	munin
 PORTVERSION=	${MUNIN_VERSION}
+PORTREVISION=	1
 CATEGORIES=	sysutils perl5
 MASTER_SITES=	${MUNIN_SITES}
 PKGNAMESUFFIX=	-master
@@ -61,6 +62,7 @@ post-install:
 	)
 	(cd ${STAGEDIR}${ETCDIR}; for i in `find . -type f`; do mv $$i $$i.sample; done)
 	${MV} ${STAGEDIR}${WWWDIR}/.htaccess ${STAGEDIR}${WWWDIR}/.htaccess.sample
+	${INSTALL_DATA} ${FILESDIR}/newsyslog ${STAGEDIR}${ETCDIR}/munin-master.newsyslog
 
 .include <bsd.port.pre.mk>
 

Modified: head/sysutils/munin-master/pkg-deinstall
==============================================================================
--- head/sysutils/munin-master/pkg-deinstall	Mon Dec 26 17:27:57 2016	(r429556)
+++ head/sysutils/munin-master/pkg-deinstall	Mon Dec 26 17:30:00 2016	(r429557)
@@ -53,39 +53,11 @@ delete_crontab_entries() {
     rm $TMPFILE
 }
 
-delnewsyslog() {
-    tmp=`mktemp -t munin` || exit 1
-    sed -e '/^\/var\/log\/munin\/\*\.log[	]/d' /etc/newsyslog.conf >${tmp}
-    cat ${tmp} > /etc/newsyslog.conf
-    rm ${tmp}
-}
-
-newsyslog() {
-    ENTRY=`fgrep '/var/log/munin/*' /etc/newsyslog.conf`
-    DEFAULT='/var/log/munin/*.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-master entry in \"/etc/newsyslog.conf\".
-Do you want me to delete it?" y
-    then
-	delnewsyslog
-	echo "Done."
-    fi
-}
-
-
 case $2 in
     DEINSTALL)
 	if [ -z "${PACKAGE_BUILDING}" ]
 	then
 	    delete_crontab_entries '#BEGIN_MUNIN_MAIN' '#END_MUNIN_MAIN'
-	    newsyslog
 	fi
 	;;
-    POST-DEINSTALL)
-	;;
 esac

Modified: head/sysutils/munin-master/pkg-install
==============================================================================
--- head/sysutils/munin-master/pkg-install	Mon Dec 26 17:27:57 2016	(r429556)
+++ head/sysutils/munin-master/pkg-install	Mon Dec 26 17:30:00 2016	(r429557)
@@ -52,15 +52,6 @@ create_crontab_entries() {
     fi
 }
 
-newsyslog() {
-    if ! fgrep -q '/var/log/munin/*' /etc/newsyslog.conf
-    then
-        cat >> /etc/newsyslog.conf <<EOT
-/var/log/munin/*.log munin:munin	644  7	   *	@T00  GNWZ
-EOT
-    fi
-}
-
 move_www_dir() {
     if [ -d ${PKG_PREFIX}/www/data/munin -a ! -d ${PKG_PREFIX}/www/munin ]
     then
@@ -79,7 +70,6 @@ case $2 in
     POST-INSTALL)
 	if [ -z "${PACKAGE_BUILDING}" ]
 	then
-	    newsyslog
 	    create_crontab_entries '#BEGIN_MUNIN_MAIN' '#END_MUNIN_MAIN' <<EOT
 #BEGIN_MUNIN_MAIN
 MAILTO=root

Modified: head/sysutils/munin-master/pkg-plist
==============================================================================
--- head/sysutils/munin-master/pkg-plist	Mon Dec 26 17:27:57 2016	(r429556)
+++ head/sysutils/munin-master/pkg-plist	Mon Dec 26 17:30:00 2016	(r429557)
@@ -33,6 +33,11 @@ bin/munin-cron
 @sample %%ETCDIR%%/templates/partial/logo_path.tmpl.sample
 @sample %%ETCDIR%%/templates/partial/navigation.tmpl.sample
 @sample %%ETCDIR%%/templates/partial/path.tmpl.sample
+@comment the directory exists in STAGEDIR because it is present in
+@comment BSD.local.dist but if not registered here, it will not exist in PREFIX
+@comment when the package is installed.
+@dir etc/newsyslog.conf.d
+@sample %%ETCDIR%%/munin-master.newsyslog etc/newsyslog.conf.d/munin-master
 %%SITE_PERL%%/Munin/Master/Config.pm
 %%SITE_PERL%%/Munin/Master/GraphOld.pm
 %%SITE_PERL%%/Munin/Master/Group.pm

Modified: head/sysutils/munin-node/Makefile
==============================================================================
--- head/sysutils/munin-node/Makefile	Mon Dec 26 17:27:57 2016	(r429556)
+++ head/sysutils/munin-node/Makefile	Mon Dec 26 17:30:00 2016	(r429557)
@@ -3,6 +3,7 @@
 
 PORTNAME=	munin
 PORTVERSION=	${MUNIN_VERSION}
+PORTREVISION=	1
 CATEGORIES=	sysutils perl5
 MASTER_SITES=	${MUNIN_SITES}
 PKGNAMESUFFIX=	-node
@@ -84,5 +85,6 @@ post-install:
 		${INSTALL_MAN} munin-node.conf.5 ${STAGEDIR}${MAN5PREFIX}/man/man5; \
 		${INSTALL_MAN} munin.8 ${STAGEDIR}${MAN8PREFIX}/man/man8; \
 	)
+	${INSTALL_DATA} ${FILESDIR}/newsyslog ${STAGEDIR}${ETCDIR}/munin-node.newsyslog
 
 .include <bsd.port.mk>

Added: head/sysutils/munin-node/files/newsyslog
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/munin-node/files/newsyslog	Mon Dec 26 17:30:00 2016	(r429557)
@@ -0,0 +1 @@
+/var/log/munin/munin-node.log	644	7	*	@T00	Z	/var/run/munin/munin-node.pid

Modified: head/sysutils/munin-node/pkg-install
==============================================================================
--- head/sysutils/munin-node/pkg-install	Mon Dec 26 17:27:57 2016	(r429556)
+++ head/sysutils/munin-node/pkg-install	Mon Dec 26 17:30:00 2016	(r429557)
@@ -12,26 +12,13 @@ init_plugins() {
     echo "done."
 }
 
-newsyslog() {
-	if grep -q /var/log/munin/munin-node.log /etc/newsyslog.conf; then
-	    :
-	else
-	    cat >> /etc/newsyslog.conf <<EOT
-/var/log/munin/munin-node.log			644  7	   *	@T00  Z	/var/run/munin/munin-node.pid
-EOT
-	fi
-}
-
 
 ########################################################################
 
 case $2 in
-    PRE-INSTALL)
-	;;      
     POST-INSTALL)
 	if [ -z "${PACKAGE_BUILDING}" ]; then
 		init_plugins
-		newsyslog
 	fi
 	;;
 esac

Modified: head/sysutils/munin-node/pkg-plist
==============================================================================
--- head/sysutils/munin-node/pkg-plist	Mon Dec 26 17:27:57 2016	(r429556)
+++ head/sysutils/munin-node/pkg-plist	Mon Dec 26 17:30:00 2016	(r429557)
@@ -1,6 +1,11 @@
 bin/munindoc
 @sample %%ETCDIR%%/munin-node.conf.sample
 @sample %%ETCDIR%%/plugin-conf.d/plugins.conf.sample
+@comment the directory exists in STAGEDIR because it is present in
+@comment BSD.local.dist but if not registered here, it will not exist in PREFIX
+@comment when the package is installed.
+@dir etc/newsyslog.conf.d
+@sample %%ETCDIR%%/munin-node.newsyslog etc/newsyslog.conf.d/munin-node
 %%SITE_PERL%%/Munin/Node/Config.pm
 %%SITE_PERL%%/Munin/Node/Configure/Debug.pm
 %%SITE_PERL%%/Munin/Node/Configure/History.pm



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612261730.uBQHU08J018202>