Added whom, it's the fifth program referred to in mh-draft man page.
[mmh] / config / version.sh
1 #!/bin/sh
2 #
3 # version.sh -- script to create version string(s) for nmh.
4 #
5 # You need to pass the script the version number to use.
6 #
7
8 if [ -z "$1" ]; then
9     echo "usage: version.sh VERSION" 1>&2
10     exit 1
11 fi
12
13 VERSION=$1
14 OFS="$IFS"
15 IFS=:
16 HOSTNAME=unknown
17
18 # Find out the name of the host we are compiling on
19 for prog in uname hostname
20 do
21     for dir in $PATH
22     do
23         if [ ! -f $dir/$prog ]; then
24             continue
25         fi
26         case $prog in
27             uname)      HOSTNAME=`$prog -n`
28                         ;;
29             hostname)   HOSTNAME=`$prog`
30                         ;;
31         esac
32         break
33     done
34     if [ X"$HOSTNAME" != X  -a  X"$HOSTNAME" != Xunknown ]; then
35         break
36     fi
37 done
38
39 IFS=" "
40
41 echo "char *version_str = \"nmh-$VERSION [compiled on $HOSTNAME at `date`]\";"
42 echo "char *version_num = \"nmh-$VERSION\";"