2018-02-08 00:49:11 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# download, build and install the zstd library
|
|
|
|
|
2018-11-26 16:18:49 +00:00
|
|
|
version=1.4.5
|
2018-02-24 00:57:42 +00:00
|
|
|
dir=tmp-cached-zstd
|
|
|
|
stamp="$dir/.last-build-zstd"
|
|
|
|
here=`pwd`
|
2018-02-08 00:49:11 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2018-02-24 00:57:42 +00:00
|
|
|
if [ -d "$dir" -a -f "$stamp" ]; then
|
|
|
|
echo "Using valid cache for $dir, built" `cat "$stamp"`
|
|
|
|
cd "$dir"
|
|
|
|
cd zstd-${version}
|
|
|
|
sudo make install PREFIX=/usr
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "No or stale cache for $dir, rebuilding"
|
|
|
|
rm -rf "$dir"
|
|
|
|
mkdir "$dir"
|
|
|
|
cd "$dir"
|
2018-02-08 00:49:11 +00:00
|
|
|
wget https://github.com/facebook/zstd/archive/v${version}.tar.gz
|
|
|
|
tar xf v${version}.tar.gz
|
|
|
|
cd zstd-${version}
|
|
|
|
make
|
|
|
|
sudo make install PREFIX=/usr
|
2018-02-24 00:57:42 +00:00
|
|
|
date > "$here/$stamp"
|