aboutsummaryrefslogtreecommitdiff
path: root/scripts/common.sh
diff options
context:
space:
mode:
authorSean Long <me@sean-long.com>2014-02-21 21:32:35 -0800
committerThiago de Arruda <tpadilha84@gmail.com>2014-02-22 16:25:20 -0300
commit87fdb40a03063b09811d4e3f303432f62b12e25d (patch)
tree4a76ccb94b41e2ca8f2dbf761fad9847c625850d /scripts/common.sh
parenteaf942c5a6ce6aca0bc217063f112a177e82f417 (diff)
downloadrneovim-87fdb40a03063b09811d4e3f303432f62b12e25d.tar.gz
rneovim-87fdb40a03063b09811d4e3f303432f62b12e25d.tar.bz2
rneovim-87fdb40a03063b09811d4e3f303432f62b12e25d.zip
First pass on getting build working on FreeBSD.
Diffstat (limited to 'scripts/common.sh')
-rw-r--r--scripts/common.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/common.sh b/scripts/common.sh
index d7653c6aa1..8c5d8a61ab 100644
--- a/scripts/common.sh
+++ b/scripts/common.sh
@@ -1,3 +1,16 @@
+platform='unknown'
+unameval=`uname`
+if [ "$unameval" == 'Linux' ]; then
+ platform='linux'
+elif [ "$unameval" == 'FreeBSD' ]; then
+ platform='freebsd'
+fi
+
+sha1sumcmd='sha1sum'
+if [ "$platform" == 'freebsd' ]; then
+ sha1sumcmd='shasum'
+fi
+
pkgroot="$(pwd)"
deps="$pkgroot/.deps"
prefix="$deps/usr"
@@ -17,7 +30,7 @@ download() {
# download, untar and calculate sha1 sum in one pass
(wget "$url" -O - | tee "$fifo" | \
(cd "$tgt"; tar --strip-components=1 -xvzf -)) &
- sum=$(sha1sum < "$fifo" | cut -d ' ' -f1)
+ sum=$("$sha1sumcmd" < "$fifo" | cut -d ' ' -f1)
rm -rf "$tmp_dir"
if [ "$sum" != "$sha1" ]; then
echo "SHA1 sum doesn't match, expected '$sha1' got '$sum'"