#!/bin/sh
# @(#)DEINSTALL version 3.18 created 2/12/96
# @(#)Copyright (c), 1987, 1996 StatSci, Inc.  All rights reserved.

# Remove files from a distribution SHOME. Most of these files are created by
# users when they install Splus (run $SHOME/CONFIGURE); they are made from other
# distributed files and scripts. Running this script will remove them, so
# the installation is put back to square one.

echo cleaning up under ${SHOME?} ...

# NOTE: adm/lic/keys/00 is the license key for S-PLUS.
FILES=".configured
	Splus
	Splus.d
	SERIAL
	cmd/S
	cmd/PRINT
	cmd/help.tr
	splus/lib/install/USER.env
	splus/lib/Smakefile
	splus/lib/install/env.var.cpp
	splus/lib/install/LICENSE.env
	splus/lib/install/LICRSHCMD
	adm/lic/keys/00
	adm/lic/elmd.log
	adm/lic/RSHCMD
	splus/lib/suntools/Smakefile
	splus/lib/suntools/Splus.d"

for i in $FILES
do
	rm -f $SHOME/$i
	[ ! -f $SHOME/$i ] || echo "Couldn't rm $SHOME/$i" >&2
done

tmpdir=${TMPDIR:-/tmp}
if [ -r $SHOME/adm/lic/elmd.res ]
then # Move the license server resource file out of the way.
    echo "Moving your license server resources file to $tmpdir/elmd.res.$$"
    echo "After rerunning CONFIGURE/INSTALL, you can put it back with the command:"
    echo "    mv $tmpdir/elmd.res.$$"' `Splus LICENSE resources`'
    mv $SHOME/adm/lic/elmd.res $tmpdir/elmd.res.$$
fi

exit
