update packaging tools to always use revision.cc to determine version number, not...
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 5 Nov 2013 14:35:03 +0000 (09:35 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 5 Nov 2013 14:35:03 +0000 (09:35 -0500)
tools/define_versions.sh
tools/linux_packaging/build
tools/linux_packaging/package
tools/osx_packaging/osx_build

index 6f5c17773cbdcaec32c404e89b054fcedd11fd89..654617a25330a14220344695984706100f60b681 100644 (file)
@@ -2,15 +2,24 @@
 # this is sourced by build and package, and executed from within build/{osx,linux}_packaging
 #
 
-major_version=`grep -m 1 '^MAJOR = ' ../../wscript | awk '{print $3}' | sed "s/'//g"`
-minor_version=`grep -m 1 '^MINOR = ' ../../wscript | awk '{print $3}' | sed "s/'//g"`
-release_version=${major_version}.${minor_version}
-r=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed -e 1d -e "s/[0-9][0-9]*\.[0-9][0-9]*-//"`
-if echo $r | grep -q -e - ; then
-    revcount=`echo $r | cut -d- -f1`
+if uname -a | grep arwin >/dev/null 2>&1 ; then
+    EXTENDED_RE=-E
+else
+    EXTENDED_RE=-r
+fi
+
+GIT_REV_REGEXP='([0-9][0-9]*)\.([0-9][0-9]*)-?([0-9][0-9]*)?-?([a-z0-9]*)'
+
+major_version=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE  -e 1d -e "s/$GIT_REV_REGEXP/\1/"`
+minor_version=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\2/"`
+r=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\3/"`
+commit=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\4/"`
+
+if [ "x$r" != "x" ] ; then
+    revcount=$r
 fi
-commit=`echo $r | cut -d- -f2`
-version=${release_version}${revcount:+.$revcount}
+
+release_version=${major_version}.${minor_version}${revcount:+.$revcount}
 
 #
 # Figure out the Build Type
index e7f7d8b6ddb74ee9c92f10a864fc491f0b744e49..e8cc4d53b2d1fa7f480c1401305cd7d9b6d7845a 100755 (executable)
@@ -97,8 +97,12 @@ fi
 
 . ../define_versions.sh
 
-echo "Version is $version / $commit"
-info_string="$version ($commit) built on `hostname` by `whoami` on `date`"
+echo "Version is $release_version"
+if [ "x$commit" != "x" ] ; then
+    info_string="$release_version ($commit) built on `hostname` by `whoami` on `date`"
+else
+    info_string="$release_version built on `hostname` by `whoami` on `date`"
+fi
 echo "Info string is $info_string"
 
 # Figure out our CPU type
@@ -134,11 +138,11 @@ fi
 # setup directory structure
 
 if [ -z "${BUILDTYPE}" ]; then
-       APPDIR=${APPNAME}_${ARCH}-${version}
-       APP_VER_NAME=${APPNAME}-${version}
+       APPDIR=${APPNAME}_${ARCH}-${release_version}
+       APP_VER_NAME=${APPNAME}-${release_version}
 else
-       APPDIR=${APPNAME}_${ARCH}-${version}-${BUILDTYPE}
-       APP_VER_NAME=${APPNAME}-${version}-${BUILDTYPE}
+       APPDIR=${APPNAME}_${ARCH}-${release_version}-${BUILDTYPE}
+       APP_VER_NAME=${APPNAME}-${release_version}-${BUILDTYPE}
 fi
 
 APPBIN=$APPDIR/bin
@@ -569,7 +573,7 @@ fi
 #
 # Add the uninstaller
 #
-sed -e "s/%REPLACE_PGM%/${APPNAME}/" -e "s/%REPLACE_VENDOR%/${VENDOR}/" -e "s/%REPLACE_VERSION%/${version}/" -e "s/%REPLACE_TYPE%/${BUILDTYPE}/" < uninstall.sh.in > $APPBIN/${APP_VER_NAME}.uninstall.sh
+sed -e "s/%REPLACE_PGM%/${APPNAME}/" -e "s/%REPLACE_VENDOR%/${VENDOR}/" -e "s/%REPLACE_VERSION%/${release_version}/" -e "s/%REPLACE_TYPE%/${BUILDTYPE}/" < uninstall.sh.in > $APPBIN/${APP_VER_NAME}.uninstall.sh
 chmod a+x $APPBIN/${APP_VER_NAME}.uninstall.sh
 
 #Sanity Check file
index 259a2a22daf622de08c2dc7585daf94fc320eb79..5fc6aee1f78e65873159878fb4d3d02a3d30cf14 100755 (executable)
@@ -56,8 +56,8 @@ if [ x$DEBUG = xT ]; then
        BUILDTYPE="dbg"
 fi
 
-X86_BUNDLE="${APPNAME}_x86-${version}"
-X86_64_BUNDLE="${APPNAME}_x86_64-${version}"
+X86_BUNDLE="${APPNAME}_x86-${release_version}"
+X86_64_BUNDLE="${APPNAME}_x86_64-${release_version}"
 
 if [ ! -z ${BUILDTYPE} ]; then
        X86_BUNDLE="${X86_BUNDLE}-${BUILDTYPE}"
@@ -112,22 +112,22 @@ fi
 if [ -z ${BUILDTYPE} ]; then
        if [ "${SINGLE_ARCH}" = "T" ]; then
                if [ "${X86_BUNDLE_OK}" = "T" ]; then
-                       PACKAGE="${APPNAME}_32bit-${version}"
+                       PACKAGE="${APPNAME}_32bit-${release_version}"
                else
-                       PACKAGE="${APPNAME}_64bit-${version}"
+                       PACKAGE="${APPNAME}_64bit-${release_version}"
                fi
        else
-               PACKAGE="${APPNAME}-${version}"
+               PACKAGE="${APPNAME}-${release_version}"
        fi
 else
        if [ "${SINGLE_ARCH}" = "T" ]; then
                if [ "${X86_BUNDLE_OK}" = "T" ]; then
-                       PACKAGE="${APPNAME}_32bit-${version}-${BUILDTYPE}"
+                       PACKAGE="${APPNAME}_32bit-${release_version}-${BUILDTYPE}"
                else
-                       PACKAGE="${APPNAME}_64bit-${version}-${BUILDTYPE}"
+                       PACKAGE="${APPNAME}_64bit-${release_version}-${BUILDTYPE}"
                fi
        else
-               PACKAGE="${APPNAME}-${version}-${BUILDTYPE}"
+               PACKAGE="${APPNAME}-${release_version}-${BUILDTYPE}"
        fi
 fi 
 
index c47e64483c8da46369e9953c76faf8e54f210509..fcf1febe84fc78c2dd1641336c6d5918a47594ab 100755 (executable)
@@ -75,8 +75,12 @@ if test -z "$PRODUCT_PKG_DIR" -o -z "$APPNAME"; then
 fi
 
 . ../define_versions.sh
-echo "Version is $release_version / $revision"
-info_string="$version built on `hostname` by `whoami` on `date`"
+echo "Version is $release_version"
+if [ "x$commit" != "x" ] ; then
+    info_string="$release_version ($commit) built on `hostname` by `whoami` on `date`"
+else
+    info_string="$release_version built on `hostname` by `whoami` on `date`"
+fi
 echo "Info string is $info_string"
 
 # setup directory structure
@@ -177,12 +181,12 @@ env="<key>LSEnvironment</key><dict>$env<key>ARDOUR_BUNDLED</key><string>true</st
 
 # edit plist
 sed -e "s?@ENV@?$env?g" \
-    -e "s?@VERSION@?$release_version/$revision?g" \
+    -e "s?@VERSION@?$release_version?g" \
     -e "s?@INFOSTRING@?$info_string?g" < Info.plist.in > Info.plist
 # and plist strings
 sed -e "s?@APPNAME@?$appname?" \
     -e "s?@ENV@?$env?g" \
-    -e "s?@VERSION@?$release_version/$revision?g" \
+    -e "s?@VERSION@?$release_version?g" \
     -e "s?@INFOSTRING@?$info_string?g" < InfoPlist.strings.in > Resources/InfoPlist.strings || exit 1
 
 # copy static files
@@ -569,10 +573,10 @@ fi
 
 echo "Building DMG ..."
 
-# UC_DMG=$APPNAME-${release_version}-${revision}-UC.dmg
-# FINAL_DMG=$APPNAME-${release_version}-${revision}.dmg
-UC_DMG=$APPNAME-$version.dmg
-VOLNAME=$APPNAME-$version
+# UC_DMG=$APPNAME-${release_version}-UC.dmg
+# FINAL_DMG=$APPNAME-${release_version}.dmg
+UC_DMG=$APPNAME-$release_version.dmg
+VOLNAME=$APPNAME-$release_version
 
 # TODO use mktemp
 export TMPDIR=`pwd`