:
# First time install script
# @(#)install.in	4.2 94/02/23 GIE REL"
prefix=/usr/local
if [ ! -w $prefix ] ; then
	echo "$prefix must exist and be writable"
	exit 1
fi
# check if destination directories available and if not make
for x in bin lib include man man/man1 man/man3
do
	if [ ! -d ${prefix}/$x ] ; then
		mkdir ${prefix}/$x
		if [ $? -ne 0 ] ; then
			echo "failed to make directory ${prefix}/$x"
			echo "install stopped"
			exit 1
		fi
	fi
done
# proceed to make software
cd src
make install
if [ $? -ne 0 ] ; then
	echo "make failed, install stopped"
	exit 1
fi
# install man files
cd ../man/man1
echo "installing man.1 files"
for x in *
do
	cp $x ${prefix}/man/man1/$x
done
cd ../man3
echo "installing man.3 files"
for x in *
do
	cp $x ${prefix}/man/man3/$x
done
# install reference files
cd ../../nad
sh install
if [ $? -ne 0 ] ; then
	echo "Installation of proj system complete"
fi
exit 0
