source: trunk/macosx/version.sh @ 3562

Last change on this file since 3562 was 3562, checked in by charles, 15 years ago

tell version.sh that it lives in macosx/ now.

  • Property svn:executable set to *
  • Property svn:keywords set to Date Rev Author Id
File size: 1.7 KB
Line 
1#! /bin/sh
2#
3# $Id: version.sh 3562 2007-10-25 20:30:20Z charles $
4
5# convention: -TR MAJOR MINOR MAINT BETA - (each a single char)
6# BETA: "Z" for beta, "0" for stable
7# these should be the only two lines you need to change
8PEERID_PREFIX="-TR090Z-"
9USERAGENT_PREFIX="0.90+"
10
11
12SVN_REVISION=`find ./ -name "*\.[ch]" -o -name "*\.cpp" -o -name "*\.po" | \
13              xargs grep "\$Id:" | \
14              grep -v third-party | \
15              cut -d"$Id:" -f3 | cut -d" " -f3 | sort -n | tail -n 1`
16
17if test "x${PEERID_PREFIX//Z/}" = "x$PEERID_PREFIX";
18then
19    STABLE_RELEASE=yes
20else
21    STABLE_RELEASE=no
22fi
23 
24# Generate files to be included: only overwrite them if changed so make
25# won't rebuild everything unless necessary
26replace_if_differs ()
27{
28    if cmp $1 $2 > /dev/null 2>&1; then
29      rm -f $1
30    else
31      mv -f $1 $2
32    fi
33}
34
35# Generate version.mk
36cat > macosx/version.mk.new << EOF
37VERSION_REVISION    = "$SVN_REVISION"
38VERSION_STRING      = "$USERAGENT_PREFIX ($SVN_REVISION)"
39STABLE_RELEASE      = "$STABLE_RELEASE"
40EOF
41replace_if_differs macosx/version.mk.new macosx/version.mk
42
43# Generate version.h
44cat > libtransmission/version.h.new << EOF
45#define PEERID_PREFIX         "$PEERID_PREFIX"
46#define USERAGENT_PREFIX      "$USERAGENT_PREFIX"
47#define SVN_REVISION          "$SVN_REVISION"
48#define SHORT_VERSION_STRING  "$USERAGENT_PREFIX"
49#define LONG_VERSION_STRING   "$USERAGENT_PREFIX ($SVN_REVISION)"
50EOF
51replace_if_differs libtransmission/version.h.new libtransmission/version.h
52
53# Generate Info.plist from Info.plist.in
54sed -e "s/%%BUNDLE_VERSION%%/$SVN_REVISION/" -e "s/%%SHORT_VERSION_STRING%%/$USERAGENT_PREFIX/" \
55        < macosx/Info.plist.in > macosx/Info.plist.new
56replace_if_differs macosx/Info.plist.new macosx/Info.plist
57
58exit 0
Note: See TracBrowser for help on using the repository browser.