NetBSD/usr.sbin/ntp/scripts/mkver

46 lines
691 B
Bash
Executable File

#!/bin/sh
# $NetBSD: mkver,v 1.3 2003/12/04 16:41:57 drochner Exp $
PROG=${1-UNKNOWN}
ConfStr="$PROG"
ConfStr="$ConfStr 4.2.0"
case "$CSET" in
'') ;;
*) ConfStr="$ConfStr@$CSET" ;;
esac
case "@LIBRSAREF@" in
'')
case "@AUTOKEY@" in
'') ;;
*) ConfStr="${ConfStr}-a" ;;
esac
;;
*) ConfStr="${ConfStr}-r" ;;
esac
ConfStr="$ConfStr `LC_TIME=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-