# 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.
# 
PREFIX     = $(DESTDIR)/

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

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

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

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

# Where to put man pages
MANDIR     = $(PREFIX)/usr/share/man/munin

# Where to put internal binaries and plugin repository
LIBDIR     = $(PREFIX)/usr/share/munin

# Server only - Output directory
HTMLDIR    = $(PREFIX)/var/www/html/munin
CGIDIR     = $(PREFIX)/usr/libexec/cgi-bin

# Client only - Where to put RRD files and other intenal data
DBDIR      = $(DESTDIR)/var/lib/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
PERL       = $(shell which perl)

# 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_stem | cut -d= -f2 | sed "s/[\';]//g")/current

# 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   = localhost.localdomain

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

# User to run munin as
USER       = munin
GROUP      = munin

# Default user to run the plugins as
PLUGINUSER = munin

# 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  = \#
CHECKGROUP = \#
CHOWN      = \#
CHMOD      = \#
CHGRP      = \#

#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"))

#CHOWN      = chown
#CHMOD      = chmod
#CHGRP      = chgrp
