diff options
Diffstat (limited to 'usr.sbin/ntp/scripts/mkver')
-rwxr-xr-x | usr.sbin/ntp/scripts/mkver | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/usr.sbin/ntp/scripts/mkver b/usr.sbin/ntp/scripts/mkver new file mode 100755 index 0000000..a8f5175 --- /dev/null +++ b/usr.sbin/ntp/scripts/mkver @@ -0,0 +1,44 @@ +#!/bin/sh +# +# $FreeBSD$ +# +PROG=${1-UNKNOWN} + +ConfStr="$PROG" + +ConfStr="$ConfStr 4.2.4p5" + +case "$CSET" in + '') ;; + *) ConfStr="$ConfStr@$CSET" ;; +esac + +case "" in + '') + case "1" in + '') ;; + *) ConfStr="${ConfStr}-a" ;; + esac + ;; + *) ConfStr="${ConfStr}-r" ;; +esac + +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- |