2007-07-18 23:59:14 +00:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
|
2007-11-20 20:05:09 +00:00
|
|
|
# convention: -TR MAJOR MINOR MAINT STATUS - (each a single char)
|
2009-01-11 16:58:14 +00:00
|
|
|
# STATUS: "X" for prerelease beta builds,
|
2007-11-20 20:05:09 +00:00
|
|
|
# "Z" for unsupported trunk builds,
|
|
|
|
# "0" for stable, supported releases
|
2007-08-27 17:35:21 +00:00
|
|
|
# these should be the only two lines you need to change
|
2009-04-13 01:19:54 +00:00
|
|
|
PEERID_PREFIX="-TR152Z-"
|
|
|
|
USERAGENT_PREFIX="1.52+"
|
2007-08-27 17:35:21 +00:00
|
|
|
|
2008-12-06 15:06:59 +00:00
|
|
|
SVN_REVISION=`find -E ./libtransmission ./macosx \
|
|
|
|
-regex ".*\.([chmp]|cpp|po|sh)" \
|
|
|
|
-exec grep -oh '\$Id: [^ ]\+ [0-9]\+' {} + \
|
|
|
|
| awk '{ if ($3 > max) max = $3} END { print max }'`
|
2008-11-30 17:46:19 +00:00
|
|
|
|
2007-07-18 23:59:14 +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.h
|
|
|
|
cat > libtransmission/version.h.new << EOF
|
2008-10-12 23:31:20 +00:00
|
|
|
#define PEERID_PREFIX "$PEERID_PREFIX"
|
|
|
|
#define USERAGENT_PREFIX "$USERAGENT_PREFIX"
|
|
|
|
#define SVN_REVISION "$SVN_REVISION"
|
|
|
|
#define SHORT_VERSION_STRING "$USERAGENT_PREFIX"
|
|
|
|
#define LONG_VERSION_STRING "$USERAGENT_PREFIX ($SVN_REVISION)"
|
|
|
|
|
|
|
|
#define VERSION_STRING_INFOPLIST $USERAGENT_PREFIX
|
|
|
|
#define BUNDLE_VERSION_INFOPLIST $SVN_REVISION
|
2007-07-18 23:59:14 +00:00
|
|
|
EOF
|
2009-01-11 16:58:14 +00:00
|
|
|
|
2009-01-23 02:39:34 +00:00
|
|
|
# Add a release definition
|
2009-01-11 16:58:14 +00:00
|
|
|
if [ ${PEERID_PREFIX:6:1} = X ]; then
|
2009-01-16 21:29:49 +00:00
|
|
|
line='#define TR_BETA_RELEASE "BETA"'
|
|
|
|
elif [ ${PEERID_PREFIX:6:1} = Z ]; then
|
|
|
|
line='#define TR_NIGHTLY_RELEASE "NIGHTLY"'
|
|
|
|
else
|
|
|
|
line='#define TR_STABLE_RELEASE "STABLE"'
|
2009-01-11 16:58:14 +00:00
|
|
|
fi
|
2009-01-16 21:29:49 +00:00
|
|
|
echo $line >> libtransmission/version.h.new
|
2009-01-11 16:58:14 +00:00
|
|
|
|
2007-07-18 23:59:14 +00:00
|
|
|
replace_if_differs libtransmission/version.h.new libtransmission/version.h
|
|
|
|
|
|
|
|
exit 0
|