From ae6628a0da01b3568efeb51c121482d3cf546b59 Mon Sep 17 00:00:00 2001 From: Pierre-Sylvain Desse Date: Thu, 21 Aug 2014 11:00:41 +0200 Subject: [PATCH] Add autobuild scripts --- autobuild/build.sh | 12 ++++++++++++ autobuild/configure.sh | 18 ++++++++++++++++++ autobuild/includes.sh | 14 ++++++++++++++ autobuild/package.sh | 20 ++++++++++++++++++++ autobuild/vars.sh | 9 +++++++++ 5 files changed, 73 insertions(+) create mode 100755 autobuild/build.sh create mode 100755 autobuild/configure.sh create mode 100644 autobuild/includes.sh create mode 100755 autobuild/package.sh create mode 100644 autobuild/vars.sh diff --git a/autobuild/build.sh b/autobuild/build.sh new file mode 100755 index 0000000..62f656d --- /dev/null +++ b/autobuild/build.sh @@ -0,0 +1,12 @@ +#! /bin/bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +source autobuild/vars.sh +source autobuild/includes.sh + +cd "$MAKEDIR" +_run make all + +exit 0 diff --git a/autobuild/configure.sh b/autobuild/configure.sh new file mode 100755 index 0000000..2414258 --- /dev/null +++ b/autobuild/configure.sh @@ -0,0 +1,18 @@ +#! /bin/bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +source autobuild/vars.sh +source autobuild/includes.sh + +### Cleanup +_run rm -rf "$MAKEDIR" + +### Configure +_run mkdir -p "$MAKEDIR" +cd "$MAKEDIR" +_run cmake -DCMAKE_INSTALL_PREFIX=/usr "$ROOT" + +### Success +exit 0 diff --git a/autobuild/includes.sh b/autobuild/includes.sh new file mode 100644 index 0000000..8791d39 --- /dev/null +++ b/autobuild/includes.sh @@ -0,0 +1,14 @@ +#! /bin/bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +_run() { + echo $* + $* + if [ $? != 0 ] + then + echo "Error" + exit 1 + fi +} diff --git a/autobuild/package.sh b/autobuild/package.sh new file mode 100755 index 0000000..8b86626 --- /dev/null +++ b/autobuild/package.sh @@ -0,0 +1,20 @@ +#! /bin/bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +source autobuild/vars.sh +source autobuild/includes.sh + +cd "$MAKEDIR" + +### Build package +_run make package + +if [ -n "$DROPDIR" ]; then + ### Copy to destination + _run mkdir -p "$DROPDIR/" + _run cp hakabana*.tar.gz "$DROPDIR/" +fi + +exit 0 diff --git a/autobuild/vars.sh b/autobuild/vars.sh new file mode 100644 index 0000000..515b276 --- /dev/null +++ b/autobuild/vars.sh @@ -0,0 +1,9 @@ +#! /bin/bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +export PATH=/bin:/usr/bin:/usr/local/bin +export ROOT=$(pwd) +export MAKEDIR="$ROOT/workspace/" +