#!/bin/sh
source config.h;

#Make sure our destinations exist
$MKDIR $PREFIX/bin;
$MKDIR $PREFIX/doc/flog-$VERSION;
$MKDIR $PREFIX/man/man8;

#Copy content
cp -R sample.conf/ flog.pod CHANGELOG 4k-block $PREFIX/doc/flog-$VERSION
pod2html --title="flog - real time log splitter and viewer" --infile=flog.pod --outfile=$PREFIX/doc/flog-$VERSION
pod2man --center="flog - real time log splitter and viewer" --release=0.03 --section=8 flog.pod > $PREFIX/man/man8/flog.8
cp flog $PREFIX/bin
$PERL -pi $PREFIX/bin/flog -e "unless( $. ){ $_ = \"#!$PERL -s\n\"; };"

echo $PREFIX  >> flog
echo $VERSION >> flog
cat <<EOF
To test your installation of flog v$VERSION type:
$PREFIX/bin/flog -t $PREFIX/doc/sample.conf/simple.pl

Enjoy -- webmaster@pthbb.org
EOF
