xref: /freebsd/usr.sbin/ntp/scripts/mkver (revision f0adf7f5cdd241db2f2c817683191a6ef64a4e95)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5PROG=${1-UNKNOWN}
6
7ConfStr="$PROG"
8
9ConfStr="$ConfStr 4.1.1b"
10
11case "$CSET" in
12 '') ;;
13 *) ConfStr="$ConfStr@$CSET" ;;
14esac
15
16case "" in
17 '')
18    case "1" in
19     '') ;;
20     *) ConfStr="${ConfStr}-a" ;;
21    esac
22    ;;
23 *)  ConfStr="${ConfStr}-r" ;;
24esac
25
26ConfStr="$ConfStr `LC_ALL=C date`"
27
28if [ ! -f .version ]; then
29  echo 0 > .version
30fi
31RUN="`cat .version`"
32RUN="`expr $RUN + 1`"
33echo $RUN > .version
34
35ConfStr="$ConfStr (${RUN})"
36
37echo "Version <${ConfStr}>";
38
39rm -f version.c
40cat > version.c << -EoF-
41/*
42 * version file for $PROG
43 */
44#include <config.h>
45const char * Version = "${ConfStr}";
46-EoF-
47