#!/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=add_tradis_tags
help2man --no-info --no-discard-stderr --help-option=" " \
         --name='Adds transposon sequence and quality tags to the read strings and outputs a BAM' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

progname=bacteria_tradis
help2man --no-info --no-discard-stderr --help-option=" " \
         --name='bio-tradis: run a TraDIS analysis' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

progname=check_tradis_tags
help2man --no-info --no-discard-stderr --help-option=" " \
         --name='bio-tradis: check for the existence of tradis tags in a bam' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

progname=combine_tradis_plots
help2man --no-info --no-discard-stderr --help-option=" " \
         --name='bio-tradis: combine multiple plotfiles and generate updated statistics' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

progname=filter_tradis_tags
help2man --no-info --no-discard-stderr --help-option=" " \
         --name='bio-tradis: filters a BAM file and outputs reads' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

progname=remove_tradis_tags
help2man --no-info --no-discard-stderr --help-option=" " \
         --name='bio-tradis: remove transposon sequence and quality tags from the read strings' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

progname=tradis_comparison
help2man --no-info --no-discard-stderr --help-option=" " \
         --name='bio-tradis: compares two experimental conditions using the method of Dembek et al.' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

progname=tradis_essentiality
help2man --no-info --no-discard-stderr --help-option=" " \
         --name='bio-tradis: produces calls of gene essentiality using an adaptation of the method described in Langridge et al.' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

progname=tradis_gene_insert_sites
help2man --no-info --no-discard-stderr --help-option=" " \
         --name='bio-tradis: take in plot file(s) and an embl file and produce a tab delimited file' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

progname=tradis_merge_plots
help2man --no-info --no-discard-stderr --help-option=" " \
         --name='bio-tradis: Given a study name or ID, group by sample and tag, and generate tab files for input to R' \
            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
echo $AUTHOR >> $MANDIR/${progname}.1

progname=tradis_plot
help2man --no-info --no-discard-stderr --help-option=" " \
         --name='bio-tradis: create insertion site plot for Artemis' \
            --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

