From 7aca3a92217ff02be905dc387bf432e7a2f103c1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 25 Mar 2013 09:49:07 -0400 Subject: possible new naming convention, plus factor out version/DEBUG info into a sourced shell script fragment that can be shared by build+package --- tools/linux_packaging/build | 25 +++++++++---------------- tools/linux_packaging/define_versions.sh | 21 +++++++++++++++++++++ tools/linux_packaging/package | 28 +++++++++------------------- 3 files changed, 39 insertions(+), 35 deletions(-) create mode 100644 tools/linux_packaging/define_versions.sh (limited to 'tools') diff --git a/tools/linux_packaging/build b/tools/linux_packaging/build index 93bbcc95b8..df78bc27f8 100755 --- a/tools/linux_packaging/build +++ b/tools/linux_packaging/build @@ -87,10 +87,10 @@ if test x$STRIP != xall -a x$STRIP != xnone -a x$STRIP != xsome ; then exit 1 fi -release_version=`grep -m 1 '[^A-Za-z_]LINUX_VERSION = ' ../../wscript | awk '{ print $3 }' | sed "s/'//g"` -revision=`grep -m 1 'revision =' ../../libs/ardour/revision.cc | cut -d'"' -f 2 | sed -e "s/$release_version-//"` -echo "Version is $release_version / $revision" -info_string="$release_version/$revision built on `hostname` by `whoami` on `date`" +. ./define_versions.sh + +echo "Version is $version / $commit" +info_string="$version ($commit) built on `hostname` by `whoami` on `date`" echo "Info string is $info_string" # Figure out our CPU type @@ -113,13 +113,6 @@ case `uname -m` in ;; esac -# Figure out the Build Type -if grep -q "DEBUG = True" ../../build/c4che/_cache.py; then - DEBUG="T" -else - DEBUG="F" -fi - if [ x$DEBUG = xT ]; then BUILDTYPE="dbg" if [ x$STRIP = xall ] ; then @@ -131,11 +124,11 @@ fi # setup directory structure if [ -z "${BUILDTYPE}" ]; then - APPDIR=${APPNAME}_${ARCH}-${release_version}-${revision} - APP_VER_NAME=${APPNAME}-${release_version}-${revision} + APPDIR=${APPNAME}_${ARCH}-${version} + APP_VER_NAME=${APPNAME}-${version} else - APPDIR=${APPNAME}_${ARCH}-${release_version}-${revision}-${BUILDTYPE} - APP_VER_NAME=${APPNAME}-${release_version}-${revision}-${BUILDTYPE} + APPDIR=${APPNAME}_${ARCH}-${version}-${BUILDTYPE} + APP_VER_NAME=${APPNAME}-${version}-${BUILDTYPE} fi APPBIN=$APPDIR/bin @@ -535,7 +528,7 @@ done # # Add the uninstaller # -sed -e "s/%REPLACE_PGM%/${APPNAME}/" -e "s/%REPLACE_VENDOR%/${VENDOR}/" -e "s/%REPLACE_VERSION%/${release_version}/" -e "s/%REPLACE_BUILD%/${revision}/" -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%/${version}/" -e "s/%REPLACE_BUILD%/${commit}/" -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 diff --git a/tools/linux_packaging/define_versions.sh b/tools/linux_packaging/define_versions.sh new file mode 100644 index 0000000000..611df8017e --- /dev/null +++ b/tools/linux_packaging/define_versions.sh @@ -0,0 +1,21 @@ +# +# this is sourced by build and package, and executed from within build/linux_packaging +# + +release_version=`grep -m 1 '[^A-Za-z_]LINUX_VERSION = ' ../../wscript | awk '{print $3}' | sed "s/'//g"` +r=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed -e 1d -e "s/$release_version-//"` +revcount=`echo $r | cut -d- -f1` +commit=`echo $r | cut -d- -f2` +version=${release_version}.${revcount} + +# +# Figure out the Build Type +# +# Note that the name of the cache file may vary from to time +# + +if grep -q "DEBUG = True" ../../build/c4che/_cache.py; then + DEBUG="T" +else + DEBUG="F" +fi diff --git a/tools/linux_packaging/package b/tools/linux_packaging/package index b1ba58a250..ea50ce4b98 100755 --- a/tools/linux_packaging/package +++ b/tools/linux_packaging/package @@ -50,30 +50,20 @@ while [ $# -gt 0 ] ; do esac done - -# Figure out the Build Type -if grep -q "DEBUG = True" ../../build/c4che/_cache.py; then - DEBUG="T" -else - DEBUG="F" -fi +. ./define_versions.sh if [ x$DEBUG = xT ]; then BUILDTYPE="dbg" fi -release_version=`grep -m 1 '[^A-Za-z_]LINUX_VERSION = ' ../../wscript | awk '{print $3}' | sed "s/'//g"` -revision=`grep -m 1 'revision =' ../../libs/ardour/revision.cc | cut -d'"' -f 2 | sed -e "s/$release_version-//"` - -X86_BUNDLE="${APPNAME}_x86-${release_version}-${revision}" -X86_64_BUNDLE="${APPNAME}_x86_64-${release_version}-${revision}" +X86_BUNDLE="${APPNAME}_x86-${version}" +X86_64_BUNDLE="${APPNAME}_x86_64-${version}" if [ ! -z ${BUILDTYPE} ]; then X86_BUNDLE="${X86_BUNDLE}-${BUILDTYPE}" X86_64_BUNDLE="${X86_64_BUNDLE}-${BUILDTYPE}" fi - if [ ! -e ${X86_BUNDLE}.tar.bz2 ] ; then echo "" echo "Can't locate x86 bundle file ${X86_BUNDLE}.tar.bz2" @@ -122,22 +112,22 @@ fi if [ -z ${BUILDTYPE} ]; then if [ "${SINGLE_ARCH}" = "T" ]; then if [ "${X86_BUNDLE_OK}" = "T" ]; then - PACKAGE="${APPNAME}_32bit-${release_version}-${revision}" + PACKAGE="${APPNAME}_32bit-${version}" else - PACKAGE="${APPNAME}_64bit-${release_version}-${revision}" + PACKAGE="${APPNAME}_64bit-${version}" fi else - PACKAGE="${APPNAME}-${release_version}-${revision}" + PACKAGE="${APPNAME}-${version}" fi else if [ "${SINGLE_ARCH}" = "T" ]; then if [ "${X86_BUNDLE_OK}" = "T" ]; then - PACKAGE="${APPNAME}_32bit-${release_version}-${revision}-${BUILDTYPE}" + PACKAGE="${APPNAME}_32bit-${version}-${BUILDTYPE}" else - PACKAGE="${APPNAME}_64bit-${release_version}-${revision}-${BUILDTYPE}" + PACKAGE="${APPNAME}_64bit-${version}-${BUILDTYPE}" fi else - PACKAGE="${APPNAME}-${release_version}-${revision}-${BUILDTYPE}" + PACKAGE="${APPNAME}-${version}-${BUILDTYPE}" fi fi -- cgit v1.2.3