#!/bin/sh
#/*************************************************************************/
#/* Program Database Toolkit (PDT)                                        */
#/* Copyright (C) 1998-2002                                               */
#/* University of Oregon, Department of Computer and Information Science  */
#/* Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik */
#/* Los Alamos National Laboratory, Advanced Computing Laboratory         */
#/*************************************************************************/

unpack=no
platforms="alpha apple Windows hitachi hp9000s700 linux rs6000 sgi32 sgin32 sgi64 solaris2 t3e crayx1 ppc64"

for arg in "$@"
do 
  case $arg in 
  -u)
     unpack=yes
     shift
     ;;

  -platform=*)
     platforms=`echo $arg | sed -e 's/-platform=//'`
     shift
     ;;

  *) 
   echo "ERROR: Command line switch \`$arg' not recognized"
   echo "Usage: $0 [-u] [-platform=<arch>]"
   exit 1
   ;;
  esac
done

for i in $platforms
do
  if [ $unpack = yes ]
  then      
    if [ -f ${i}/bin/edgcpfe.gz ]
    then
      echo "Unpacking $i/bin ..."
      gunzip $i/bin/*.gz
    fi
  else 
    if [ -f ${i}/bin/edgcpfe ]
    then 
      echo "Packing $i/bin ..."
      gzip $i/bin/edgcpfe $i/bin/taucpdisp $i/bin/f90fe $i/bin/pdtf90disp 
    fi
    if [ -f ${i}/bin/pdtflint ]
    then
      gzip $i/bin/pdtflint
    fi
    if [ -f ${i}/bin/pdtflint.exe ]
    then
      gzip $i/bin/*.exe
    fi
  fi
done



