From fe3052d3a135ec679fb38e915adbd0554f565674 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Wed, 19 Apr 2017 17:49:23 +0200 Subject: Adding possibility to run build script from any directory. Change-Id: Ic59fb41fcf7563b23dd14d3a773831a58a0f224e Signed-off-by: Mauro Sardara --- libccnx-common/scripts/build-package.sh | 5 +++-- libccnx-portal/scripts/build-package.sh | 5 +++-- libccnx-transport-rta/scripts/build-package.sh | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/libccnx-common/scripts/build-package.sh b/libccnx-common/scripts/build-package.sh index b3e9fac1..7a057087 100644 --- a/libccnx-common/scripts/build-package.sh +++ b/libccnx-common/scripts/build-package.sh @@ -3,6 +3,7 @@ set -euxo pipefail IFS=$'\n\t' +SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P ) APT_PATH=`which apt-get` || true apt_get=${APT_PATH:-"/usr/local/bin/apt-get"} @@ -196,7 +197,7 @@ build_package() { hostname # Make the package - mkdir -p build && pushd build + mkdir -p $SCRIPT_PATH/../build && pushd $SCRIPT_PATH/../build rm -rf * cmake -DCMAKE_INSTALL_PREFIX=/usr -DRPM_PACKAGE=$RPM -DDEB_PACKAGE=$DEB -DDISTRIBUTION=$DISTRIB_CODENAME -DARCHITECTURE=$ARCHITECTURE .. @@ -214,6 +215,6 @@ build_package() { } PACKAGE_NAME="LIBCCNX_COMMON" -pushd .. +pushd $SCRIPT_PATH/.. build_package $PACKAGE_NAME popd diff --git a/libccnx-portal/scripts/build-package.sh b/libccnx-portal/scripts/build-package.sh index ffdee46d..bfa95693 100644 --- a/libccnx-portal/scripts/build-package.sh +++ b/libccnx-portal/scripts/build-package.sh @@ -3,6 +3,7 @@ set -euxo pipefail IFS=$'\n\t' +SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P ) APT_PATH=`which apt-get` || true apt_get=${APT_PATH:-"/usr/local/bin/apt-get"} @@ -196,7 +197,7 @@ build_package() { hostname # Make the package - mkdir -p build && pushd build + mkdir -p $SCRIPT_PATH/../build && pushd $SCRIPT_PATH/../build rm -rf * cmake -DCMAKE_INSTALL_PREFIX=/usr -DRPM_PACKAGE=$RPM -DDEB_PACKAGE=$DEB -DDISTRIBUTION=$DISTRIB_CODENAME -DARCHITECTURE=$ARCHITECTURE .. @@ -214,6 +215,6 @@ build_package() { } PACKAGE_NAME="LIBCCNX_PORTAL" -pushd .. +pushd $SCRIPT_PATH/.. build_package $PACKAGE_NAME popd diff --git a/libccnx-transport-rta/scripts/build-package.sh b/libccnx-transport-rta/scripts/build-package.sh index 6b92bc16..9d4b13f6 100644 --- a/libccnx-transport-rta/scripts/build-package.sh +++ b/libccnx-transport-rta/scripts/build-package.sh @@ -3,6 +3,7 @@ set -euxo pipefail IFS=$'\n\t' +SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P ) APT_PATH=`which apt-get` || true apt_get=${APT_PATH:-"/usr/local/bin/apt-get"} @@ -196,7 +197,7 @@ build_package() { hostname # Make the package - mkdir -p build && pushd build + mkdir -p $SCRIPT_PATH/../build && pushd $SCRIPT_PATH/../build rm -rf * cmake -DCMAKE_INSTALL_PREFIX=/usr -DRPM_PACKAGE=$RPM -DDEB_PACKAGE=$DEB -DDISTRIBUTION=$DISTRIB_CODENAME -DARCHITECTURE=$ARCHITECTURE .. @@ -214,6 +215,6 @@ build_package() { } PACKAGE_NAME="LIBCCNX_TRANSPORT_RTA" -pushd .. +pushd $SCRIPT_PATH/.. build_package $PACKAGE_NAME popd -- cgit 1.2.3-korg