xref: /freebsd/usr.sbin/ntp/scripts/mkver (revision 3c4ba5f55438f7afd4f4b0b56f88f2bb505fd6a6)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5PROG=${1-UNKNOWN}
6
7: ${ECHO:=echo}
8
9ConfStr="$PROG"
10
11ConfStr="$ConfStr 4.2.8p15"
12
13case "$CSET" in
14 '') ;;
15 *) ConfStr="$ConfStr@$CSET" ;;
16esac
17
18case "" in
19 '')
20    case "1" in
21     '') ;;
22     *) ConfStr="${ConfStr}-a" ;;
23    esac
24    ;;
25 *)  ConfStr="${ConfStr}-r" ;;
26esac
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
37${ECHO} "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