diff options
author | Mauro Sardara <msardara+fdio@cisco.com> | 2017-04-19 17:49:23 +0200 |
---|---|---|
committer | Mauro Sardara <msardara+fdio@cisco.com> | 2017-04-19 16:04:19 +0000 |
commit | fe3052d3a135ec679fb38e915adbd0554f565674 (patch) | |
tree | f7a8c996d4ec4b7a5ae916ef66e614e7e3a31c34 | |
parent | dab60bdfb83121478b37f70a8321480e39f7bc7f (diff) |
Adding possibility to run build script from any directory.
Change-Id: Ic59fb41fcf7563b23dd14d3a773831a58a0f224e
Signed-off-by: Mauro Sardara <msardara+fdio@cisco.com>
-rw-r--r-- | libccnx-common/scripts/build-package.sh | 5 | ||||
-rw-r--r-- | libccnx-portal/scripts/build-package.sh | 5 | ||||
-rw-r--r-- | 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 |