#!/bin/sh
# @(#) $RCSfile: MKHELPTAR,v $: $Revision: #4 $, $Date: 2006/06/26 $ 
# @(#) Copyright (c), 1987, 2006 Insightful Corp.  All rights reserved.
#
# Create a file containing all of the JavaHelp and HTML files in the
# S-PLUS tree.  By default the tar file is ./SplusHelp.tar, or a 
# file name and path can be specified:
#    Splus MKHELPTAR /homes/mclark/Shelp.tar

if [ "X$SHOME" = X ]; then
        echo "SHOME is not set."
        echo "Usage: $S_PROG_NAME $0 [filename]"
        exit 1
fi
orig_dir=`pwd`
if [ $# -gt 0 ] ; then
    tarname=$1
else
    tarname=SplusHelp.tar
fi

cd ${SHOME}
HDIRS=`find . -name "__[JH]help" -print`
cd ${orig_dir}
tar cf ${tarname} -C ${SHOME} ./doc/help/guihelp \
        -C ${SHOME} ./splus/lib/javahelp \
        `for d in $HDIRS; do echo "-C ${SHOME} $d"; done`
echo "$0: created ${tarname}"
exit 0
