Skip to content

Commit

Permalink
datamash
Browse files Browse the repository at this point in the history
Signed-off-by: lizz <[email protected]>
  • Loading branch information
innerlee committed May 7, 2020
1 parent dd8e9c1 commit a41b1de
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions zzdatamash.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit a41b1de

Please sign in to comment.