xref: /freebsd/usr.sbin/ntp/scripts/mkver (revision 1e413cf93298b5b97441a21d9a50fdcd0ee9945e)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5PROG=${1-UNKNOWN}
6
7ConfStr="$PROG"
8
9ConfStr="$ConfStr 4.2.0"
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