#!/bin/bash
#
# clean095a.sh - used to clean the un-tar-ed openssl-0.9.5a of un-needed
# stuff related to operating systems other than CygWin32.  Always save
# your original distribution tar file.
#
# $Header: /export/home/clark/patches/clean095a.sh,v 1.2 2000/12/10 04:56:59 aclark Exp $
#
# Copyright (c) 2000-2001 Lymeware Corporation
#
#  The latest version of this script can be found at
#      http://www.lymeware.com/download_fw.html
#
#  If you find any, ahem, bugs or have any suggestions for improvement
#   please send them to freeware@lymeware.com and we'll be in your debt.
#
# Enjoy . . .
#

echo "Starting $0"

# check to see if we are in the openssl-0.9.5a directory by locating a few
# choice files.
choice_files="Configure Install Readme"
for n in $choice_files
do
	if [ ! -f ./$n ]
	then
		echo "ERROR: cannoth find $n in local directory"
		echo " be sure to run this script from ./openssl-0.9.5a"
		exit;
	fi
done

# now start the cleaning . . .
/bin/echo -n "Cleaning Phase 1"
# delete all "spare" OS directories
spare_dirs="MacOS VMS"
for d in $spare_dirs
do
	/bin/rm -rf $d
done

/bin/echo  -n "\rCleaning Phase 1,2"
# delete all "spare" OS files
spare_files="INSTALL.MacOS INSTALL.VMS ./apps/openssl-vms.cnf \
./bugs/alpha.c ./bugs/dggccbug.c ./bugs/sgibug.c ./bugs/ultrixcc.c \
./bugs/VC16.bug ./crypto/bn/vms-helper.c \
./crypto/bn/asm/alpha/* ./crypto/bn/asm/alpha.works/* \
./crypto/bn/asm/alpha.s* ./crypto/bn/asm/??-alpha.pl \
./crypto/bn/asm/*.[Ss] ./crypto/bn/asm/vms ./crypto/des/times/*cc \
./crypto/md5/asm/*.S ./crypto/perlasm/alpha.pl ./crypto/perlasm/x86unix.pl"
for n in $spare_files
do
	/bin/rm -rf $n
done

/bin/echo  -n "\rCleaning Phase 1,2,3"
# delete all "un-needed" files
spare_files="CHANGES CHANGES.SSLeay openssl.doxy ./certs/expired/* \
./demos/* ./perl/* ./shlib/* ./times/*"
for n in $spare_files
do
	/bin/rm -rf $n
done

/bin/echo  -n "\rCleaning Phase 1,2,3,4"
# delete all .com files
#find . -name "*.com" -print
find . -name "*.com" -exec rm -f {} \;

/bin/echo  -n "\rCleaning Phase 1,2,3,4,5"
# delete all .save files
#find . -name "*.save" -print
find . -name "*.save" -exec rm -f {} \;

/bin/echo  "\rCleaning Phase Done                 "
# EOF

