#! /bin/sh
# @(#)MODINST.cpp version 3.5 created 2/24/95
# @(#)Copyright (c), 1987, 1995 StatSci, Inc.  All rights reserved.
#
# This script is used to handle the "installation" of an S-PLUS add-on module
# after it has been extracted into the S-PLUS directory tree.
#
feature_name_file=Name
usage='Usage:
 
Splus MODINSTALL <module_name>
 
where "<module_name>" is the name of the module and corresponds to the name of
a sub-directory of $SHOME/module/.
'
 
[ $# -eq 0 ] && echo "$usage" >&2 && exit 1
 
module="$1"; shift
if [ $# -ne 0 ]
then
    echo "Too many arguments supplied." >&2
    echo "$usage" >&2
    exit 1
fi
 
S_MODHOME=${S_MODHOME-$SHOME/module/$module}
LICENSE modinstall $module
status=$?
[ $status -eq 0 ] || exit $status
if [ -r $S_MODHOME/INSTALL ]
then
    cd $S_MODHOME
    ./INSTALL || exit 1
fi
date > $S_MODHOME/.installed
 
echo; echo "Splus MODINSTALL $module done."
