#!/bin/bash
#
# make-configs - localize the news/mail/uucp config files
#

#------------- EDIT THE NEXT LINE TO SHOW WHERE WE ARE NOW ----------------

NEWSPAK="/home/NEWSPAK/newspak-2.4"

# uncomment the next line to use my particular variant
# of directory structure for USENET-related stuff
#DEFS="$NEWSPAK/defs/defs.victrola"       # path to defs.site

# uncomment the next line to use your (hopefully edited) 
# site-specific idea of 'the one true directory structure'
# the 'as-delivered' default is my paths
#DEFS="$NEWSPAK/defs/defs.site"          # path to defs.site

# uncomment the next line to take *MY* local config files
# and build the generic configurable ones for 'newspak'
# (for *MY* use only to build the newspak distribution)
DEFS="$NEWSPAK/defs/defs.newspak"        # path to defs.site



#------------------ STOP EDITING HERE -------------------------------------

##### CHECK TO MAKE SURE YOU DON'T TOAST YOURSELF
HOSTNAME=`hostname`
if [ $HOSTNAME != "victrola" ] ; then
	echo ""
	echo "...this script is for Vince's use only in making the distribution..."
	echo "       (you probably don't want to run this)"
	echo ""
	exit 1
fi

# product-related subdirectories with *.newspak files in them
#
# we don't mess with the sendmail+IDA paths so it doesn't appear here...

export TIN='tin-1.2p2'
export TRN='trn-3.5'
export NN='nn-6.4.18'
export SMAIL='smail-3.1.28'
export UUCP='uucp-1.05'
export MTHREADS='mthreads-3.1'
export ELM='elm-2.4.23'
export CNEWS='cnews-Feb23-1993'
export INN='inn-1.4'


cd $NEWSPAK

for DIR in $TIN $TRN $NN $SMAIL $UUCP $MTHREADS $ELM $CNEWS $INN
do
	echo "...............$DIR........................."
	cd $NEWSPAK/$DIR
	pwd
	for FILE in `ls -1 *.newspak`
	do
		echo $FILE

		# take the 'real' files and build the *.newspak
		# files out of them

		sed -f $DEFS `basename $FILE .newspak` > $FILE 
	done
	cd .. 
done

echo "... done ..."


