xref: /freebsd/usr.sbin/ntp/scripts/mkver (revision 8ef24a0d4b28fe230e20637f56869cc4148cd2ca)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5PROG=${1-UNKNOWN}
6
7ConfStr="$PROG"
8
9ConfStr="$ConfStr 4.2.8p7"
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
26if [ ! -f .version ]; then
27  echo 0 > .version
28fi
29RUN="`cat .version`"
30RUN="`expr $RUN + 1`"
31echo $RUN > .version
32
33ConfStr="$ConfStr (${RUN})"
34
35echo "Version <${ConfStr}>";
36
37rm -f version.c
38cat > version.c << -EoF-
39/*
40 * version file for $PROG
41 */
42#include <config.h>
43const char * Version = "${ConfStr}";
44-EoF-
45