-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathget_requirements.sh
executable file
·64 lines (56 loc) · 1.78 KB
/
get_requirements.sh
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# Description: Script to fetch requirements for building this project.
# Last-modified: 2013-02-20 14:31:57
#
# Note that this script is not perfect and does not handle all errors.
# Any improvements are welcome.
# Either Git or Subversion is needed to retrieve Theos.
GIT=$(type -P git)
SVN=$(type -P svn)
if [ -z "$GIT" -a -z "$SVN" ]; then
echo "ERROR: This script requires either 'git' or 'svn' to be installed."
exit 1
fi
# Either wget or curl is needed to download package list and ldid.
WGET=$(type -P wget)
CURL=$(type -P curl)
if [ -z "$WGET" -a -z "$CURL" ]; then
echo "ERROR: This script requires either 'wget' or 'curl' to be installed."
exit 1
fi
# Download Theos
echo "Checking for Theos..."
if [ -z "$THEOS" ]; then
echo "Downloading Theos..."
if [ ! -z "$GIT" ]; then
git clone --quiet git://github.com/DHowett/theos.git theos
else
svn co http://svn.howett.net/svn/theos/trunk theos
fi
else
ln -sn "$THEOS" theos
fi
# Download ldid
echo "Checking for ldid..."
if [ -z "$(type -P ldid)" ]; then
echo "Downloading ldid..."
if [ "$(uname)" == "Darwin" ]; then
if [ ! -z "$WGET" ]; then
wget -q http://dl.dropbox.com/u/3157793/ldid
else
curl -s http://dl.dropbox.com/u/3157793/ldid > ldid
fi
mv ldid theos/bin/ldid
chmod +x theos/bin/ldid
else
echo "... No pre-built version of ldid is available for your system."
echo "... You will need to provide your own copy of ldid."
fi
fi
# Check if .deb creation tools are available (optional)
echo "Checking for dpkg-deb..."
if [ -z "$(type -P dpkg-deb)" ]; then
echo "... dpkg-deb not found."
echo "... If you wish to create a .deb package, you will need the 'dpkg-deb' tool."
fi
echo "Done."