mirror of
https://github.com/YunoHost-Apps/gogs_ynh.git
synced 2024-09-03 20:36:23 +02:00
[fix] arm: use zip builds, add armv7l arch. Thanks @M5oul
This commit is contained in:
parent
e9decb8913
commit
b4eda1192c
1 changed files with 7 additions and 5 deletions
|
@ -13,14 +13,14 @@ x86_64) ARCHITECTURE="amd64"
|
||||||
;;
|
;;
|
||||||
i386|i686) ARCHITECTURE="386"
|
i386|i686) ARCHITECTURE="386"
|
||||||
;;
|
;;
|
||||||
armhf|armel) ARCHITECTURE="arm"
|
armhf|armel|armv7l) ARCHITECTURE="arm"
|
||||||
;;
|
;;
|
||||||
*) echo "Unable to detect your achitecture" && exit 1
|
*) echo "Unable to detect your achitecture" && exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Remote URL to fetch Gogs tarball
|
# Remote URL to fetch Gogs tarball
|
||||||
GOGS_BINARY_URL="https://github.com/gogits/gogs/releases/download/v${VERSION}/linux_${ARCHITECTURE}.tar.gz"
|
GOGS_BINARY_URL="https://github.com/gogits/gogs/releases/download/v${VERSION}/linux_${ARCHITECTURE}.zip"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Common helpers
|
# Common helpers
|
||||||
|
@ -30,13 +30,15 @@ GOGS_BINARY_URL="https://github.com/gogits/gogs/releases/download/v${VERSION}/li
|
||||||
# usage: extract_gogs DESTDIR
|
# usage: extract_gogs DESTDIR
|
||||||
extract_gogs() {
|
extract_gogs() {
|
||||||
local DESTDIR=$1
|
local DESTDIR=$1
|
||||||
|
local TMPDIR=$(mktemp -d)
|
||||||
|
|
||||||
# retrieve and extract Gogs tarball
|
# retrieve and extract Gogs tarball
|
||||||
gogs_tarball="/tmp/gogs.tar.gz"
|
gogs_tarball="/tmp/gogs.zip"
|
||||||
rm -f "$gogs_tarball"
|
rm -f "$gogs_tarball"
|
||||||
wget -q -O "$gogs_tarball" "$GOGS_BINARY_URL" \
|
wget -q -O "$gogs_tarball" "$GOGS_BINARY_URL" \
|
||||||
|| ynh_die "Unable to download Gogs tarball"
|
|| ynh_die "Unable to download Gogs tarball"
|
||||||
sudo tar xf "$gogs_tarball" -C "$DESTDIR" --strip-components 1 \
|
unzip -q "$gogs_tarball" -d "$TMPDIR" \
|
||||||
|| ynh_die "Unable to extract Gogs tarball"
|
|| ynh_die "Unable to extract Gogs tarball"
|
||||||
rm -f "$gogs_tarball"
|
sudo mv "$TMPDIR"/gogs/* "$DESTDIR"
|
||||||
|
rm -rf "$gogs_tarball" "$TMPDIR"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue