#!/bin/sh -
#	$Id: s_release,v 1.2 2005/03/17 19:23:07 gmf Exp $
#
# Build miscellaneous files that change when the version is bumped.

. RELEASE

TMP=/tmp/s_release$$a
trap "rm -f $TMPA; exit 1" 1 2 3 15

process() {
    template=$1
    target=$2

    sed -e "s/@DBXML_VERSION_MAJOR@/$DBXML_VERSION_MAJOR/g" \
        -e "s/@DBXML_VERSION_MINOR@/$DBXML_VERSION_MINOR/g" \
        -e "s/@DBXML_VERSION_PATCH@/$DBXML_VERSION_PATCH/g" \
        -f lib_paths.sed \
     < $template > $TMP

    # Set the file mode to 644 because the VC++ IDE needs a writeable file
    # in our development environment.
    cmp $TMP $target > /dev/null 2>&1 ||
	(echo "Building $target" && rm -f $target &&
	    cp $TMP $target && chmod 664 $target)
}

process buildall.sh.template buildall.sh
process reltools/buildrelease.template reltools/buildrelease
rm -f $TMP
