From e525b169f2879456e8f4c507633180ce63b26e28 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 9 Mar 2015 12:41:46 -0500 Subject: attempt to remove major version hard-coding from linux packaging tools --- tools/linux_packaging/build | 8 +++++--- tools/linux_packaging/stage2.run | 12 ++++++------ tools/linux_packaging/uninstall.sh.in | 7 ++++--- 3 files changed, 15 insertions(+), 12 deletions(-) (limited to 'tools') diff --git a/tools/linux_packaging/build b/tools/linux_packaging/build index 3bddd16b6b..3d88076441 100755 --- a/tools/linux_packaging/build +++ b/tools/linux_packaging/build @@ -14,6 +14,8 @@ ARDOURSTACK_ROOT=$HOME/a3/inst # the waf build tree to use when copying built/generated files BUILD_ROOT=../../build +. ../define_versions.sh + # where harvid and xjadeo binaries are cached if test -z "$CACHEDIR" -o ! -d "$CACHEDIR"; then CACHEDIR=`pwd` @@ -233,8 +235,8 @@ echo export 'PATH=/usr/local/bin:/opt/bin:$PATH' >> $ENVIRONMENT # create startup helper script -sed -e "/^%ENV%/r $ENVIRONMENT" -e '/^%ENV%/d' -e 's/%VER%/'"${release_version}"'/' < ardour.sh.in > $APPBIN/ardour3 -rm $ENVIRONMENT && chmod 775 $APPBIN/ardour3 +sed -e "/^%ENV%/r $ENVIRONMENT" -e '/^%ENV%/d' -e 's/%VER%/'"${release_version}"'/' < ardour.sh.in > $APPBIN/ardour${major_version} +rm $ENVIRONMENT && chmod 775 $APPBIN/ardour${major_version} MAIN_EXECUTABLE=ardour-${release_version} echo "Copying ardour executable ...." @@ -638,7 +640,7 @@ fi # # Add the uninstaller # -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 +sed -e "s/%REPLACE_PGM%/${APPNAME}/" -e "s/%REPLACE_VENDOR%/${VENDOR}/" -e "s/%REPLACE_MAJOR_VERSION%/${major_version}/" -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 diff --git a/tools/linux_packaging/stage2.run b/tools/linux_packaging/stage2.run index effc97b636..061edeb6cc 100755 --- a/tools/linux_packaging/stage2.run +++ b/tools/linux_packaging/stage2.run @@ -8,11 +8,11 @@ # ################################### - +MAJOR_VERSION=3 PGM_NAME="Ardour" PGM_VENDOR="Ardour" -PGM_EXEC_FILE="ardour3" +PGM_EXEC_FILE="ardour${MAJOR_VERSION}" THE_SHELL="/bin/sh" @@ -500,16 +500,16 @@ ${SUPER} cp -f ${BUNDLE_DIR}/bin/*.uninstall.sh ${INSTALL_DEST_BASE}/. # Create link to the program in user bin echo "" -echo "Creating link ${PGM_NAME}3 in ${USER_BIN_DIR}" +echo "Creating link ${PGM_NAME}${MAJOR_VERSION} in ${USER_BIN_DIR}" echo "" if [ -d "${USER_BIN_DIR}" ]; then - if [ -e "${USER_BIN_DIR}/${PGM_NAME}3" ]; then - ${SUPER} rm -f ${USER_BIN_DIR}/${PGM_NAME}3 + if [ -e "${USER_BIN_DIR}/${PGM_NAME}${MAJOR_VERSION}" ]; then + ${SUPER} rm -f ${USER_BIN_DIR}/${PGM_NAME}${MAJOR_VERSION} fi cd "${USER_BIN_DIR}" - ${SUPER} ln -sf ${PGM_EXEC_PATH} ${PGM_NAME}3 + ${SUPER} ln -sf ${PGM_EXEC_PATH} ${PGM_NAME}${MAJOR_VERSION} cd "${PKG_PATH}" else diff --git a/tools/linux_packaging/uninstall.sh.in b/tools/linux_packaging/uninstall.sh.in index c1d6cf561e..20aa1b688d 100644 --- a/tools/linux_packaging/uninstall.sh.in +++ b/tools/linux_packaging/uninstall.sh.in @@ -7,6 +7,7 @@ # ##################################### +MAJOR_VERSION="%REPLACE_MAJOR_VERSION%" PGM_NAME="%REPLACE_PGM%" PGM_VENDOR="%REPLACE_VENDOR%" @@ -160,14 +161,14 @@ then fi # delete the bin link if it is linked to this version - if [ -e "${USER_BIN_DIR}/${PGM_NAME}3" ]; + if [ -e "${USER_BIN_DIR}/${PGM_NAME}${MAJOR_VERSION}" ]; then - BIN_LINK_TARGET=$(readlink "${USER_BIN_DIR}/${PGM_NAME}3") + BIN_LINK_TARGET=$(readlink "${USER_BIN_DIR}/${PGM_NAME}${MAJOR_VERSION}") BIN_LINK_TARGET_DIR=$(dirname "${BIN_LINK_TARGET}") if [ "${BIN_LINK_TARGET_DIR}" = "${PGM_PATH}/bin" ]; then - ${SUPER} rm -f "${USER_BIN_DIR}/${PGM_NAME}3" + ${SUPER} rm -f "${USER_BIN_DIR}/${PGM_NAME}${MAJOR_VERSION}" fi fi -- cgit v1.2.3