echo "Position to INFOFLEX DIRECTORY (fx/unx)" 

. ./fxsettar

cd ..
cd ..


echo
echo
if test "$1" = ""; then 
     echo "INSERT Diskette (1 of 3) and Press Return"; 
     read answer; 
     fi
rm tarall.lst

rm tar.lst
strip fx/bin/fxflex
strip fx/bin/flexm
strip fx/bin/fxsql
strip fx/bin/fxsql2
strip fx/bin/fxmore
strip fx/bin/fxedit
strip fx/bin/prntflex
strip fx/bin/termflex
strip fx/bin/fxpp
strip fx/bin/fxpdb
strip fx/bin/fxpscr
strip fx/bin/fxplink
strip fx/bin/fxpc
strip fx/bin/fxpw
strip fx/bin/fxroute
chmod 777 fx/bin/*  # SCO strip command removes executable permissions ?
strip fx/demo/bin/demoflex; chmod 777 fx/demo/bin/demoflex 
strip fx/demo/bin/cwmenu; chmod 777 fx/demo/bin/cwmenu
find fx/bin -name "fxflex"     -print >> tar.lst   
find fx/bin -name "flexm"     -print >> tar.lst   
find fx/bin -name "fxsql"    -print >> tar.lst  
find fx/bin -name "fxsql2"    -print >> tar.lst  
find fx/bin -name "fxmore"   -print >> tar.lst   
find fx/bin -name "fxedit"   -print >> tar.lst   
find fx/bin -name "termflex" -print >> tar.lst
find fx/bin -name "fxroute" -print >> tar.lst
cat tar.lst >> tarall.lst
if test "$1" = "-" -o "$1" = ""; then
    tar $TARLIST  fx/fxtar $TARLIST2 tar.lst
    fi

rm tar.lst
find fx/bin -name "prntflex" -print >> tar.lst
find fx/bin -name "dcheck"   -print >> tar.lst
find fx/bin -name "fxp*"     -print >> tar.lst   
find fx/lib -name "libfx.a"  -print >> tar.lst   
find fx/lib -name "libisam.a" -print >> tar.lst    
find fx/lib -name "*.o"      -print >> tar.lst   
cat tar.lst >> tarall.lst
if test "$1" = "-" -o "$1" = ""; then
    tar $TARLIST fx/fxtar2 $TARLIST2 tar.lst 
    fi

rm tar.lst
find fx/src/lib   -name "flex.o" -print >> tar.lst   
find fx/include   -name "*.h" -print >> tar.lst
find fx/src/misc  -type f -print >> tar.lst
find fx/src/term  -type f -print >> tar.lst
find fx/dev       -type f -print >> tar.lst
find fx/cgi-bin   -type f -print >> tar.lst
find fx/language   -type f -print >> tar.lst
find fx/version    -type f -print >> tar.lst
find fx/unx       -type f -print >> tar.lst
find fx/demo/bin  -type f -print >> tar.lst
find fx/demo/demo.dbs  -type f -print >> tar.lst
find fx/demo/help -type f -print >> tar.lst
find fx/demo/defaults -name "dummy" -print >> tar.lst
cat tar.lst >> tarall.lst
if test "$1" = "-" -o "$1" = ""; then
    tar $TARLIST fx/fxtar3 $TARLIST2 tar.lst 
    fi

if test "$1" = "-dir"
   then
       rm -f fx/infoflex
       if test "$TARLIST2" = "-CAT"; then
           tar $TARLIST fx/infoflex `cat tarall.lst`
       else
           tar $TARLIST fx/infoflex $TARLIST2 tarall.lst
       fi
       rm -f fx/infoflex.gz
       gzip fx/infoflex
       cd fx
       cp unx/fxsetup .
       cp fxsetup infoflex.gz "$2"
       exit
   fi

if test "$1" = "-Zdir"
   then
       rm -f fx/infoflex
       if test "$TARLIST2" = "-CAT"; then
           tar $TARLIST fx/infoflex `cat tarall.lst`
       else
           tar $TARLIST fx/infoflex $TARLIST2 tarall.lst
       fi
       rm -f fx/infoflex.Z
       compress fx/infoflex
       cd fx
       cp unx/fxsetup .
       cp fxsetup infoflex.Z "$2"
       exit
   fi


cd fx
cp unx/fxsetup .
rm fxtar.Z
compress fxtar
rm fxtar2.Z
compress fxtar2
rm fxtar3.Z
compress fxtar3

if test "$1" = "-"; then
   cp fxsetup fxtar.Z fxtar2.Z fxtar3.Z "$2"
   exit
fi

tar cvf $TARDRIVE fxsetup fxtar.Z

echo "Insert Diskette (2 of 3) and then press enter key"
read answer
tar cvf $TARDRIVE fxtar2.Z

echo "Insert Diskette (3 of 3) and then press enter key"
read answer
tar cvf $TARDRIVE fxtar3.Z

