#! /bin/bash
# $Id: mkdisttars,v 1.3 2009/09/04 19:22:12 rhuey Exp $
archlist="i86Cygwin i86Linux2 sun4SunOS5 ia64Linux2 universalDarwin8 universalDarwin9 universalDarwin10"
version=4
umask 2

# name for "arch" tar files is 
# "autodocksuite-4.2.2-<arch>.tar.gz"
#
# content for "arch" tar files is 
# simply "<arch>/autodock4 <arch>/autogrid4"
for arch in $archlist; do
   archok=y
   case $arch in 
    i86Cygwin) exeext=.exe ;;
    *) exeext="";;
    esac
    for prog in autodock autogrid; do
    progfile=${prog}${version}  # eg autodock4
      archprogfile=$prog/$arch/$progfile$exeext
      if [ ! -e $archprogfile ] ; then
        echo $archprogfile missing
	archok=n
      else
        ls -l $archprogfile
      fi
   done
   if [ test$archok != testn ] ; then
     tar cvf \
     autodocksuite-4.2.2-$arch.tar \
     -C autodock $arch/autodock4$exeext \
     -C ../autogrid $arch/autogrid4$exeext 
   gzip  autodocksuite-4.2.2-$arch.tar
   fi
done


# name for "src" tar file is 
# "autodocksuite-4.2.2-src-tar.gz"
# content for "src" tar file is 
#   "autodocksuite-4.2.2/src/auto{grid,dock}-4.2.2/"
#   with all *.cc *.h *.cpp README COPYING, ... Tests
#   (checked out from CVS then "autoreconf -i" run, so 
#     includes 'configure' but not Makefile)
tar cf autodocksuite-4.2.2-src.tar src
gzip autodocksuite-4.2.2-src.tar
