source: trunk/version.sh @ 1661

Last change on this file since 1661 was 1661, checked in by livings124, 16 years ago

add version info for maintenance number (z in x.y.z) and if dev build

  • Property svn:executable set to *
  • Property svn:keywords set to Date Rev Author Id
File size: 1.6 KB
Line 
1#! /bin/sh
2#
3# $Id: version.sh 1661 2007-04-04 20:37:14Z livings124 $
4
5MAJOR=0
6MINOR=6
7MAINT=1
8
9# 0 for release, 1 otherwise
10DEV=1
11
12STRING=0.7-svn
13
14# Get current SVN revision from Ids in all source files
15REV=`( find . '(' -name '*.[chm]' -o -name '*.cpp' -o -name '*.po' \
16            -o -name '*.mk' -o -name '*.in' -o -name 'Makefile' \
17            -o -name 'configure' ')' -exec cat '{}' ';' ) | \
18          sed -e '/\$Id:/!d' -e \
19            's/.*\$Id: [^ ]* \([0-9]*\) .*/\1/' |
20          awk 'BEGIN { REV=0 }
21               //    { if ( $1 > REV ) REV=$1 }
22               END   { print REV }'`
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 > mk/version.mk.new << EOF
37VERSION_MAJOR       = $MAJOR
38VERSION_MINOR       = $MINOR
39VERSION_MAINTENANCE = $MAINT
40VERSION_DEV         = $DEV
41VERSION_STRING      = $STRING
42VERSION_REVISION    = $REV
43EOF
44replace_if_differs mk/version.mk.new mk/version.mk
45
46# Generate version.h
47cat > libtransmission/version.h.new << EOF
48#define VERSION_MAJOR       $MAJOR
49#define VERSION_MINOR       $MINOR
50#define VERSION_MAINTENANCE $MAINT
51#define VERSION_DEV         $DEV
52#define VERSION_STRING      "$STRING"
53#define VERSION_REVISION    $REV
54EOF
55replace_if_differs libtransmission/version.h.new libtransmission/version.h
56
57# Generate Info.plist from Info.plist.in
58sed -e "s/%%BUNDLE_VERSION%%/$REV/" -e "s/%%SHORT_VERSION_STRING%%/$STRING/" \
59        < macosx/Info.plist.in > macosx/Info.plist.new
60replace_if_differs macosx/Info.plist.new macosx/Info.plist
61
62exit 0
Note: See TracBrowser for help on using the repository browser.