654617a25330a14220344695984706100f60b681
[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]*)-?([0-9][0-9]*)?-?([a-z0-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 r=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\3/"`
16 commit=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\4/"`
17
18 if [ "x$r" != "x" ] ; then
19     revcount=$r
20 fi
21
22 release_version=${major_version}.${minor_version}${revcount:+.$revcount}
23
24 #
25 # Figure out the Build Type
26 #
27 # Note that the name of the cache file may vary from to time
28 #
29
30 if grep -q "DEBUG = True" ../../build/c4che/_cache.py; then
31         DEBUG="T"
32 else
33         DEBUG="F"
34 fi