Newer
Older
#!/bin/sh
#https://stackoverflow.com/questions/2870992/automatic-exit-from-bash-shell-script-on-error
set -e
GLUON_BRANCH="$1"
GLUON_VERSION="$2"
#check installed debendenciece
if [ -f /etc/debian_version ]; then
echo "Checking for git..."
if ! command -v git > /dev/null 2>&1; then
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
echo "git is not installed"
exit 1
fi
echo "Detected git..."
echo "Checking for subversion..."
if ! command -v svn > /dev/null; then
echo "subversion is not installed"
exit 1
fi
echo "Detected subversion..."
echo "Checking for python..."
if ! which python > /dev/null; then
echo "python is not installed"
exit 1
fi
echo "Detected python..."
echo "Checking for build-essential..."
if ! dpkg -s build-essential > /dev/null; then
echo "build-essential is not installed"
exit 1
fi
echo "Detected build-essential..."
echo "Checking for gawk..."
if ! dpkg -s gawk > /dev/null; then
echo "gawk is not installed"
exit 1
fi
echo "Detected gawk..."
echo "Checking for unzip..."
if ! dpkg -s unzip > /dev/null; then
echo "unzip is not installed"
exit 1
fi
echo "Detected unzip..."
echo "Checking for libncurses5-dev..."
if ! dpkg -s libncurses5-dev > /dev/null; then
echo "libncurses5-dev is not installed"
exit 1
fi
echo "Detected libncurses5-dev..."
echo "Checking for zlib1g-dev..."
if ! dpkg -s zlib1g-dev > /dev/null; then
echo "zlib1g-dev is not installed"
exit 1
fi
echo "Detected zlib1g-dev..."
echo "Checking for libssl-dev..."
if ! dpkg -s libssl-dev > /dev/null; then
echo "libssl-dev is not installed"
exit 1
fi
echo "Detected libssl-dev..."
ls -A | grep -v -E '(^|\s)site($|\s)' | xargs -I{} mv {} site/
git init .
git remote add origin https://github.com/freifunk-gluon/gluon.git
# fetch packages repos and apply patches
while read line; do
if [[ $line == *GluonTarget* ]]; then
# extract arcitecture parameter value
targ=$(echo $line | sed -e 's/^.*GluonTarget//' -e 's/^,//' -e 's/)).*//' -e 's/[,]/-/')
make -j $((CPUS*2)) GLUON_TARGET="$targ" BROKEN=1 GLUON_BRANCH="$GLUON_BRANCH" || exit 1
# create manifest file for autoupdater
make manifest GLUON_BRANCH="$GLUON_BRANCH"