aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Sardara <msardara+fdio@cisco.com>2017-04-19 17:51:23 +0200
committerMauro Sardara <msardara+fdio@cisco.com>2017-04-19 17:51:23 +0200
commit8eb99c48f492a311753113ac75fb99892b79ae39 (patch)
tree8303c8e0d53944c46001b71ae0dfe6c0dba0e161
parentf67983fcd706709b7f1bcf70fa185c33be95624a (diff)
Adding possibility to run build script from any folder
Change-Id: Ied1eb7286f73020cf4b2dd74de790b05b92e7190 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 5c1ed125..6ea9aab0 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="HTTP_SERVER"
-pushd ..
+pushd $SCRIPT_PATH/..
build_package $PACKAGE_NAME
popd