#!/bin/sh
MANDIR=debian/mans
mkdir -p $MANDIR

VERSION=`dpkg-parsechangelog | awk '/^Version:/ {print $2}' | sed -e 's/^[0-9]*://' -e 's/-.*//' -e 's/[+~]dfsg$//'`

AUTHOR=".SH AUTHOR\nThis manpage was written by $DEBFULLNAME for the Debian distribution and
can be used for any other usage of the program.
"

progname=roguenarok-parallel
help2man --no-info --no-discard-stderr --help-option=" --help" \
         --name='implements the RogueNaRok algorithm for rogue taxon identification (parallel version)' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

progname=roguenarok-single
help2man --no-info --no-discard-stderr --help-option=" " \
         --name='implements the RogueNaRok algorithm for rogue taxon identification (single core version)' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

progname=rnr-lsi
help2man --no-info --no-discard-stderr --help-option=" -h" \
         --name='computes three flavors of leaf stability index for each taxon' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

progname=rnr-mast
help2man --no-info --no-discard-stderr --help-option=" -h" \
         --name='computes maximum agreement trees for unrooted input sets' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

progname=rnr-prune
help2man --no-info --no-discard-stderr --help-option=" -h" \
         --name='prunes a list of taxa from a bootstrap tree or a single tree with branch lengths' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

progname=rnr-tii
help2man --no-info --no-discard-stderr --help-option=" -h" \
         --name='computes the taxonomic instability index' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

cat <<EOT
Please enhance the help2man output.
The following web page might be helpful in doing so:
    http://liw.fi/manpages/
EOT

