#!/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 -------------------------------------

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

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

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

		# take the *.newspak files and run sed on 
		# them to the 'right' filename
		sed -f $DEFS $FILE > `basename $FILE .newspak`

	done
done

echo "... done ..."

