#!/bin/bash
########################################################
# $Id: mksvnversion 36 2005-09-29 01:20:10Z bcornec $
########################################################
#
# on every build, record the working copy revision string
#
dname=`dirname $0`
prem=`echo $dname |cut -c1`
if [ ${prem} == "/" ]; then
	export TOOLHOME=$dname
else
	export TOOLHOME=${PWD}/$dname
fi
. $TOOLHOME/rpm-env

#
# Create a .c file for mondo to link with and get
# the right build version from SVN
#
rel=`svnversion $TOOLHOME/..`
cat > $TOOLHOME/../mondo/svn_version.c << EOF
const char* svn_version(void) {
	const char* SVN_Version = "${rel}"; 
	return SVN_Version; 
}"
EOF

#
# return the release
#
echo ${rel}
