
# SCCS_ID - "@(#)mkbinmedia        3.6      11:53:25 - 88/10/14 "
#
#   @(#) Copyright (c) 1985  The Wollongong Group, Inc.  All Rights Reserved
#

#
# This makes the binary shared streams drivers distribution media.
#
# This script is intended to be run while the `pwd` is the 'new' directory
# (e.g. /4/wins/drivers/new  a.k.a. ../.. ) 

SHELL=/bin/sh;	export SHELL
umask 022
MAKETAPE=$1
TOPDIR=`pwd`
DRIVE=/dev/rmt0
REWIND=/dev/rmt1
TAPEDATE=`awk -f install/binary/tapedate.awk install/binary/DATE`
##
## Determine space requirements for WIN3B
##
#USRneeds=`expr "\`du -s new/usr\`" : "\([0-9]*\).*"`
#ROOTneeds=`expr "\`du -s new\`" : "\([0-9]*\).*"`
#ROOTneeds=`expr ${ROOTneeds} - ${USRneeds}`
##
## Round up the number of blocks required
##
#ROOTneeds=`expr \( \( $ROOTneeds + 49 \) / 25 \) \* 25`
#USRneeds=`expr \( \( $USRneeds + 49 \) / 25 \) \* 25`
ROOTneeds=50
USRneeds=4500

ed - install/binary/INSTALL <<EOF
/^ROOTneeds/s/^.*/ROOTneeds=$ROOTneeds/
/^USRneeds/s/^.*/USRneeds=$USRneeds/
w
q
EOF

DATE="`cat install/binary/DATE`"
echo "This distribution `pwd` was made $DATE"
echo "Is this the one you want? [y, n]: \c"
read answer
if [ $answer ]
then
	:
else
	answer=n
fi
if [ $answer = y -o $answer = Y -o $answer = yes ]
then
	:
else
	exit
fi

#
# copy distribution to tape
#
echo "Mount tape on drive $DRIVE.  Type RETURN when ready or DEL to quit\c"
read answer

# cd ${TOPDIR}
cat install/binary/Specfile.1 | $MAKETAPE -T $TAPEDATE -oBv > $DRIVE
cat install/binary/Specfile.2 | $MAKETAPE -T $TAPEDATE -oBv > $DRIVE

# rewind the tape
< $REWIND

