summaryrefslogtreecommitdiffstats
path: root/DownloadMacOsXContribBinaries.sh
blob: b8df2227008289371157f1da8426113c5ce1ec52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /bin/sh

# Incremented every time a new contrib package is available
VERSION=`cat MacOsXContribBinariesVersion.txt`

if [ -f contrib/DarwinContribVersion.txt ]; then
  if [ "`cat contrib/DarwinContribVersion.txt`" = $VERSION ]; then
    echo "Contribs are up to date."
    exit 0
  fi
fi

HOST=download.mediafork.dynalias.com
FILE=contribbin-darwin-$VERSION.tar.gz
URL=http://$HOST/contrib/$FILE

# Check for internet connectivity
if ! host $HOST > /dev/null 2>&1; then
  echo "Please connect to the Internet (could not resolve $HOST)."
  exit 1
fi

# Look for something that can handle an HTTP download
  WGET="curl -L -O"

# Get and install the package
echo "Getting contribs ($VERSION)..."
( cd contrib && rm -f $FILE && $WGET $URL && rm -Rf lib include && \
  tar xzf $FILE && ranlib lib/*.a ) || exit 1

exit 0