#!/bin/sh

# This script is called by install.sh and uninstall.sh to determine
# where the installed binaries and man pages are

# Note that the script will break if PREFIX is not an absolute path
# We allow the user to supply the prefix on the command line, e.g.
# PREFIX=/usr/ ; make install
# Thanks to D Richard Felker III for this suggestion
if [ -z "$PREFIX" ]; then
	PREFIX="/usr/"
fi

# Try to determine which language to use
if [ -z "$LANGUAGE" ]; then
	LANGUAGE=`echo $LANG | cut -f1 -d_`
fi

# If there are no man pages for their language, default to English
if [ ! -d doc/$LANGUAGE/man ]; then
	LANGUAGE="en"
fi

# The location of programs that the end user may wish to use
BIN="$PREFIX/bin/"
# The location of the server programs
SBIN="$PREFIX/sbin/"
# The directory to put man pages which describe the end-user programs
MAN1="$PREFIX/man/man1/"
mkdir $MAN1 > /dev/null 2>$1
# The directory to put man pages which describe configuration file formats
MAN5="$PREFIX/man/man5/"
mkdir $MAN5 > /dev/null 2>&1
# The directory to put man pages which describe the server programs
MAN8="$PREFIX/man/man8/"
mkdir $MAN8 > /dev/null 2>&1
# The directory to put a copy of the MaraDNS documents on the system
DOCS="$PREFIX/lib/maradns-$VERSION"

mkdir /etc/maradns > /dev/null 2>&1
mkdir /etc/maradns/dev > /dev/null 2>&1 

