#!/bin/sh
echo "Create U_PATH and SU_PATH in the working directory before running this."
/bin/sh ./conv.lower
rm -rf shadow-3.3.1
rm -rf shadow-3.3.1+
if test -d shadow-3.3.1+; then
   cat << EOF

Hmm...  Looks as though you have done this before.
We start by removing the old shadow-3.3.1+ directory if it exits.
If you have done make save in it you must be root to delete it.
Suggest that, as root, you remove shadow-3.3.1+.  Then run me again.
But first of all, squirrel away the save subdirectory somewhere. :-)
EOF
   exit 1
fi
mkdir shadow-3.3.1
cd shadow-3.3.1
for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14; do
	gzip -dc ../part$i.gz | ../sh_strip | /bin/sh
done
echo "Now patching....this should be silent (no complaints or prompts)..."
gzip -dc ../patch01.gz | patch -p0 2>../patch01.errs
echo "You should see: ls: *.rej: no such file or directory...."
ls *.rej
rm *.orig
cd ..
mv shadow-3.3.1 shadow-3.3.1+
cd shadow-3.3.1+
echo "Now patching....this should be silent (no complaints or prompts)..."
patch -p1 <../shadaut-3.3.1.df3 2>../patch.errs
echo "You should see: ls: *.rej: no such file or directory...."
ls *.rej
rm *.orig
mv Makefile Makefile.in
mv config.h config.h.in
echo "Now you can cd shadow-3.3.1+, set your PATH to SU_PATH and run configure."
