#!/bin/sh
# Shell script to kick off installation process
base="."
dir=$2
while test $dir != "." && test $base != "install"
do
	base=`basename $dir`
	dir=`dirname $dir`
done
if test $base != "install"
then
	echo "usage: MacOSX-power.sh <emu path> <cdpath>/install <inferno root>"
	exit 1
fi
CDPATH=$dir
EMU=$1
case $1 in
	"")	echo "usage: MacOSX-power.sh <emu path> <cdpath>/install <inferno root>"
		exit 1;;
	*)	if test -d $3
		then
			$EMU -G -r$CDPATH /dis/install/install.dis -r $3 -p MacOSX
		else
			echo "inferno root directory not found"
			exit 1
		fi;;
esac
if test -e $CDPATH/LICENCE
then
	cp $CDPATH/LICENCE $3/LICENCE
fi
cp $EMU $3/MacOSX/power/bin/emu
exit 0

