#
echo -n "Update Vax command file directories from ccp4ws [y]: "
set getvms=$<
if ( $getvms !~ n* && $getvms !~ N*) then
   echo "*Getting command files from CCP4WS*"
   $CCP4_MASTER/laue/dl/getvms_coms
   echo "*Command files now updated*"
endif
echo "*Create unix.for files*"
m4 -D_sgi=1 $CCP4_MASTER/dist/ccp4/lib/src/unix.m4 \
    > $CCP4_MASTER/laue/make/unixfor/unix.sgi
m4 -D_convex=1 $CCP4_MASTER/dist/ccp4/lib/src/unix.m4 \
    > $CCP4_MASTER/laue/make/unixfor/unix.cvx
m4 -D_sun=1 $CCP4_MASTER/dist/ccp4/lib/src/unix.m4 \
    > $CCP4_MASTER/laue/make/unixfor/unix.sun
m4 -D_hpux=1 $CCP4_MASTER/dist/ccp4/lib/src/unix.m4 \
    > $CCP4_MASTER/laue/make/unixfor/unix.hpx
m4 -D_AIX=1 $CCP4_MASTER/dist/ccp4/lib/src/unix.m4 \
    > $CCP4_MASTER/laue/make/unixfor/unix.aix
m4 -D_dec_fortran=1 $CCP4_MASTER/dist/ccp4/lib/src/unix.m4 \
    > $CCP4_MASTER/laue/make/unixfor/unix.dec
echo "*Making temporary directory on scratch disk*"
mkdir /scr1/tmp$$
echo "*Making LAUECHANGES file*"
cat $CCP4_MASTER/laue/dl/laue_news.txt > /scr1/tmp$$/LAUECHANGES
echo " " >> /scr1/tmp$$/LAUECHANGES
echo " " >> /scr1/tmp$$/LAUECHANGES
echo "*********************************************" >> /scr1/tmp$$/LAUECHANGES
echo "*  UPDATES TO LAUE PROGRAMS                 *" >> /scr1/tmp$$/LAUECHANGES
echo "*********************************************" >> /scr1/tmp$$/LAUECHANGES
echo " " >> /scr1/tmp$$/LAUECHANGES
echo " " >> /scr1/tmp$$/LAUECHANGES
cat $CCP4_MASTER/laue/Updates >> /scr1/tmp$$/LAUECHANGES
echo " " >> /scr1/tmp$$/LAUECHANGES
echo " " >> /scr1/tmp$$/LAUECHANGES
echo "*********************************************" >> /scr1/tmp$$/LAUECHANGES
echo "*  UPDATES TO XDL_VIEW ROUTINES             *" >> /scr1/tmp$$/LAUECHANGES
echo "*********************************************" >> /scr1/tmp$$/LAUECHANGES
echo " " >> /scr1/tmp$$/LAUECHANGES
echo " " >> /scr1/tmp$$/LAUECHANGES
cat /home/jwc/xdl_view/Changes >> /scr1/tmp$$/LAUECHANGES
echo "*Copying LAUECHANGES and LAUEINSTALL files to anonymous ftp area*"
cp /scr1/tmp$$/LAUECHANGES /nfs/ccp4a/ftp/ccp4/LAUECHANGES
ttfilter < $CCP4_MASTER/laue/dl/laue_install.utx > \
  /nfs/ccp4a/ftp/ccp4/LAUEINSTALL
echo "****NOTE FTP AREA FOR FETCHING LAUE SUITE HAS MOVED****" > \
/nfs/ftp/ccp4/LAUEINSTALL
echo "    it is now 148.79.160.77" >>/nfs/ftp/ccp4/LAUEINSTALL
echo " " >> /nfs/ftp/ccp4/LAUEINSTALL
ttfilter < $CCP4_MASTER/laue/dl/laue_install.utx >> /nfs/ftp/ccp4/LAUEINSTALL
echo "*Creating .tar files*"
gtar -cf /scr1/tmp$$/lauetmp1.tar -C $CCP4_MASTER --exclude laue/testdata \
--exclude laue/utils/RCS --exclude laue/lib/src/RCS \
--exclude laue/src/RCS laue
gtar -cf /scr1/tmp$$/lauetmp2.tar -C $CCP4_MASTER laue/testdata
echo "*Compressing .tar files*"
compress -f  /scr1/tmp$$/lauetmp1.tar
compress -f  /scr1/tmp$$/lauetmp2.tar
echo "*Copying compressed .tar files to anonymous ftp area*"
cp /scr1/tmp$$/lauetmp1.tar.Z /nfs/ccp4a/ftp/ccp4/laue.tar.Z
cp /scr1/tmp$$/lauetmp2.tar.Z /nfs/ccp4a/ftp/ccp4/lauedata.tar.Z
echo "*Tidying up*"
/bin/rm -r /scr1/tmp$$
echo "*Done*"
