2018-10-11 17:22:02 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Installs git-annex in termux on android.
|
|
|
|
#
|
|
|
|
# This is only a convenience script to avoid the user needing to type much
|
|
|
|
# in termux. The standalone tarball automatically adapts itself to the termux
|
|
|
|
# environment, so this script should stay as mininal as possible.
|
2018-10-22 17:22:10 +00:00
|
|
|
#
|
|
|
|
# This script needs to be sourced into the current termux shell, rather
|
|
|
|
# than run with a new shell, so it can set the PATH to include git-annex.
|
2018-10-11 17:22:02 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
case $(uname -m) in
|
|
|
|
aarch64)
|
2023-03-10 15:59:03 +00:00
|
|
|
arch=arm64-ancient
|
2018-10-11 17:22:02 +00:00
|
|
|
;;
|
|
|
|
arm)
|
|
|
|
arch=armel
|
|
|
|
;;
|
2019-03-22 13:39:18 +00:00
|
|
|
armv7l)
|
2019-01-22 15:50:29 +00:00
|
|
|
arch=armel
|
|
|
|
;;
|
2018-10-11 17:22:02 +00:00
|
|
|
x86_64)
|
2023-03-10 16:10:38 +00:00
|
|
|
arch=amd64
|
2018-10-11 17:22:02 +00:00
|
|
|
;;
|
|
|
|
x86_32)
|
2023-03-10 15:59:03 +00:00
|
|
|
arch=i386-ancient
|
2018-10-11 17:22:02 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "unknown architecture $(uname -m), cannot install" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
url=https://downloads.kitenet.net/git-annex/linux/current/git-annex-standalone-"$arch".tar.gz
|
|
|
|
# uncomment to use latest autobuild
|
|
|
|
#url=https://downloads.kitenet.net/git-annex/autobuild/"$arch"/git-annex-standalone-"$arch".tar.gz
|
|
|
|
|
|
|
|
echo "Installing dependencies with termux pkg manager..."
|
|
|
|
pkg install git wget tar coreutils proot
|
|
|
|
|
|
|
|
echo "Downloading git-annex..."
|
|
|
|
cd
|
|
|
|
wget -O- "$url" | tar zx
|
|
|
|
|
|
|
|
# This lets runshell finish the installation.
|
|
|
|
git-annex.linux/git-annex version
|
|
|
|
echo "git-annex is successfully installed."
|
|
|
|
|
|
|
|
echo "Now running termux-setup-storage, to let git-annex access system storage."
|
|
|
|
termux-setup-storage
|
|
|
|
|
2018-10-22 17:22:10 +00:00
|
|
|
# Add to PATH of shell that sourced this, so the user can immediately
|
|
|
|
# start using git-annex.
|
|
|
|
PATH="$PATH:`pwd`/git-annex.linux"
|
|
|
|
|
2018-10-11 17:22:02 +00:00
|
|
|
echo "Installation complete."
|