#
# Makefile for installing nabou 2.1
#
# Edit it to suit your needs, a configure
# script does not exist.

#
# installation base directory
PREFIX  = /usr

#
# manual pages
MAN     = $(PREFIX)/man/man1

#
# the location of the nabou program itself
SBIN    = $(PREFIX)/sbin

#
# docs, such as readme and samples...
DOC     = $(PREFIX)/doc/nabou-2.1

#
# default config destination
ETC     = /etc/nabou.d

#
# default database directory (as used in the sample config)
DB      = /var/nabou

#
# which sample config to use as the default
SAMPLE  = sample_configs/linuxrc

#
# the install binary, required
INSTALL = /usr/bin/install

#
# permissions for nabou program
N_PERM  = 700

#
# permissions for default config
C_PERM  = 600

#
# permissions for nabou config dir
D_PERM  = 750

#
# owner of the files
OWNER   = root

#
# group of the files
GROUP   = wheel

#
# Docs to install
DOCS    = COPYING  Changelog  README  README.modules  TODO  VERSION dbformat.txt




all:
	@echo "Type 'make install' after editing the Makefile!"



install:
	$(INSTALL) -d -m 755 -o $(OWNER) -g $(GROUP) $(PREFIX) $(MAN) $(SBIN) $(DOC)
	$(INSTALL) -d -m $(D_PERM) -o $(OWNER) -g $(GROUP) $(ETC)
	$(INSTALL) -d -m $(N_PERM) -o $(OWNER) -g $(GROUP) $(DB)

	$(INSTALL) -m $(N_PERM) -o $(OWNER) -g $(GROUP) bin/nabou $(SBIN)/
	$(INSTALL) -m $(C_PERM) -o $(OWNER) -g $(GROUP) $(SAMPLE) $(ETC)/nabourc
	$(INSTALL) -m 644 -o $(OWNER) -g $(GROUP) man/* $(MAN)/

	$(INSTALL) -d -m 755 -o $(OWNER) -g $(GROUP) $(DOC)/sample_configs
	$(INSTALL) -m 644 -o $(OWNER) -g $(GROUP) sample_configs/* $(DOC)/sample_configs/
	$(INSTALL) -m 644 -o $(OWNER) -g $(GROUP) $(DOCS) $(DOC)/

	@echo "NABOU istalled. Edit the config file $(ETC)/nabourc and"
	@echo "install a cronjob to run nabou on a regular basis."