#! /bin/sh
set -e
PROG=`tempfile`
cat >$PROG <<EOF
#!/bin/sh
case \$1 in
--help) gap -h 2>&1;;
--version) echo -n "GAP - Groups, Algorithms and Programming "; gap -h 2>&1 | grep Version | sed -e "s/^.*Version/Version/";;
esac
EOF
chmod a+x $PROG
EXTRA=`tempfile`
cat >$EXTRA <<"EOF"
[description]
GAP is a system for computational discrete algebra with
particular emphasis on computational group theory, but
which has already proved useful also in other areas. In
the example text, gap is used to analyse Rubik's Cube
using group theory. A kernel implements a pascal-like
language.
.SH OPTIONS
[see also]
.I gac(1)
.I update-gap-workspace(1)
.P
You can read the complete manual in /usr/share/gap/doc or you can use the online help system. Type ?help inside GAP to access it.
Type 
.P
?Reference: options!under UNIX
.P
to access the full documentation of options.
.P
[authors]
The GAP Group <http://www.gap-system.org>
[copyright]
     Copyright (1987--2016) by the GAP Group,

     GAP  is free software; you can redistribute it and/or modify it under
the  terms  of  the  GNU  General  Public  License as published by the Free
Software  Foundation;  either version 2 of the License, or (at your option)
any  later  version. 
EOF


help2man --source="The GAP team" -N $PROG --include=$EXTRA -n "Groups, Algorithms and Programming"
rm $PROG $EXTRA 
