mkver revision 1.16
1#!/bin/sh 2PROG=${1-UNKNOWN} 3 4ConfStr="$PROG" 5 6ConfStr="$ConfStr 4.2.8p15" 7 8case "$CSET" in 9 '') ;; 10 *) ConfStr="$ConfStr@$CSET" ;; 11esac 12 13case "o" in 14 '') ;; 15 *) ConfStr="${ConfStr}-o" ;; 16esac 17 18if [ -n "$MKREPRO_TIMESTAMP" ]; then 19 SOURCE_DATE_EPOCH=$MKREPRO_TIMESTAMP 20fi 21 22if [ -n "$SOURCE_DATE_EPOCH" ]; then 23 ConfStr="$ConfStr `LC_TIME=C TZ=UTC date -d@$SOURCE_DATE_EPOCH 2>/dev/null`" || 24 ConfStr="$ConfStr `LC_TIME=C TZ=UTC date -r $SOURCE_DATE_EPOCH`" 25else 26 ifile="`dirname $0`/../importdate" 27 if [ -f "$ifile" ]; then 28 # NetBSD MKREPRO: Don't embed current date/time/run number 29 ConfStr="$ConfStr "`cat "$ifile"` 30 else 31 ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`" 32 fi 33fi 34 35if [ ! -f .version ]; then 36 echo 0 > .version 37fi 38RUN="`cat .version`" 39RUN="`expr $RUN + 1`" 40echo $RUN > .version 41 42ConfStr="$ConfStr (${RUN})" 43 44echo "Version <${ConfStr}>"; 45 46rm -f version.c 47cat > version.c << -EoF- 48/* 49 * version file for $PROG 50 */ 51#include <config.h> 52const char * Version = "${ConfStr}"; 53-EoF- 54