From 5665e2e4046cf7476f6f569105f6492bb81d9ff9 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 1 Dec 2014 23:58:44 -0800 Subject: [PATCH] update os.sh. --- platform/os.sh | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/platform/os.sh b/platform/os.sh index bf9d3bb2..e766ea2d 100755 --- a/platform/os.sh +++ b/platform/os.sh @@ -8,23 +8,44 @@ fi name=$(uname -a) os= -if echo "$name" | grep -q -i 'debian'; then +if echo "$name" | grep -q -i 'cent'; then + os=centos +elif echo "$name" | grep -q -i 'debian'; then os=debian -elif echo "$name" | grep -q 'Ubuntu'; then - os=ubuntu +elif echo "$name" | grep -q -i 'fedora'; then + os=fedora +elif echo "$name" | grep -q -i 'mint'; then + os=mint elif echo "$name" | grep -q '^Darwin'; then os=osx -elif echo "$name" | grep -q 'ARCH' \ -&& test "$(uname -o 2> /dev/null)" = 'GNU/Linux'; then +elif echo "$name" | grep -q -i 'redhat'; then + os=rhel +elif echo "$name" | grep -q -i 'suse'; then + os=suse +elif echo "$name" | grep -q 'Ubuntu'; then + os=ubuntu +elif test "$(uname -o 2> /dev/null)" = 'GNU/Linux'; then os=arch fi +# Maybe someday... +# if test -d /system && test -d /data/data; then +# os=android +# fi + if test -z "$os"; then - echo 'OS not supported.' >& 2 - exit 1 + # Arch is hard to detect. Check some unique properties of Arch: + if test -d /lib/systemd && test "$(readlink /usr/bin/vi)" = 'ex'; then + os=arch + else + echo 'OS not supported.' >& 2 + exit 1 + fi fi if test ! -e platform/${os}/libbitcoind.so; then + # Should be doing something like this: + # curl -s "https://bitpay.com/lib/libbitcoind-${os}.so" > platform/${os}/libbitcoind.so cat platform/${os}/{xaa,xab} > platform/${os}/libbitcoind.so chmod 0755 platform/${os}/libbitcoind.so fi