merge fix for tempo branch
[ardour.git] / tools / define_versions.sh
1
2 # this is sourced by build and package, and executed from within build/{osx,linux}_packaging
3 #
4
5 if uname -a | grep arwin >/dev/null 2>&1 ; then
6     EXTENDED_RE=-E
7 else
8     EXTENDED_RE=-r
9 fi
10
11 GIT_REV_REGEXP='([0-9][0-9]*)\.([0-9][0-9]*)\-?(rc[0-9]*)?-?([0-9][0-9]*)?(-g([a-f0-9]+))?'
12
13 major_version=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\1/"`
14 minor_version=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\2/"`
15 rc=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\3/"`
16 r=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\4/"`
17 commit=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\6/"`
18
19 if [ "x$rc" != "x" ] ; then
20     revcount=$rc${r:+.$r}
21 elif [ "x$r" != "x" ] ; then
22     revcount=$r
23 else
24     revcount=0
25 fi
26
27 release_version=${major_version}.${minor_version}${revcount:+.$revcount}
28
29 #
30 # Figure out the Build Type
31 #
32 # Note that the name of the cache file may vary from to time
33 #
34
35 if grep -q "DEBUG = True" ../../build/c4che/_cache.py; then
36         DEBUG="T"
37 else
38         DEBUG="F"
39 fi