#!/bin/csh -f
# RCSid $Id: installib,v 1.1 2003/02/28 20:06:51 greg Exp $
#
# Install library files
#
again2:
echo -n "Where do you want the library files [/usr/local/lib/ray]? "
set ldir=$<
(echo $ldir) >/dev/null
if ( $status ) goto again2
set ldir=$ldir
if ( "$ldir" == "" ) then
	set ldir=/usr/local/lib/ray
else if ( "$ldir" !~ /* ) then
	echo "Directory must be relative to root, please reenter"
	goto again2
endif
if ( $ldir != $cwd/lib ) then
	if ( ! -d $ldir ) then
		mkdir $ldir
		if ( $status ) then
			echo "Cannot create directory, please reenter"
			goto again2
		endif
	endif
	set d1=(`ls -id lib`)
	set d2=(`ls -id $ldir`)
	if ($d1[1] != $d2[1]) then
		echo -n "Install library files now [n]? "
		if ( "$<" =~ [yY]* ) then
			echo -n "Copying library files to $ldir... "
			(cd lib ; tar -cf - *) | (cd $ldir ; tar -xf -)
			echo "Done."
		endif
	endif
	unset d1 d2
endif
