#!/bin/sh

REPOSITORY=:pserver:anonymous@cvs1:/cvsroot/mahogany
CVS="cvs -z3"
MAKE=make
LOG=/tmp/mdocs.log

# the dir where we create our temp files
BUILDDIR=/tmp/mdocs

# the location where the manual should live (in subdir Manual)
TARGET=/home/groups/mahogany/htdocs/doc

{
mkdir $BUILDDIR &&
cd $BUILDDIR &&
$CVS -q -d $REPOSITORY co -l M/README \
                             M/doc/Manual.htex \
                             M/doc/Makefile.html \
                             M/extra/scripts/striphelpids &&
cd M/doc &&
$MAKE -f Makefile.html &&
rm -rf $TARGET/Manual && mv Manual $TARGET &&
mv ../README $TARGET
} >> $LOG 2>&1

rm -rf $BUILDDIR

exit 0
