#
echo -n "Update VMS command file directories from CCP4WS [y]: "
set getvms=$<
if ( $getvms !~ n* && $getvms !~ N*) then
   echo "*Getting command files from CCP4*"
   $CCP4_MASTER/laue/dl/getvms_coms
   echo "*Command files now updated*"
   echo " "
endif
set HOSTNAME = `hostname`
set mtalloc=""
if ($HOSTNAME == "dlpx1") then
   echo "dlpx1 devices /dev/ex1"
   echo "              /dev/ex1ns   (no byte swap)"
   echo "              /dev/ex2"
   echo "              /dev/ex2ns   (no byte swap)"
   echo "              /dev/qic"
   echo "              /dev/qicns   (no byte swap)"
   echo " "
   echo -n "Tape device [/dev/ex1ns]: "
   set tape = $<
   if ($tape == "") set tape = "/dev/ex1ns"
else if ($HOSTNAME == "cxa") then
   echo -n "Allocate 1600bpi tape drive (y/n) [y]: "
   set alloc = $<
   if ($alloc =~ n* || $alloc =~ N*) then
      echo -n "Tape device: "
      set tape = $<
   else
      set temp = `tpalloc -d 1600`
      set tape = $temp[1]
      echo "Mount tape on drive "$tape
      echo -n "Enter <CR> to continue..."
      set tt=$<
      set mtalloc="yes"
   endif
else
   echo -n "Tape device: "
   set tape = $<
endif
#
# Copy selected ccp4 related programs to temporary directories
#
echo "Making temporary copies of selected ccp4 programs etc.:-"
mkdir /scr1/temp$$dir
mkdir /scr1/temp$$dir/ccp4
mkdir /scr1/temp$$dir/ccp4/lib
mkdir /scr1/temp$$dir/ccp4/lib/src
mkdir /scr1/temp$$dir/ccp4/doc
mkdir /scr1/temp$$dir/ccp4/doc/Libs
mkdir /scr1/temp$$dir/ccp4/lib/data
mkdir /scr1/temp$$dir/ccp4/x-windows
mkdir /scr1/temp$$dir/ccp4/x-windows/xdl_view
mkdir /scr1/temp$$dir/ccp4/x-windows/xdl_view/src
mkdir /scr1/temp$$dir/ccp4/x-windows/xdl_view/doc
mkdir /scr1/temp$$dir/ccp4/x-windows/xdl_view/templates
echo "Source files for ccp4 libraries"
cp -r $CCP4_MASTER/ccp4/lib/src /scr1/temp$$dir/ccp4/lib
/bin/rm -r /scr1/temp$$dir/ccp4/lib/src/CVS
echo "Documentation files for ccp4 libraries"
cp -r $CCP4_MASTER/ccp4/doc/Libs /scr1/temp$$dir/ccp4/doc
/bin/rm -r /scr1/temp$$dir/ccp4/doc/Libs/CVS
echo "Library data files pglib.dat, symop.lib"
cp $CCP4_MASTER/ccp4/lib/data/pglib.dat /scr1/temp$$dir/ccp4/lib/data
cp $CCP4_MASTER/ccp4/lib/data/symop.lib /scr1/temp$$dir/ccp4/lib/data
echo "Source files for xdl_view libraries"
cp -r $CCP4_MASTER/ccp4/x-windows/xdl_view/src \
/scr1/temp$$dir/ccp4/x-windows/xdl_view
/bin/rm -r /scr1/temp$$dir/ccp4/x-windows/xdl_view/src/CVS
echo "Documentation files for xdl_view libraries"
cp -r $CCP4_MASTER/ccp4/x-windows/xdl_view/doc \
/scr1/temp$$dir/ccp4/x-windows/xdl_view
/bin/rm -r /scr1/temp$$dir/ccp4/x-windows/xdl_view/doc/CVS
echo "Template  files for xdl_view libraries"
cp -r $CCP4_MASTER/ccp4/x-windows/xdl_view/templates \
/scr1/temp$$dir/ccp4/x-windows/xdl_view
/bin/rm -r /scr1/temp$$dir/ccp4/x-windows/xdl_view/templates/CVS
echo " "
echo "Writing tar tape now"
gtar -cvf $tape -C $CCP4_MASTER laue \
--exclude laue/utils/RCS --exclude laue/lib/src/RCS \
--exclude laue/src/RCS -C /scr1/temp$$dir .
echo " "
echo "Get list of tape contents"
echo " "
echo -n "Enter name of listing file: "
set listfil = $<
set DATE=`date`
echo "Tar tape of Daresbury Laboratory Laue software suite" >$listfil
echo " ">>$listfil
echo "Written on "${DATE}>> $listfil
echo " ">>$listfil
tar -tf $tape >> $listfil
echo " "
echo "Printing list of tape contents"
lpr $listfil
echo " "
echo "Deleting temporary files now"
/bin/rm -r /scr1/temp$$dir
if ($mtalloc != "") then
   echo " "
   echo "Deallocating tape drive"
   tpdealloc $tape
endif
echo " "
echo "Procedure completed"
