#!/bin/csh
# ctms2cd.csh by Julian H. Stacey 2001
# see also cvsup2cd.csh
# This script produces a cdrom image of CTMs, copying itself to README on image.
set out_dir="/usr2/tmp/ctms"
rm -rf $out_dir ; mkdir $out_dir
cp `which $0` $out_dir/README
set cd_image="$out_dir/ctms.iso"
set tar="$out_dir/ctms.`date -u +%Y-%m-%dT%H:%M:%SZ`.tar"
cd /pub/freebsd/ref
set stuff="cvs/ctm/cvs/base"
set stuff="svn/ctm/svn/base"
set stuff="$stuff cvs/ctm/cvs/deltas"
set stuff="$stuff svn/ctm/svn/deltas"
set stuff="$stuff current/ctm/src-cur/base"
set stuff="$stuff current/ctm/src-cur/deltas"
set stuff="$stuff current/ctm/ports-cur/base"
set stuff="$stuff current/ctm/ports-cur/deltas"
set stuff="$stuff RELENG_4/ctm/base"
set stuff="$stuff RELENG_4/ctm/deltas"

tar -c -h -f $tar $stuff # no -z, no significant reduction. ; ls -l $tar

mkisofs 	\
	-A "FreeBSD CTMs `date`" \
	-P "Vector Systems Ltd (UK), vsl.cd@berklix, http://www.berklix.com/vsl/" \
	-V freebsd_ctms \
	-copyright "JHS & VSL" \
	-o $cd_image \
	-p "Julian H. Stacey" \
	-pad \
	-r \
	-volset-seqno 1 \
	-volset-size 1 \
	$out_dir/README \
	4.3-RELEASE/src.mail \
	4.3-RELEASE/tars \
	$tar

# no 	-f to follow sym links

# The $tar only needs 460 Meg, so I'm filling some of remaining 200M space
# with 80M of 4.3-RELEASE/tars, because the src/ extracted with cvs
# contains more than the src/ built by ctm !

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"

# Without "-r" everything end in top directory,
# With -r it complains:
#   mkisofs: Error: current/ctm/src-cur/base/README and current/ctm/ports-cur/base/README have the same Rock Ridge name
#   mkisofs: Error: current/ctm/ports-cur/base/README and cvs/ctm/cvs/base/README have the same Rock Ridge name
#   mkisofs: Error: current/ctm/src-cur/base/README and cvs/ctm/cvs/base/README have the same Rock Ridge name
#   mkisofs: Error: cvs/ctm/cvs/base/README and current/ctm/src-cur/base/README have the same Rock Ridge name
#   mkisofs: Error: current/ctm/ports-cur/base/README and current/ctm/src-cur/base/README have the same Rock Ridge name
#   mkisofs: Error: current/ctm/ports-cur/base/README and current/ctm/src-cur/base/README have the same Rock Ridge name
#   mkisofs: Error: current/ctm/ports-cur/deltas/.mutex_apply and cvs/ctm/cvs/deltas/.mutex_apply have the same Rock Ridge name
#   mkisofs: Error: current/ctm/src-cur/deltas/.mutex_apply and current/ctm/ports-cur/deltas/.mutex_apply have the same Rock Ridge name
#   mkisofs: Error: cvs/ctm/cvs/deltas/.mutex_apply and current/ctm/ports-cur/deltas/.mutex_apply have the same Rock Ridge name
#   mkisofs: Error: RELENG_4/ctm/deltas/.mutex_apply and current/ctm/ports-cur/deltas/.mutex_apply have the same Rock Ridge name
#   mkisofs: Error: cvs/ctm/cvs/deltas/.mutex_build and current/ctm/src-cur/deltas/.mutex_build have the same Rock Ridge name
#   mkisofs: Error: current/ctm/src-cur/deltas/.mutex_apply and cvs/ctm/cvs/deltas/.mutex_apply have the same Rock Ridge name
#   mkisofs: Error: RELENG_4/ctm/deltas/.mutex_build and current/ctm/ports-cur/deltas/.mutex_build have the same Rock Ridge name
#   mkisofs: Unable to sort directory


exit

This file 
	copyright.ctms
is included by
	ctms2cd.csh

This CD collection of FreeBSD CTMs is collation (but not individual content) Copyright
	Julian H. Stacey / Vector Systems Ltd (UK) 2001
VSL permits further copying subject to normal BSD terms
(IE as found in FreeBSD /usr/src/COPYRIGHT)
That being even free-er than GNU-Linux GPL

If you don't understand, read the BSD & FSF/GNU licences ... repeatedly ...
until you do understand the difference !
