update os.sh.

This commit is contained in:
Christopher Jeffrey 2014-12-01 23:58:44 -08:00
parent e36549cd64
commit 5665e2e404
1 changed files with 28 additions and 7 deletions

View File

@ -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