mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Add an install script to help in installing obitools 4 on Linux or MacOS computers
This commit is contained in:
50
install_obitools.sh
Executable file
50
install_obitools.sh
Executable file
@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
URL="https://go.dev/dl/"
|
||||||
|
OBIURL4="https://git.metabarcoding.org/lecasofts/go/obitools/-/archive/master/obitools-master.tar.gz"
|
||||||
|
|
||||||
|
# the directory of the script
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
# the temp directory used, within $DIR
|
||||||
|
# omit the -p parameter to create a temporal directory in the default location
|
||||||
|
WORK_DIR=$(mktemp -d -t "$DIR" "obitools4.XXXXXX")
|
||||||
|
|
||||||
|
# check if tmp dir was created
|
||||||
|
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
|
||||||
|
echo "Could not create temp dir"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd $WORK_DIR
|
||||||
|
|
||||||
|
OS=$(uname -a | awk '{print $1}')
|
||||||
|
ARCH=$(uname -m)
|
||||||
|
|
||||||
|
if [[ "$ARCH" == "x86_64" ]] ; then
|
||||||
|
ARCH="amd64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
GOFILE=$(curl "$URL" \
|
||||||
|
| grep 'class="download"' \
|
||||||
|
| grep "\.tar\.gz" \
|
||||||
|
| sed -E 's@^.*/dl/(go[1-9].+\.tar\.gz)".*$@\1@' \
|
||||||
|
| grep -i "$OS" \
|
||||||
|
| grep -i "$ARCH" \
|
||||||
|
| head -1)
|
||||||
|
|
||||||
|
GOURL=$(curl "${URL}${GOFILE}" \
|
||||||
|
| sed -E 's@^.*href="(.*\.tar\.gz)".*$@\1@')
|
||||||
|
|
||||||
|
curl "$GOURL" \
|
||||||
|
| tar zxf -
|
||||||
|
|
||||||
|
export PATH="$WORK_DIR/go/bin:$PATH"
|
||||||
|
|
||||||
|
curl "$OBIURL4" \
|
||||||
|
| tar zxf -
|
||||||
|
|
||||||
|
cd obitools-master
|
||||||
|
make
|
||||||
|
|
||||||
|
popd
|
Reference in New Issue
Block a user