#!/bin/bash
#
# $Id: sf_cron.sh,v 1.26 2002/04/13 13:48:39 amai Exp $
#
# This is a shell script to run on SourceForge.net's shell servers to maintain
# our project web space.
#
#
(
HOME=/home/groups/l/le/lesstif
WEB=$HOME/htdocs
CVS=$HOME/cvs/lesstif
MAN2HTML=$CVS/scripts/man2html
#
ECHO=echo
ECHO=true
#
cd $CVS
#
# Update from CVS
#	Only update the relevant parts of the tree.
#
cd $CVS/scripts
cvs -Q update -d -P
cd $CVS/doc
cvs -Q update -d -P
#
# Copy LessTif web page
#
cd $CVS
cp doc/*.html $WEB
cp doc/www.lesstif.org/*.html $WEB
cp doc/www.lesstif.org/images/*.png $WEB/images
cp doc/www.lesstif.org/images/*.jpg $WEB/images
cp doc/www.lesstif.org/images/*.gif $WEB/images
cp ReleaseNotes.html $WEB
#
# Copy LessTif manual pages
#
cd $CVS/doc/lessdox/clients
for i in *.1 *.5
do
	$ECHO "process $i"
	$MAN2HTML -f -w <$i >$WEB/Lessdox/${i%.*}.html
done
cd $CVS/doc/lessdox/widgets
for i in *.3
do
	$ECHO "process $i"
	$MAN2HTML -f -w <$i >$WEB/Lessdox/${i%.*}.html
done
$ECHO done man2html
#
# Copy Inside LessTif book
#
cd $CVS/doc/InsideLessTif/html
cp *.html *.gif *.jpeg $WEB/InsideLessTif
#
# The end
#
) >$HOME/message 2>&1

if [ -s $HOME/message ]; then
	mail -s "SF hourly" dannybackx@users.sourceforge.net <$HOME/message
fi
exit 0
