#!/bin/csh
# cvsup2cd.csh by Julian H. Stacey 2001
# see also ctms2cd.csh
# This script produces a cdrom image of Cvsup, copying itself to README on image.
set out_dir="/usr1/tmp/cvsup"
# rm -rf $out_dir ; mkdir $out_dir
cp `which $0` $out_dir/README
set cd_image="$out_dir/cvsup.iso"
set tar="$out_dir/cvsup.`date -u +%Y-%m-%dT%H:%M:%SZ`.tgz"
cd /pub/freebsd/ref
set stuff="cvsup"

# tar -c -z -f $tar $stuff # -z reduces 1.1G to 260M

mkisofs 	\
	-A "FreeBSD CVSUP `date -u +%Y-%m-%dT%H:%M:%SZ`" \
	-P "http://www.berklix.com/~jhs/cv/" \
	-V freebsd_cvsup \
	-copyright "JHS" \
	-o $cd_image \
	-p "Julian H. Stacey" \
	-pad \
	-r \
	-volset-seqno 1 \
	-volset-size 1 \
	$out_dir/README \
	4.3-RELEASE/tars \
	4.3-RELEASE/src.mail \
	$tar

# The $tar only needs 250 Meg, so I'm filling some of remaining 400M space
# with 80M of 4.3-RELEASE/tars, 

ls -l $cd_image		# Aprox 460 Megabytes @ June 2001
echo "Suggestions:"
echo "	vnconfig vn0 /host/`hostname -s`/$cd_image"
echo "	mount -t cd9660 /dev/vn0c /mnt"
echo "	ls -al /mnt"
echo "	umount /dev/vn0c"
echo "	vnconfig -u vn0"
echo "	rsh rain cdrecord -dummy -v -data /host/`hostname -s`/$cd_image"
