#!/bin/sh
##
## NO LONGER NEEDED: 4 Jul 2009


# $poplocal/local/rclib/install_rclib
#   Aaron Sloman Last Modified:  7 Mar 2000
#   (Name of file changed.)

## NB Assumes that the directory $poplocal/local/ exists

# If this program is run in the directory $poplocal/local/rclib
# it will install some of the programs in $poplocal/local/auto and lib
# and the help and teach files in $poplocal/local/help and
# $poplocal/local/teach
# May later need to be extended for ref files

local=$poplocal/local
rclib=$poplocal/local/rclib

# Based partly on suggestions by Anthony Worrall
echo $local exists

if [ ! -d $local/auto ]
then mkdir $local/auto
fi

if [ ! -d $local/lib ]
then mkdir $local/lib
fi

if [ ! -d $local/help ]
then mkdir $local/help
fi

if [ ! -d $local/teach ]
then mkdir $local/teach
fi

if [ ! -d $local/ref ]
then mkdir $local/ref
fi


cd $rclib

echo "making new links"

# The main link, which makes everything else available after
# the pop-11 command: uses rclib

cd $local/lib
ln -s ../rclib/rclib.p .

cd $local/teach
ln -s ../rclib/teach/rclib_demo.p .

ln -s ../rclib/teach/rc_linepic .
ln -s ../rclib/teach/rc_control_panel .

cd $local/help
ln -s ../rclib/help/rclib .
ln -s ../rclib/help/rclib_news .

echo "done"

exit

# The rest of this is no longer recommended

echo "making backup directory saved in" `pwd`
mkdir saved saved/auto saved/help saved/lib saved/teach

echo "moving old versions to backup directories"

mv -f  $poplocal/local/help/rc_background saved/help
mv -f  $poplocal/local/help/rc_circle saved/help
mv -f  $poplocal/local/help/rc_linepic saved/help
mv -f  $poplocal/local/help/rc_mouse_coords saved/help
mv -f  $poplocal/local/help/rc_window_coords saved/help
mv -f  $poplocal/local/help/rc_window_dimensions saved/help

# Maybe don't do this outside Birmingham
# mv -f  $poplocal/local/help/rc_swap_context saved/help

mv -f $poplocal/local/teach/rc_demo saved/teach
mv -f $poplocal/local/teach/rc_linepic saved/teach

echo "files saved"
ls -l saved

echo "making new links"

cd $local/lib
ln -s ../rclib/rclib.p .

# The rest of this is optional
cd $local/auto
ln -s ../rclib/auto/*.p .

cd $local/lib
ln -s ../rclib/lib/*.p .

cd $local/teach
ln -s ../rclib/teach/*.p .

cd $local/help
ln -s ../rclib/help/* .

echo "done"
