1#! /bin/sh
2#
3# version.sh -- script to create version string(s) for nmh.
4# You need to pass the script the version number to use.
5
6set -e
7
8version=${1?}
9host=`uname -n`
10if test -d "$srcdir/.git"; then
11    git=" `git -C $srcdir describe --long --dirty`"
12else
13    git=
14fi
15date="`TZ=GMT0 date +'%Y-%m-%d %T'` +0000"
16
17cat <<E
18char *version_str = "nmh-$version$git built $date on $host";
19char *version_num = "nmh-$version";
20char *user_agent = "nmh/$version";
21E
22