pkgsrc/sysutils/munin-server/patches/patch-aa

92 lines
3.1 KiB
Text

$NetBSD: patch-aa,v 1.2 2006/07/21 23:21:20 abs Exp $
--- Makefile.config.orig 2005-01-10 11:38:22.000000000 +0100
+++ Makefile.config
@@ -7,32 +7,39 @@
#
# the base of the Munin installation.
#
-PREFIX = $(DESTDIR)/opt/munin
+ifdef $(PREFIX)
+UPREFIX=$(PREFIX)
+else
+UPREFIX=/usr/pkg
+endif
# Where Munin keeps its configurations (server.conf, client.conf, ++)
-CONFDIR = $(DESTDIR)/etc/opt/munin
+CONFDIR ?= $(UPREFIX)/etc/munin
+
+# Where NetBSD pkgsrc installs example config files
+EGDIR = $(UPREFIX)/share/examples/munin
# Server only - where to put munin-cron
-BINDIR = $(PREFIX)/bin
+BINDIR = $(UPREFIX)/bin
# Client only - where to put munin-node, munin-node-configure, and munin-run
-SBINDIR = $(PREFIX)/sbin
+SBINDIR = $(UPREFIX)/sbin
# Where to put text and html documentation
-DOCDIR = $(PREFIX)/doc
+DOCDIR = $(UPREFIX)/share/doc/munin
# Where to put man pages
-MANDIR = $(PREFIX)/man
+MANDIR = $(UPREFIX)/man
# Where to put internal binaries and plugin repository
-LIBDIR = $(PREFIX)/lib
+LIBDIR = $(UPREFIX)/lib/munin
# Server only - Output directory
-HTMLDIR = $(PREFIX)/var/www
+HTMLDIR = $(UPREFIX)/www/munin/data
CGIDIR = $(HTMLDIR)/cgi
# Client only - Where to put RRD files and other intenal data
-DBDIR = $(DESTDIR)/var/opt/munin
+DBDIR = $(DESTDIR)/var/munin
# Client only - Where plugins should put their states. Must be writable by
# group "munin", and should be preserved between reboots
@@ -45,14 +52,14 @@ LOGDIR = $(DESTDIR)/var/log/munin
# writable by the user "munin".
STATEDIR = $(DESTDIR)/var/run/munin
-# The perl interpreter to use
-PERL = $(shell which perl)
+# The perl interpreter to use (passed in by pkgsrc)
+PERL = ${PERL5}
# The python interpreter to use (used by some plugins)
PYTHON = /usr/bin/env python
# Server only - Where to install the perl libraries
-PERLLIB = $(DESTDIR)$(shell $(PERL) -V:sitelib | cut -d= -f2 | sed "s/[\';]//g")
+PERLLIB = ${PERL5_SITELIB}
# Client only - Install plugins for this architecture
OSTYPE = $(shell uname | tr '[A-Z]' '[a-z]')
@@ -65,16 +72,15 @@ HOSTNAME = $(shell hostname)
VERSION = $(shell cat RELEASE)
# User to run munin as
-USER = munin
-GROUP = munin
+USER = ${MUNIN_USER}
+GROUP = ${MUNIN_GROUP}
# Default user to run the plugins as
PLUGINUSER = nobody
# Which command to use to check if the USER and GROUP to run Munin as, exists.
-GETENT = $(shell which getent || which true 2>/dev/null)
-CHECKUSER = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2"))
-CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2"))
+CHECKUSER = $(shell grep $(USER) /etc/passwd >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
+CHECKGROUP = $(shell grep $(GROUP) /etc/group >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
CHOWN = chown
CHMOD = chmod