#!/bin/sh

if [ "x${XAW3DSRC}" = "x" ]
then
	case $0 in
	/* )	XAW3DSRC=`dirname $0`	;;
	* )	XAW3DSRC=${PWD}/$0	;;
	esac
	XAW3DSRC=`dirname ${XAW3DSRC}`
fi
echo Xaw3d sources are taken from ${XAW3DSRC}

MIT=${MIT:-`dirname ${XAW3DSRC}`/mit}
echo X11R5 unpacked sources are in ${MIT}

echo -n 'Accept [Y/N] ? '

read ans

case $ans in
Y* | y*) 
	echo Unpacking Xaw3d sources ...

	(cd ${MIT}; tar xf ${XAW3DSRC}/Xaw3d-0.6B.tar)
	patch -p -s < ${XAW3DSRC}/Xaw3d.patch
	patch -p -s < ${XAW3DSRC}/xterm-linux.patch
	cp ${XAW3DSRC}/jump_* ${MITSRC}/lib/Xaw3d
	cp ${XAW3DSRC}/laylex.c ${MITSRC}/lib/Xaw3d

	# comment the next line out if you do not
	# want to apply my inofficial patches
	patch -p -s < ${XAW3DSRC}/Xaw3d.new.diff
	;;

*)	exit 0;;
esac
