#!/bin/sh

# Show them the disclaimer
cat 00README.FIRST
echo -----
echo

# Try to determine what kind of system we are running
UNAME=`uname -s`

# Make sure the Makefile has the current version number of MaraDNS
cp VERSION Makefile
echo COMPILED=\"$UNAME system at `date`\" >> Makefile
echo COMPILED_DEBUG=\"$UNAME system at `date`\ \(Debug\)\" >> Makefile

# Most of the time, the Linux Makefile should work
cat Makefile.linux >> Makefile

# Give them a message dependent on what kind of systme they have
if echo $UNAME | grep -i linux > /dev/null ; then
	echo It looks like you are using Linux\; just type in \'make\'
elif echo $UNAME | grep -i sunos > /dev/null ; then
	cp VERSION Makefile
	echo COMPILED=\"$UNAME box \(Solaris Makefile\) at `date`\" >> Makefile
	cat Makefile.solaris >> Makefile
	echo It looks like you are using Solaris\; typing in \'make\'
	echo should work
	echo Note that MaraDNS does not function as a recursive nameserver
	echo under Solaris.  Read the FAQ to find out why.
	exit 0
elif echo $UNAME | grep -i freebsd > /dev/null ; then
	echo It looks like you are using FreeBSD\; this should compile
	echo fine by typing in \'make\'.  There is an official port here:
	echo
	echo	http://www.freebsd.org/cgi/query-pr.cgi?pr=28389
elif echo $UNAME | grep -i openbsd > /dev/null ; then
	echo It looks like you are using OpenBSD\; please read doc/faq.txt
	echo before trying to compile MaraDNS
else
	echo I am not familiar with the OS you are running.  Please email
	echo Sam a copy of a working Makefile, and the output of 'uname -s'
	echo if you can get this to compile, install, and run.
fi

echo

