#! /bin/sh
# %Z%$RCSfile: MODINST.cpp,v $ version $Revision: #8 $ created $Date: 2008/10/05 $
# %Z%%Q%
#
# 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}
if [ -r $S_MODHOME/INSTALL ]
then
    cd $S_MODHOME
    ./INSTALL || exit 1
fi
#
# Set world write and execute permissions on the html help directories.
#
cd $S_MODHOME 
find . -name __Hhelp -exec chmod -R a+rwx {} \;
date > $S_MODHOME/.installed
 
echo; echo "Splus MODINSTALL $module done."
