aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ntp/scripts/mkver
blob: 075b1972054b9f4a9c8c4fba0016b51c2193038d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
# $FreeBSD$
PROG=${1-UNKNOWN}

ConfStr="$PROG"

case "" in
 '') ;;
 *)  ConfStr="$ConfStr RSAREF" ;;
esac

ConfStr="$ConfStr 4.0.99b `LC_ALL=C date`"

if [ ! -f .version ]; then
  echo 0 > .version
fi
RUN="`cat .version`"
RUN="`expr $RUN + 1`"
echo $RUN > .version

ConfStr="$ConfStr (${RUN})"

echo "Version <${ConfStr}>";

rm -f version.c
cat > version.c << -EoF-
/*
 * version file for $PROG
 */
#include <config.h>
const char * Version = "${ConfStr}";
-EoF-