-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-mesos.sh
executable file
·62 lines (51 loc) · 1.61 KB
/
build-mesos.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
#!/bin/bash
#
# Builds the Apache Mesos distribution
# Created: M. Massenzio, 2015-04-02
source `dirname $0`/common.sh
# Ensure apt-get is up to date.
sudo apt-get update && sudo apt-get -y upgrade
# Install build tools.
msg "Installing necessary dependencies, go grab a book: this WILL take time"
sudo apt-get -y install build-essential python-dev python-boto \
libcurl4-nss-dev libsasl2-dev \
maven libapr1-dev libsvn-dev
# Install OpenJDK java, only if needed
JAVAC=$(which javac)
if [[ -z $JAVAC ]]; then
msg "Installing Open JDK 8"
#sudo apt-get install -y openjdk-7-jdk
./install-jdk.sh
fi
# Check that we are in the right directory
if [[ ! -e bootstrap ]]; then
error "This does not appear to be Mesos's top-level directory"
error "This is the current directory: `pwd`"
exit 1
fi
# Only needed for building from git cloned repo
if [[ -d .git ]]; then
# Install autotoconf, automake and libtool
sudo apt-get install -y autoconf libtool
msg "Running the bootstrap script"
wrap ./bootstrap
fi
# Configure and build.
msg "Building Mesos, this will take a long time..."
# TODO: should we run make clean first?
mkdir build
cd build
wrap ../configure
wrap make
# Run test suite.
msg "Testing build"
wrap make check
# Install (***Optional***).
msg "All tests passed; now installing to your system..."
wrap sudo make install
mesos_lib=$(echo $LD_LIBRARY_PATH | grep /usr/local/lib)
if [[ -z $mesos_lib ]]; then
msg "Adding /usr/local/lib to LD_LIBRARY_PATH to .bashrc"
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/lib" >> ~/.bashrc
fi
msg "Mesos install successful" "SUCCESS"