#!/bin/bash ######################################################## # $Id: mksvnversion 33 2005-09-29 01:11:40Z 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 # # Patches the file needing that release reference # perl -pi -e "s/^Release:.*$/Release: ${rel}" $TOOLHOME/../*/*spec # # return the release # echo ${rel}