home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
- #
- # make-version -- shell script to create version.c for finger
- #
- # Copyright (C) 1987, 1990 Philip L. Budne
- #
- # This file is part of "Phil's Finger Program".
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 1, or (at your option)
- # any later version.
- #
-
- # $Id: make-version,v 3.0 90/07/06 13:11:18 budd Rel $
-
- if [ -r BUILD ]
- then
- build=`cat BUILD`
- if expr $build + 1 > /dev/null 2>&1
- then
- build=`expr $build + 1`
- else
- echo bad BUILD file '"'$build'"' -- resetting 1>&2
- build=1
- fi
- else
- echo creating new BUILD file 1>&2
- build=1
- fi
- echo $build > BUILD
- echo build $build 1>&2
-
- echo '/* This file is created by the script make-version */'
- if test -f /bin/hostname ; then
- HOST=`/bin/hostname`
- else
- HOST=`/bin/uname -n`
- fi
-
- cat <<EOF
- char version[] = "`./pversion`";
- char build_who[] = "`./mywhoami`";
- char build_host[] = "$HOST";
- char build_dir[] = "`pwd`";
- char build_date[] = "`date`";
- int build_number = $build;
-
- char longversion[] = "This is finger version `./pversion` build #$build by `./mywhoami` at $HOST\non `date` in `pwd`";
- EOF
- exit 0
-