:

DIR="help models include"

OLD_EXE="install nCompil_f nCompil_c ld_c ld_f launch__n_comphep make__n_comphep"
OLD_RD="Licence.txt  comphep comphep.ini icon \
 axodraw.sty mrsA_.tbl mrsG.tbl cteq4m.tbl"  
NEW_EXE="s_comphep tab_view genEvents filterD2 filterDN mk_tab"
NEW_RD="CC F77 num_c.a num_f.a serv.a n_comphep_f.o n_comphep_c.o events.o"


errcode=0

for FILE in $DIR 
do
 if(test ! -d $FILE) then 
   echo Subdirectory $FILE is absent
   errcode=1
 fi
   
 chmod 755 $FILE
 chmod 644 $FILE/*.* 
done

for FILE in $OLD_RD
do
  if(test ! -s $FILE) then 
    echo File $FILE is absent
    errcode=1
  fi
  chmod 644 $FILE
done

for FILE in $OLD_EXE
do
  if(test ! -s $FILE) then 
    echo File $FILE is absent
    errcode=1
  fi
  chmod 755 $FILE
done


for FILE in $NEW_RD
do
  if(test ! -s $FILE) then 
    echo File $FILE is not created
    errcode=1
  fi
  chmod 644 $FILE
done

for FILE in $NEW_EXE
do
  if(test ! -s $FILE) then 
    echo File $FILE is not created
    errcode=1
  fi
  chmod 755 $FILE
done

if (test $errcode -eq 0) then 
  echo All needed files exist and have an appropriate mode.
fi
