aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Sardara <msardara+fdio@cisco.com>2017-04-19 17:52:01 +0200
committerMauro Sardara <msardara+fdio@cisco.com>2017-04-19 16:04:41 +0000
commit1db24e58a84687c973ec12d293ece4cdd2a63b40 (patch)
tree7c55e8dd6948d5136fc7a7548888acb305a60299
parent7e312299ab4a84334af19e4988e9c5365626b80b (diff)
Adding possibility to run build script from any folder.
Change-Id: I88fe7d0efdb169f899b95106063ac0b7dc7f6077 Signed-off-by: Mauro Sardara <msardara+fdio@cisco.com>
-rw-r--r--scripts/build-package.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/build-package.sh b/scripts/build-package.sh
index 288c5b4a..9673438a 100644
--- a/scripts/build-package.sh
+++ b/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"}
@@ -197,7 +198,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 ..
@@ -215,6 +216,6 @@ build_package() {
}
PACKAGE_NAME="LIBICNET"
-pushd ..
+pushd $SCRIPT_PATH/..
build_package $PACKAGE_NAME
popd \ No newline at end of file