aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/munin-master
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2010-02-25 04:18:51 +0800
committerdes <des@FreeBSD.org>2010-02-25 04:18:51 +0800
commit9d4e47279bf5dea8e9cc77d57996862cad7495be (patch)
treedd22be6d3682cffb775fde5f26bd2032d451d287 /sysutils/munin-master
parenta280dc00f6aa7f774e3606c619bf2e6701eee66f (diff)
downloadfreebsd-ports-gnome-9d4e47279bf5dea8e9cc77d57996862cad7495be.tar.gz
freebsd-ports-gnome-9d4e47279bf5dea8e9cc77d57996862cad7495be.tar.zst
freebsd-ports-gnome-9d4e47279bf5dea8e9cc77d57996862cad7495be.zip
Massive cleanup of the Munin ports:
- Use a fixed UID / GID - Fix handling of sample configs in plists - Add missing plist entries (mostly directories) - Use /var/munin instead of %D/var/munin - Consistently use %%FOODIR%% instead of ${PREFIX}/foo etc. - Honor BATCH / PACKAGE_BUILDING - Fix network throughput probes (if_ and if_errcoll_) PR: 120755, 120756, 124528, 129576, 129577, 143804 Submitted by: see PRs Feature safe: yes
Diffstat (limited to 'sysutils/munin-master')
-rw-r--r--sysutils/munin-master/Makefile16
-rw-r--r--sysutils/munin-master/files/pkg-message.in2
-rw-r--r--sysutils/munin-master/pkg-deinstall35
-rw-r--r--sysutils/munin-master/pkg-install40
-rw-r--r--sysutils/munin-master/pkg-plist7
5 files changed, 19 insertions, 81 deletions
diff --git a/sysutils/munin-master/Makefile b/sysutils/munin-master/Makefile
index 28167e6cacc9..fa9457ff37c4 100644
--- a/sysutils/munin-master/Makefile
+++ b/sysutils/munin-master/Makefile
@@ -7,6 +7,7 @@
PORTNAME= munin
PORTVERSION= 1.4.3
+PORTREVISION= 1
CATEGORIES= sysutils perl5
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}%20stable/${PORTVERSION}
PKGNAMESUFFIX= -master
@@ -42,7 +43,11 @@ PATCH_STRIP= -p1
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION:S/.r/rc/}
PKGMESSAGE= ${WRKDIR}/pkg-message
-MAKE_ARGS= LIBDIR=${DATADIR} CONFDIR=${ETCDIR} \
+USERS= munin
+GROUPS= munin
+
+DBDIR= /var/${PORTNAME}
+MAKE_ARGS= LIBDIR=${DATADIR} CONFDIR=${ETCDIR} DBDIR=${DBDIR} \
WWWDIR=${WWWDIR} CGIDIR=${WWWDIR}/cgi-bin \
PERL=${PERL} SITE_PERL_REL=${SITE_PERL_REL}
ALL_TARGET= build-master build-man
@@ -67,10 +72,12 @@ MAN8= munin-cron.8 \
munin-limits.8 \
munin-update.8
+PLIST_SUB= DBDIR=${DBDIR}
SUB_FILES= pkg-message
pre-install:
- @PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/pkg-install ${PKGNAME} PRE-INSTALL
+ @${SETENV} ${SCRIPTS_ENV} PKG_PREFIX=${PREFIX} \
+ ${SH} ${PKGDIR}/pkg-install ${PKGNAME} PRE-INSTALL
post-install:
@${INSTALL_DATA} ${WRKSRC}/build/master/munin.conf ${PREFIX}/etc/munin/munin.conf.sample
@@ -83,9 +90,10 @@ post-install:
@(cd ${WRKSRC}/build/doc && for man in ${MAN8}; do \
${INSTALL_MAN} -C $$man ${PREFIX}/man/man8; \
done)
- @DATADIR=${DATADIR} PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/pkg-install ${PKGNAME} POST-INSTALL
+ @${SETENV} ${SCRIPTS_ENV} PKG_PREFIX=${PREFIX} \
+ ${SH} ${PKGDIR}/pkg-install ${PKGNAME} POST-INSTALL
@${CHOWN} munin /var/log/munin-master
- @${CHGRP} munin /var/run/munin /var/log/munin-master ${WWWDIR} ${PREFIX}/var/munin
+ @${CHGRP} munin /var/run/munin /var/log/munin-master ${WWWDIR} ${DBDIR}
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
diff --git a/sysutils/munin-master/files/pkg-message.in b/sysutils/munin-master/files/pkg-message.in
index 3a9a5ff0c819..d32f17e6286d 100644
--- a/sysutils/munin-master/files/pkg-message.in
+++ b/sysutils/munin-master/files/pkg-message.in
@@ -1,6 +1,6 @@
********************************************************************
Unless this file already existed, a sample configuration file
-has been placed in %%ETCDIR%%/munin/munin.conf.
+has been placed in %%ETCDIR%%/munin.conf.
Please edit it according to your needs.
diff --git a/sysutils/munin-master/pkg-deinstall b/sysutils/munin-master/pkg-deinstall
index 68a56ca6be80..d55087497a7f 100644
--- a/sysutils/munin-master/pkg-deinstall
+++ b/sysutils/munin-master/pkg-deinstall
@@ -29,40 +29,6 @@ yesno() {
done
}
-delete_account() {
- local u g home
-
- u=$1
- g=$2
- if pw group show ${g} > /dev/null 2>&1; then
- if yesno "Do you want me to remove group \"${g}\"" y; then
- pw group del -n ${g}
- echo "Done."
- else
- GID=`pw group show ${g} | awk -F: '{ print $3 }'`
- fi
- fi
- if pw user show ${u} > /dev/null 2>&1; then
- if yesno "Do you want me to remove user \"${u}\"" y; then
- eval home=~${u}
- pw user del -n ${u} -r
- echo "Done."
- if [ -d "${home}" ]; then
- echo "Please remember to remove the home directory \"${home}\""
- fi
-
- # pw user del may have removed the group, too.
- # Put it back if the admin asked us to retain it.
- if [ -n "$GID" ]; then
- pw group show ${g} > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- pw group add ${g}
- fi
- fi
- fi
- fi
-}
-
delete_crontab_entries() {
local b e
b=$1
@@ -113,6 +79,5 @@ case $2 in
fi
;;
POST-DEINSTALL)
- delete_account munin munin
;;
esac
diff --git a/sysutils/munin-master/pkg-install b/sysutils/munin-master/pkg-install
index 17d54351737c..ff0fb2f16b7c 100644
--- a/sysutils/munin-master/pkg-install
+++ b/sysutils/munin-master/pkg-install
@@ -29,45 +29,6 @@ yesno() {
done
}
-make_account() {
- local u g gcos
-
- u=$1
- g=$2
- gcos=$3
-
- if pw group show "${g}" >/dev/null 2>&1; then
- echo "You already have a group \"${g}\", so I will use it."
- else
- echo "You need a group \"${g}\"."
- if which -s pw && yesno "Would you like me to create it" y; then
- pw groupadd ${g} || exit
- echo "Done."
- else
- echo "Please create it, and try again."
- if ! /usr/sbin/pw user show ${u} >/dev/null 2>/dev/null; then
- echo "While you're at it, please create a user \"${u}\" too,"
- echo "with a default group of \"${g}\"."
- fi
- exit 1
- fi
- fi
-
- if pw user show "${u}" >/dev/null 2>&1; then
- echo "You already have a user \"${u}\", so I will use it."
- else
- echo "You need a user \"${u}\"."
- if which -s pw && yesno "Would you like me to create it" y; then
- pw useradd ${u} -g ${g} -h - \
- -s /bin/sh -c "${gcos}" || exit
- echo "Done."
- else
- echo "Please create it, and try again."
- exit 1
- fi
- fi
-}
-
create_crontab_entries() {
local b e
b=$1
@@ -109,7 +70,6 @@ move_www_dir() {
case $2 in
PRE-INSTALL)
- make_account munin munin "Munin owner"
move_www_dir # at some point in the installation, the www dir is created
;;
POST-INSTALL)
diff --git a/sysutils/munin-master/pkg-plist b/sysutils/munin-master/pkg-plist
index 605e70380e4b..2ec21a94100d 100644
--- a/sysutils/munin-master/pkg-plist
+++ b/sysutils/munin-master/pkg-plist
@@ -1,6 +1,8 @@
bin/munin-check
bin/munin-cron
+@unexec if cmp -s %D/%%ETCDIR%%/munin.conf.sample %D/%%ETCDIR%%/munin.conf ; then rm -f %D/%%ETCDIR%%/munin.conf ; fi
%%ETCDIR%%/munin.conf.sample
+@exec if [ ! -f %D/%%ETCDIR%%/munin.conf ] ; then cp -p %D/%%ETCDIR%%/munin.conf.sample %D/%%ETCDIR%%/munin.conf ; fi
%%ETCDIR%%/templates/definitions.html
%%ETCDIR%%/templates/favicon.ico
%%ETCDIR%%/templates/logo-h.png
@@ -48,8 +50,11 @@ bin/munin-cron
@dirrmtry %%WWWDIR%%/cgi-bin
@dirrmtry %%WWWDIR%%
@dirrmtry %%DATADIR%%
-@dirrmtry var/munin
+@dirrmtry %%DBDIR%%
@dirrm %%SITE_PERL%%/Munin/Master
@dirrmtry %%SITE_PERL%%/Munin
+@dirrmtry %%ETCDIR%%/templates/partial
@dirrmtry %%ETCDIR%%/templates
+@exec mkdir -p %D/%%ETCDIR%%/munin-conf.d
+@dirrmtry %%ETCDIR%%/munin-conf.d
@dirrmtry %%ETCDIR%%