2006-07-16 19:39:23 +00:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
|
2006-11-11 02:02:44 +00:00
|
|
|
MAJOR=0
|
|
|
|
MINOR=6
|
|
|
|
STRING=0.7-svn
|
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
# Get current SVN revision from Ids in all source files
|
2006-11-11 02:02:44 +00:00
|
|
|
REV=`( find . '(' -name '*.[chm]' -o -name '*.cpp' -o -name '*.po' \
|
2006-10-28 16:51:28 +00:00
|
|
|
-o -name '*.mk' -o -name '*.in' -o -name 'Makefile' \
|
|
|
|
-o -name 'configure' ')' -exec cat '{}' ';' ) | \
|
|
|
|
sed -e '/\$Id:/!d' -e \
|
|
|
|
's/.*\$Id: [^ ]* \([0-9]*\) .*/\1/' |
|
|
|
|
awk 'BEGIN { REV=0 }
|
|
|
|
// { if ( $1 > REV ) REV=$1 }
|
|
|
|
END { print REV }'`
|
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
# Generate files to be included: only overwrite them if changed so make
|
|
|
|
# won't rebuild everything unless necessary
|
|
|
|
replace_if_differs ()
|
|
|
|
{
|
|
|
|
if cmp $1 $2 > /dev/null 2>&1; then
|
|
|
|
rm -f $1
|
|
|
|
else
|
|
|
|
mv -f $1 $2
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Generate version.mk
|
2006-11-11 02:02:44 +00:00
|
|
|
cat > mk/version.mk.new << EOF
|
|
|
|
VERSION_MAJOR = $MAJOR
|
|
|
|
VERSION_MINOR = $MINOR
|
|
|
|
VERSION_STRING = $STRING
|
|
|
|
VERSION_REVISION = $REV
|
|
|
|
EOF
|
2006-07-16 19:39:23 +00:00
|
|
|
replace_if_differs mk/version.mk.new mk/version.mk
|
|
|
|
|
2006-11-11 02:02:44 +00:00
|
|
|
# Generate version.h
|
|
|
|
cat > libtransmission/version.h.new << EOF
|
|
|
|
#define VERSION_MAJOR $MAJOR
|
|
|
|
#define VERSION_MINOR $MINOR
|
|
|
|
#define VERSION_STRING "$STRING"
|
|
|
|
#define VERSION_REVISION $REV
|
|
|
|
EOF
|
2006-07-16 19:39:23 +00:00
|
|
|
replace_if_differs libtransmission/version.h.new libtransmission/version.h
|
|
|
|
|
2006-11-11 02:02:44 +00:00
|
|
|
# Generate Info.plist from Info.plist.in
|
|
|
|
sed -e "s/%%BUNDLE_VERSION%%/$REV/" -e "s/%%SHORT_VERSION_STRING%%/$STRING/" \
|
|
|
|
< macosx/Info.plist.in > macosx/Info.plist.new
|
|
|
|
replace_if_differs macosx/Info.plist.new macosx/Info.plist
|
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
exit 0
|