#! /bin/sh
# $Header: install,v 1.3 98/02/03 16:39:32 fjl Exp $
#
# Install script for hdocu
# This script is intenionally simple :-)
#
# Please fill in the following infos:

PERL=/usr/local/bin/perl
WISH=/usr/local/bin/wish8.0
INSTALLDIR=/usr/local
LIBDIR="$INSTALLDIR"/lib/hdocu
BINDIR="$INSTALLDIR"/bin
DOCUDIR="$INSTALLDIR"/htmldoku
MANSEC=1
MANDIR="$INSTALLDIR"/man/man"$MANSEC"

# create missing directories
umask 002

for dir in $INSTALLDIR $LIBDIR $BINDIR $DOCUDIR $MANDIR ; do
    if [ ! -d $dir ] ; then
	echo "Create $dir"
        mkdir $dir
    fi
done

for file in hdocu lsm2hdocu xhdocu ; do
    if [ ! -f "$BINDIR/$file" ] ; then
        touch "$BINDIR/$file"
        chmod 755 "$BINDIR/$file"
    fi
done

cp lib/* $LIBDIR
cp -r pages/* $DOCUDIR
cp lsm2hdocu.man "$MANDIR"/lsm2hdocu."$MANSEC"
cp xhdocu.man "$MANDIR"/xhdocu."$MANSEC"
cat hdocu.man | sed -e s:/usr/local/lib/hdocu:"$LIBDIR":g > "$MANDIR"/hdocu."$MANSEC"
cat hdocu     | sed -e s:/usr/local/lib/hdocu:"$LIBDIR":g \
		    -e s:/usr/local/bin/perl:"$PERL":g > "$BINDIR"/hdocu
cat lsm2hdocu | sed -e s:/usr/local/bin/perl:"$PERL":g > "$BINDIR"/lsm2hdocu
cat xhdocu    | sed -e s:/usr/local/bin/wish8\.0:"$WISH":g > "$BINDIR"/xhdocu
