From a41b1dea176907a1d44ce73fb95d72c4b99dc57b Mon Sep 17 00:00:00 2001 From: lizz Date: Thu, 7 May 2020 10:06:18 +0800 Subject: [PATCH] datamash Signed-off-by: lizz --- zzdatamash.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 zzdatamash.sh diff --git a/zzdatamash.sh b/zzdatamash.sh new file mode 100755 index 0000000..5378e30 --- /dev/null +++ b/zzdatamash.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# install datamash +set -e + +ROOTDIR=${ZZROOT:-$HOME/app} +NAME="datamash" +TYPE=".tar.gz" +FILE="$NAME$TYPE" +DOWNLOADURL="https://ftp.gnu.org/gnu/datamash/datamash-1.7.tar.gz" +echo $NAME will be installed in "$ROOTDIR" + +mkdir -p "$ROOTDIR/downloads" +cd "$ROOTDIR" + +if [ -f "downloads/$FILE" ]; then + echo "downloads/$FILE exist" +else + echo "$FILE does not exist, downloading from $DOWNLOADURL" + wget $DOWNLOADURL -O $FILE + mv $FILE downloads/ +fi + +mkdir -p src/$NAME +tar xf downloads/$FILE -C src/$NAME --strip-components 1 + +cd src/$NAME + +./configure --prefix="$ROOTDIR" +make -j"$(nproc)" && make install + +echo $NAME installed on "$ROOTDIR"