| 1 |
# -*- makefile -*- |
|---|
| 2 |
# |
|---|
| 3 |
# This is the Makefile.config file to use for a "clean" distribution. |
|---|
| 4 |
# |
|---|
| 5 |
# This file specifies where Munin will look for things after you've |
|---|
| 6 |
# run 'make' in the source directory. Modify it to suit your needs. |
|---|
| 7 |
|
|---|
| 8 |
# DESTDIR is meant only for use when making Munin packages. Unless |
|---|
| 9 |
# you're doing packaging do NOT set it. |
|---|
| 10 |
# DESTDIR is empty during building, and optionally set to point to |
|---|
| 11 |
# a shadow tree during make install. |
|---|
| 12 |
|
|---|
| 13 |
# Note: There is a need for a VARDIR, with DBDIR, PLUGSTATE, HTMLDIR |
|---|
| 14 |
# and LOGDIR as subdirectories. Today, DBDIR contains configured |
|---|
| 15 |
# domains, as well as PLUGSTATE, and we risk collisions. |
|---|
| 16 |
|
|---|
| 17 |
# |
|---|
| 18 |
# the base of the Munin installation. |
|---|
| 19 |
# |
|---|
| 20 |
PREFIX = $(DESTDIR)/opt/munin |
|---|
| 21 |
|
|---|
| 22 |
# Where Munin keeps its configurations (server.conf, client.conf, ++) |
|---|
| 23 |
CONFDIR = $(DESTDIR)/etc/opt/munin |
|---|
| 24 |
|
|---|
| 25 |
# Server only - where to put munin-cron |
|---|
| 26 |
BINDIR = $(PREFIX)/bin |
|---|
| 27 |
|
|---|
| 28 |
# Client only - where to put munin-node, munin-node-configure, and munin-run |
|---|
| 29 |
SBINDIR = $(PREFIX)/sbin |
|---|
| 30 |
|
|---|
| 31 |
# Where to put text and html documentation |
|---|
| 32 |
DOCDIR = $(PREFIX)/doc |
|---|
| 33 |
|
|---|
| 34 |
# Where to put man pages |
|---|
| 35 |
MANDIR = $(PREFIX)/man |
|---|
| 36 |
|
|---|
| 37 |
# Where to put internal binaries and plugin repository |
|---|
| 38 |
LIBDIR = $(PREFIX)/lib |
|---|
| 39 |
|
|---|
| 40 |
# Server only - Output directory |
|---|
| 41 |
HTMLDIR = $(PREFIX)/www/docs |
|---|
| 42 |
CGIDIR = $(PREFIX)/www/cgi |
|---|
| 43 |
|
|---|
| 44 |
# Server only - spool directory for data gathered from nodes by |
|---|
| 45 |
# munin-gather - experimental. Place on ramdisk to make munin |
|---|
| 46 |
# scale better. On many versions of Linux as well as on Solaris |
|---|
| 47 |
# /tmp will be a ramdisk. |
|---|
| 48 |
|
|---|
| 49 |
SSPOOLDIR = $(PREFIX)/spool |
|---|
| 50 |
|
|---|
| 51 |
# Suggested directory name for a pulic ramdisk based tmp directory. |
|---|
| 52 |
# SSPOOLDIR := /tmp/muninspool |
|---|
| 53 |
|
|---|
| 54 |
# Client only - Where to put RRD files and other intenal data |
|---|
| 55 |
DBDIR = $(DESTDIR)/var/opt/munin |
|---|
| 56 |
|
|---|
| 57 |
# Client only - Where plugins should put their states. Must be writable by |
|---|
| 58 |
# group "munin", and should be preserved between reboots |
|---|
| 59 |
PLUGSTATE = $(DBDIR)/plugin-state |
|---|
| 60 |
|
|---|
| 61 |
# Where Munin should place its logs. |
|---|
| 62 |
LOGDIR = $(PREFIX)/log/munin |
|---|
| 63 |
|
|---|
| 64 |
# Location of PID files and other statefiles. On the server, must be |
|---|
| 65 |
# writable by the user "munin". |
|---|
| 66 |
STATEDIR = $(DESTDIR)/var/run/munin |
|---|
| 67 |
|
|---|
| 68 |
# The perl interpreter to use |
|---|
| 69 |
PERL := $(shell which perl) |
|---|
| 70 |
|
|---|
| 71 |
# The python interpreter to use (used by some plugins) |
|---|
| 72 |
PYTHON := /usr/bin/env python |
|---|
| 73 |
|
|---|
| 74 |
# The ruby interpreter to use (used by some plugins) |
|---|
| 75 |
RUBY := /usr/bin/env ruby |
|---|
| 76 |
|
|---|
| 77 |
# The java runtime to use (used by some plugins) |
|---|
| 78 |
JAVARUN := /usr/bin/java |
|---|
| 79 |
|
|---|
| 80 |
# The java library dir to use (used by some plugins) |
|---|
| 81 |
# this is needed in order to be able to install |
|---|
| 82 |
# java libraries in a custom location. Many distrubutions |
|---|
| 83 |
# enforce a spesific location for java libraries. |
|---|
| 84 |
JAVALIBDIR:= $(LIBDIR) |
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
# A modern (posix) shell. We're not looking for arrays, but $() and |
|---|
| 88 |
# other modern stuff is expected. On a posix-system the expression |
|---|
| 89 |
# below will find the right shell. Most Unixes released the last 10 |
|---|
| 90 |
# years are POSIX compliant enough for this to work (he said bravely). |
|---|
| 91 |
# |
|---|
| 92 |
# On Linux /bin/sh, SunOS/Solaris /usr/xpg4/bin/sh or /bin/ksh |
|---|
| 93 |
# In general: bash or ksh will work |
|---|
| 94 |
# |
|---|
| 95 |
GOODSH := $(shell PATH=`getconf PATH` sh -c 'type sh | sed "s/.* //"') |
|---|
| 96 |
|
|---|
| 97 |
# Path of bash for bash specific plugins |
|---|
| 98 |
BASH := /bin/bash |
|---|
| 99 |
|
|---|
| 100 |
# Server only - Where to install the perl libraries |
|---|
| 101 |
PERLSITELIB := $(shell $(PERL) -V:sitelib | cut -d"'" -f2) |
|---|
| 102 |
PERLLIB = $(DESTDIR)$(PERLSITELIB) |
|---|
| 103 |
|
|---|
| 104 |
# Client only - Install plugins for this architecture |
|---|
| 105 |
OSTYPE := $(shell uname | tr '[A-Z]' '[a-z]') |
|---|
| 106 |
|
|---|
| 107 |
# How to figure out the hostname. (Only used in default configuration |
|---|
| 108 |
# files) |
|---|
| 109 |
HOSTNAME := $(shell hostname) |
|---|
| 110 |
|
|---|
| 111 |
# What is the safest way to create a tempfile. |
|---|
| 112 |
# Default is to figure it out by testing various methods. |
|---|
| 113 |
# Replace this with a known platform-specific method |
|---|
| 114 |
MKTEMP := $(shell ./test-mktemp) |
|---|
| 115 |
|
|---|
| 116 |
# Munin version number. |
|---|
| 117 |
VERSION := $(shell ./getversion) |
|---|
| 118 |
|
|---|
| 119 |
# User to run munin as |
|---|
| 120 |
USER := munin |
|---|
| 121 |
GROUP := munin |
|---|
| 122 |
|
|---|
| 123 |
# Default user to run the plugins as |
|---|
| 124 |
PLUGINUSER := nobody |
|---|
| 125 |
|
|---|
| 126 |
# Which command to use to check if the USER and GROUP to run Munin as, exists. |
|---|
| 127 |
# These will work on most modern OSes: |
|---|
| 128 |
# |
|---|
| 129 |
GETENT := $(shell which getent || which true 2>/dev/null) |
|---|
| 130 |
CHECKUSER := $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2")) |
|---|
| 131 |
CHECKGROUP := $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2")) |
|---|
| 132 |
|
|---|
| 133 |
# For OSX, comment out the previous two lines and comment in these |
|---|
| 134 |
# |
|---|
| 135 |
#CHECKUSER := $(shell nicl . -read /users/$(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2")) |
|---|
| 136 |
#CHECKGROUP := $(shell nicl . -read /groups/$(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2")) |
|---|
| 137 |
|
|---|
| 138 |
# For OSX 10.5 (Leopard), use the following two lines instead of what's above |
|---|
| 139 |
# |
|---|
| 140 |
#CHECKUSER := $(shell dscl . -read /Users/$(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2")) |
|---|
| 141 |
#CHECKGROUP := $(shell dscl . -read /Groups/$(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2")) |
|---|
| 142 |
|
|---|
| 143 |
|
|---|
| 144 |
# For HP-UX, use these instead: |
|---|
| 145 |
# |
|---|
| 146 |
#CHECKUSER := $(shell pwget -n $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2")) |
|---|
| 147 |
#CHECKGROUP := $(shell grget -n $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2")) |
|---|
| 148 |
|
|---|
| 149 |
CHOWN := chown |
|---|
| 150 |
CHMOD := chmod |
|---|
| 151 |
CHGRP := chgrp |
|---|
| 152 |
|
|---|
| 153 |
# Java compiler stuff - only needed on the buildhost |
|---|
| 154 |
JC := javac |
|---|
| 155 |
JFLAGS := -g -source 1.5 -target 1.5 |
|---|
| 156 |
JAR := jar |
|---|
| 157 |
|
|---|
| 158 |
# Check if the java compiler works |
|---|
| 159 |
JCVALID := $(shell $(JC) -version >/dev/null 2>/dev/null && echo "yes") |
|---|
| 160 |
|
|---|
| 161 |
# Check whether setruid functionality can be used |
|---|
| 162 |
HASSETR := $(shell perl -e 'use Config; my @vars=("d_setruid", "d_setreuid", "d_setresuid"); foreach my $$var (@vars) { if ($$Config{$$var} eq "define") { print "1\n"; exit 0; } } print "0\n"; exit 0;' ) |
|---|