From c2e800ad317facbde988fb7d4cb374b98b869286 Mon Sep 17 00:00:00 2001 From: frju365 Date: Sat, 28 Jan 2017 22:13:58 +0100 Subject: [PATCH] Create _common --- scripts/_common | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 scripts/_common diff --git a/scripts/_common b/scripts/_common new file mode 100644 index 0000000..35ffd82 --- /dev/null +++ b/scripts/_common @@ -0,0 +1,14 @@ +GARRADIN_VERSION="0.7.6" +GARRADIN_SOURCE_URL="http://dev.kd2.org/garradin/files/garradin-${GARRADIN_VERSION}.tar.bz2" + +extract_source() { + local DESTDIR=$1 + + # retrieve and extract Garradin tarball + rc_tarball="${DESTDIR}/garradin.tar.gz" + sudo wget -q -O "$rc_tarball" "$GARRADIN_SOURCE_URL" \ + || ynh_die "Unable to download source tarball" + sudo tar -xf "$rc_tarball" -C "$DESTDIR" --strip-components 1 \ + || ynh_die "Unable to extract source tarball" + sudo rm "$rc_tarball" +}