Date: Thu, 11 Mar 2004 12:33:56 +0100 (CET) From: Lupe Christoph <lupe@lupe-christoph.de> To: FreeBSD-gnats-submit@FreeBSD.org Cc: Lupe Christoph <lupe@lupe-christoph.de> Subject: ports/64285: Update port: sysutils/munin-node Minor fixes to pkg-plist Message-ID: <200403111133.i2BBXu1W043847@sebastian.lupe-christoph.de> Resent-Message-ID: <200403150710.i2F7AEGF078279@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 64285 >Category: ports >Synopsis: Update port: sysutils/munin-node Minor fixes to pkg-plist >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Mar 14 23:10:14 PST 2004 >Closed-Date: >Last-Modified: >Originator: Lupe Christoph >Release: FreeBSD 5.2.1-RELEASE i386 >Organization: >Environment: System: FreeBSD sebastian.lupe-christoph.de 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #2: Thu Feb 26 23:02:20 CET 2004 root@:/usr/obj/usr/src/sys/SEBASTIAN i386 >Description: Do not delete etc/munin/VERSION.node, it is needed for upgrades. Rather explain to the user what remains after pkg_delete and how to delete it. Files changed: Makefile pkg-plist >How-To-Repeat: >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # munin-node # munin-node/files # munin-node/files/munin-node.sh # munin-node/files/patch-Makefile.config # munin-node/files/patch-munin-node.conf.in # munin-node/files/pkg-message # munin-node/Makefile # munin-node/distinfo # munin-node/pkg-deinstall # munin-node/pkg-descr # munin-node/pkg-install # munin-node/pkg-plist # echo c - munin-node mkdir -p munin-node > /dev/null 2>&1 echo c - munin-node/files mkdir -p munin-node/files > /dev/null 2>&1 echo x - munin-node/files/munin-node.sh sed 's/^X//' >munin-node/files/munin-node.sh << 'END-of-munin-node/files/munin-node.sh' X#!/bin/sh X XPROGRAM=%PREFIX%/sbin/munin-node XCONFIG=%PREFIX%/etc/munin/munin-node.conf X Xcase "$1" in X start) X if [ -x $PROGRAM -a -f $CONFIG -a -d $PLUGINS ]; then X $PROGRAM --config $CONFIG && echo -n ' munin-node' X fi X ;; X X stop) X if [ -f $CONFIG ]; then X PIDFILE=`awk '$1 == "pid_file" { print $2 }' $CONFIG` X if [ -f $PIDFILE ]; then X /bin/kill `cat $PIDFILE` && echo -n ' munin-node' X fi X fi X ;; X X *) X echo "Usage: `basename $0` { start | stop }" X exit 64 X ;; Xesac END-of-munin-node/files/munin-node.sh echo x - munin-node/files/patch-Makefile.config sed 's/^X//' >munin-node/files/patch-Makefile.config << 'END-of-munin-node/files/patch-Makefile.config' X--- munin-1.0.0pre3.orig/Makefile.config Sun Feb 1 22:05:52 2004 X+++ munin-1.0.0pre3/Makefile.config Sat Feb 7 12:48:23 2004 X@@ -7,42 +7,46 @@ X # X # the base of the Munin installation. X # X-PREFIX = $(DESTDIR)/opt/munin X+ifdef PREFIX X+UPREFIX=$(PREFIX) X+else X+UPREFIX=/usr X+endif X X # Where Munin keeps its configurations (server.conf, client.conf, ++) X-CONFDIR = $(DESTDIR)/etc/opt/munin X+CONFDIR = $(PREFIX)/etc/munin X X # Server only - where to put munin-cron X-BINDIR = $(PREFIX)/bin X+BINDIR = $(UPREFIX)/bin X X # Client only - where to put munin-node, munin-node-configure, and munin-run X-SBINDIR = $(PREFIX)/sbin X+SBINDIR = $(UPREFIX)/sbin X X # Where to put text and html documentation X-DOCDIR = $(PREFIX)/doc X+DOCDIR = $(UPREFIX)/doc X X # Where to put man pages X-MANDIR = $(PREFIX)/man X+MANDIR = $(UPREFIX)/man X X # Where to put internal binaries and plugin repository X-LIBDIR = $(PREFIX)/lib X+LIBDIR = ${DATADIR} X X # Server only - Output directory X-HTMLDIR = $(PREFIX)/var/www X+HTMLDIR = $(PREFIX)/www/data/munin X X # Client only - Where to put RRD files and other intenal data X-DBDIR = $(DESTDIR)/var/opt/munin X+DBDIR = $(PREFIX)/var/munin X X # Client only - Where plugins should put their states. Must be writable by X # group "munin", and should be preserved between reboots X PLUGSTATE = $(DBDIR)/plugin-state X X # Where Munin should place its logs. X-LOGDIR = $(DESTDIR)/var/log/munin X+LOGDIR = /var/log X X # Location of PID files and other statefiles. On the server, must be X # writable by the user "munin". X-STATEDIR = $(DESTDIR)/var/run/munin X+STATEDIR = /var/run/munin X X # The perl interpreter to use X PERL = $(shell which perl) X@@ -65,9 +69,8 @@ X GROUP = munin X X # Which command to use to check if the USER and GROUP to run Munin as, exists. X-GETENT = $(shell which getent || which true 2>/dev/null) X-CHECKUSER = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2")) X-CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2")) X+CHECKUSER:= $(shell grep $(USER) /etc/passwd >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2")) X+CHECKGROUP:= $(shell grep $(GROUP) /etc/group >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2")) X X CHOWN = chown X CHMOD = chmod END-of-munin-node/files/patch-Makefile.config echo x - munin-node/files/patch-munin-node.conf.in sed 's/^X//' >munin-node/files/patch-munin-node.conf.in << 'END-of-munin-node/files/patch-munin-node.conf.in' X--- munin-1.0.0pre1.orig/node/munin-node.conf.in Thu Jan 15 15:28:57 2004 X+++ munin-1.0.0pre1/node/munin-node.conf.in Sun Jan 25 14:26:15 2004 X@@ -12,7 +12,7 @@ X # Which port to bind to; X host * X user root X-group root X+group wheel X setsid yes X X # Regexps for files to ignore END-of-munin-node/files/patch-munin-node.conf.in echo x - munin-node/files/pkg-message sed 's/^X//' >munin-node/files/pkg-message << 'END-of-munin-node/files/pkg-message' X X******************************************************************** XUnless this file already existed, a sample configuration file Xhas been placed in %%PREFIX%%/etc/munin/munin-node.conf. X XPlease edit it according to your needs. X XThe Munin client will be started at system boot automatically. XYou can start it manually with: X %%PREFIX%%/etc/rc.d/munin-node.sh start X******************************************************************** X END-of-munin-node/files/pkg-message echo x - munin-node/Makefile sed 's/^X//' >munin-node/Makefile << 'END-of-munin-node/Makefile' X# New ports collection makefile for: munin-node X# Date created: 25 Januar 2004 X# Whom: Lupe Christoph <lupe@lupe-christoph.de> X# X# $FreeBSD: ports/sysutils/munin-node/Makefile,v 1.1 2004/03/02 15:54:05 mat Exp $ X# X XPORTNAME= munin XPORTVERSION= 1.0.0.p3 XPORTREVISION= 1 XCATEGORIES= sysutils perl5 XMASTER_SITES= ${MASTER_SITE_SOURCEFORGE} XMASTER_SITE_SUBDIR= munin XPKGNAMESUFFIX= -node XDISTNAME= munin_1.0.0pre3 X XMAINTAINER= lupe@lupe-christoph.de XCOMMENT= Node-specific part of Munin X XBUILD_DEPENDS= ${RUN_DEPENDS} XRUN_DEPENDS= ${SITE_PERL}/Net/Server/Fork.pm:${PORTSDIR}/net/p5-Net-Server X X.include <bsd.port.pre.mk> X X.if ${PERL_LEVEL} < 500800 XRUN_DEPENDS+= ${SITE_PERL}/Net/Domain.pm:${PORTSDIR}/net/p5-Net X.endif X XUSE_GMAKE= yes XPATCH_STRIP= -p1 XWRKSRC= ${WRKDIR}/munin-1.0.0pre3 XPKGMESSAGE= ${WRKDIR}/pkg-message XALL_TARGET= DATADIR=${DATADIR} build build-man XINSTALL_TARGET= DATADIR=${DATADIR} install-node install-node-plugins X XMAN5= munin-node.conf.5 XMAN8= munin-node-configure.8 munin-node.8 munin-run.8 X Xpre-install: X @${SED} 's@%%PREFIX%%@${LOCALBASE}@g' ${FILESDIR}/pkg-message > ${PKGMESSAGE} X @PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL X Xpost-install: X @${SED} 's@%PREFIX%@${LOCALBASE}@g' ${FILESDIR}/munin-node.sh > ${PREFIX}/etc/rc.d/munin-node.sh X @${CHMOD} +x ${PREFIX}/etc/rc.d/munin-node.sh X @if [ ! -f ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf ]; then \ X ${INSTALL_DATA} ${WRKSRC}/plugins.conf ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf; \ X fi X @${CAT} ${PKGMESSAGE} X @${INSTALL_MAN} -d ${PREFIX}/man/man5 X @${INSTALL_MAN} -d ${PREFIX}/man/man8 X @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-node.conf.5 ${PREFIX}/man/man5 X @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-node-configure.8 ${PREFIX}/man/man8 X @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-node.8 ${PREFIX}/man/man8 X @${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-run.8 ${PREFIX}/man/man8 X @PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} POST-INSTALL X @${ECHO} ${DISTNAME} | ${SED} -e 's/munin_//' > ${PREFIX}/etc/munin/VERSION.node X X.include <bsd.port.post.mk> END-of-munin-node/Makefile echo x - munin-node/distinfo sed 's/^X//' >munin-node/distinfo << 'END-of-munin-node/distinfo' XMD5 (munin_1.0.0pre3.tar.gz) = f1aea51a61304b824dd61d7ad7808f6d XSIZE (munin_1.0.0pre3.tar.gz) = 120572 END-of-munin-node/distinfo echo x - munin-node/pkg-deinstall sed 's/^X//' >munin-node/pkg-deinstall << 'END-of-munin-node/pkg-deinstall' X#! /bin/sh X# X# $Log: pkg-deinstall,v $ X# Revision 1.2 2004/02/06 18:49:58 lupe X# Fixes for pkg_add compatibility. X# X# X Xask() { X local question default answer X X question=$1 X default=$2 X if [ -z "${PACKAGE_BUILDING}" ]; then X read -p "${question} [${default}]? " answer X fi X if [ x${answer} = x ]; then X answer=${default} X fi X echo ${answer} X} X Xyesno() { X local dflt question answer X X question=$1 X dflt=$2 X while :; do X answer=$(ask "${question}" "${dflt}") X case "${answer}" in X [Yy]*) return 0;; X [Nn]*) return 1;; X esac X echo "Please answer yes or no." X done X} X Xstop_process() { X if [ -x ${PKG_PREFIX}/etc/rc.d/munin-node.sh ]; then X ${PKG_PREFIX}/etc/rc.d/munin-node.sh stop X fi X} X Xdelete_group() { X local g X X g=$1 X if yesno "Do you want me to remove group \"${g}\"" y; then X pw groupdel -n ${g} X echo "Done." X fi X} X Xcase $2 in X DEINSTALL) X stop_process X ;; X POST-DEINSTALL) X delete_group munin X ;; Xesac END-of-munin-node/pkg-deinstall echo x - munin-node/pkg-descr sed 's/^X//' >munin-node/pkg-descr << 'END-of-munin-node/pkg-descr' XMunin network-wide graphing framework (node) X XMunin is a tool for graphing all sorts of information about one or more Xservers and displaying it in a web interface. It uses the excellent XRRDTool (written by Tobi Oetiker) and is written in Perl. Munin has a Xmaster/node architecture. The master connects to all the nodes at regular Xintervals, and asks them for data. It then stores the data in RRD-files, Xand (if needed) updates the graphs. One of the main goals have been ease Xof creating own "plugins" (graphs). X XThis is the node part. It is used on all machines Munin shall watch. X XWWW: http://www.linpro.no/projects/munin/ END-of-munin-node/pkg-descr echo x - munin-node/pkg-install sed 's/^X//' >munin-node/pkg-install << 'END-of-munin-node/pkg-install' X#! /bin/sh X# X# $Log: pkg-install,v $ X# Revision 1.2 2004/02/06 18:49:58 lupe X# Fixes for pkg_add compatibility. X# X# X Xask() { X local question default answer X X question=$1 X default=$2 X if [ -z "${PACKAGE_BUILDING}" ]; then X read -p "${question} [${default}]? " answer X fi X if [ x${answer} = x ]; then X answer=${default} X fi X echo ${answer} X} X Xyesno() { X local dflt question answer X X question=$1 X dflt=$2 X while :; do X answer=$(ask "${question}" "${dflt}") X case "${answer}" in X [Yy]*) return 0;; X [Nn]*) return 1;; X esac X echo "Please answer yes or no." X done X} X Xmake_group() { X local g X X g=$1 X X if pw group show "${g}" >/dev/null 2>&1; then X echo "You already have a group \"${g}\", so I will use it." X else X echo "You need a group \"${g}\"." X if which -s pw && yesno "Would you like me to create it" y; then X pw groupadd ${g} || exit X echo "Done." X else X echo "Please create it, and try again." X if ! grep -q "^${u}:" /etc/passwd; then X echo "While you're at it, please create a user \"${u}\" too," X echo "with a default group of \"${g}\"." X fi X exit 1 X fi X fi X} X Xinit_plugins() { X if [ -f ${PKG_PREFIX}/etc/munin/VERSION.node ]; then X prevver=$(cat ${PKG_PREFIX}/etc/munin/VERSION.node) X fi X X mkdir -p ${PKG_PREFIX}/etc/munin/plugins ${PKG_PREFIX}/var/munin/plugin-state X X if [ -n "$prevver" ]; then X echo -n "Initializing new plugins.." X ${PKG_PREFIX}/sbin/munin-node-configure --shell --newer "${prevver%-*}" | sh -x X else X echo -n "Initializing plugins.." X ${PKG_PREFIX}/sbin/munin-node-configure --shell | sh -x X fi X echo "done." X} X X X######################################################################## X Xcase $2 in X PRE-INSTALL) X make_group munin X ;; X POST-INSTALL) X init_plugins X ;; Xesac END-of-munin-node/pkg-install echo x - munin-node/pkg-plist sed 's/^X//' >munin-node/pkg-plist << 'END-of-munin-node/pkg-plist' Xetc/munin/munin-node.conf Xetc/munin/plugin-conf.d/plugins.conf Xetc/rc.d/munin-node.sh Xsbin/munin-node Xsbin/munin-node-configure Xsbin/munin-run Xshare/munin/plugins/apache_accesses Xshare/munin/plugins/apache_processes Xshare/munin/plugins/apache_volume Xshare/munin/plugins/bind9 Xshare/munin/plugins/cpu Xshare/munin/plugins/df Xshare/munin/plugins/df_inode Xshare/munin/plugins/exim_mailqueue Xshare/munin/plugins/exim_mailstats Xshare/munin/plugins/hddtemp Xshare/munin/plugins/if_ Xshare/munin/plugins/if_errcoll_ Xshare/munin/plugins/ircu Xshare/munin/plugins/load Xshare/munin/plugins/mailman Xshare/munin/plugins/memory Xshare/munin/plugins/multips Xshare/munin/plugins/munin_graph Xshare/munin/plugins/munin_update Xshare/munin/plugins/mysql_bytes Xshare/munin/plugins/mysql_isam_space_ Xshare/munin/plugins/mysql_queries Xshare/munin/plugins/mysql_slowqueries Xshare/munin/plugins/mysql_threads Xshare/munin/plugins/named Xshare/munin/plugins/netstat Xshare/munin/plugins/open_files Xshare/munin/plugins/plugins.history Xshare/munin/plugins/pop_stats Xshare/munin/plugins/postfix_mailqueue Xshare/munin/plugins/postfix_mailstats Xshare/munin/plugins/postfix_mailvolume Xshare/munin/plugins/processes Xshare/munin/plugins/ps_ Xshare/munin/plugins/psu_ Xshare/munin/plugins/samba Xshare/munin/plugins/snmp__if_ Xshare/munin/plugins/spamstats Xshare/munin/plugins/squid_cache Xshare/munin/plugins/squid_icp Xshare/munin/plugins/squid_requests Xshare/munin/plugins/squid_traffic Xshare/munin/plugins/surfboard Xshare/munin/plugins/swap Xshare/munin/plugins/sybase_space Xshare/munin/plugins/vmstat X@unexec rmdir %D/var/munin/plugin-state 2>/dev/null || true X@unexec rmdir %D/var/munin 2>/dev/null || true X@dirrm share/munin/plugins X@unexec rmdir %D/share/munin 2>/dev/null || true X@unexec rm -rf %D/etc/munin/plugins 2>/dev/null || true X@unexec rmdir %D/etc/munin/plugin-conf.d 2>/dev/null || true X@unexec rmdir %D/etc/munin 2>/dev/null || true X@unexec echo "If you want to *completely* remove munin-node, you have to" X@unexec echo " rm -rf %D/var/munin and %D/etc/munin %D/www/data/munin" X@unexec echo "They have to be left on the system because you may be performing" X@unexec echo "an update. This process can't tell." END-of-munin-node/pkg-plist exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403111133.i2BBXu1W043847>