# This file specifies where Munin will look for things after you've
# run 'make' in the source directory.  Modify it to suit your needs.

# DESTDIR is empty during building, and optionally set to point to
# a shadow tree during make install.

#
# the base of the Munin installation.
# 
UPREFIX=${DESTDIR}$(PREFIX)

# Where Munin keeps its configurations (server.conf, client.conf, ++)
CONFDIR   ?= $(UPREFIX)/etc/munin

# Server only - where to put munin-cron
BINDIR     = $(UPREFIX)/bin

# Client only - where to put munin-node, munin-node-configure, and munin-run
SBINDIR    = $(UPREFIX)/sbin

# Where to put text and html documentation
DOCDIR     = $(UPREFIX)/share/doc/munin

# Where to put man pages
MANDIR     = $(UPREFIX)/${PKGMANDIR}

# Where to put internal binaries and plugin repository
LIBDIR     = $(UPREFIX)/lib/munin

# Server only - Output directory
HTMLDIR    = $(UPREFIX)/www/munin/data
CGIDIR     = $(HTMLDIR)/cgi

# Client only - Where to put RRD files and other intenal data
DBDIR      = $(DESTDIR)/var/munin

# Client only - Where plugins should put their states. Must be writable by
# group "munin", and should be preserved between reboots
PLUGSTATE  = $(DBDIR)/plugin-state

# Where Munin should place its logs.
LOGDIR     = $(DESTDIR)/var/log/munin

# Location of PID files and other statefiles. On the server, must be
# writable by the user "munin".
STATEDIR   = $(DESTDIR)/var/run/munin

# The perl interpreter to use (passed in by pkgsrc)
PERL       = ${PERL5}

# The python interpreter to use (used by some plugins)
PYTHON     = ${PYTHONBIN}

# Server only - Where to install the perl libraries
PERLLIB    = ${PERL5_SITELIB}

# Client only - Install plugins for this architecture
OSTYPE     = $(shell uname | tr '[A-Z]' '[a-z]')

# How to figure out the hostname. (Only used in default configuration
# files)
HOSTNAME   = $(shell hostname)

# Munin version number.
VERSION    = $(shell cat RELEASE)

# User to run munin as
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.
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
CHGRP      = chgrp
