/
install.Ubuntu.sh
95 lines (90 loc) · 2.5 KB
/
install.Ubuntu.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env bash
# DeepDive installers for Debian/Ubuntu Linux
LSB=$(lsb_release -ir | cut -f2) || true
case ${LSB} in
Debian*8*|Debian*7*) true ;;
Ubuntu*12.04|Ubuntu*14.04|Ubuntu*15.04) true ;;
*) error "$LSB found: This installer may not work on your OS." ||
error "It has been tested only on Debian 7 and 8, Ubuntu 12.04, 14.04, and 15.04." ||
true # don't fail here as it might work for other versions
esac
install__deepdive_build_deps() {
set -x
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test # for gcc >= 4.8 on Precise (12.04)
sudo add-apt-repository -y ppa:openjdk-r/ppa # for openjdk 8
sudo apt-get update
build_deps=(
build-essential
bash
coreutils
git
make
rsync
bzip2
libbz2-dev
xz-utils
flex
openjdk-8-jdk
sed
mawk
grep
bc
perl
python-software-properties
# mindbender
ed
# sampler
gcc-4.8
g++-4.8
cmake
unzip
libnuma-dev
)
sudo apt-get install -qy "${build_deps[@]}"
}
install__deepdive_runtime_deps() {
set -x
# install all runtime dependencies for DeepDive
sudo add-apt-repository -y ppa:openjdk-r/ppa # for openjdk 8
sudo apt-get update
runtime_deps=(
bash
coreutils
make
rsync
bc
sed
grep
mawk
perl
python-software-properties
openjdk-8-jre-headless
gnuplot
libltdl7 # for graphviz
)
sudo apt-get install -qy "${runtime_deps[@]}"
sudo locale-gen en_US.UTF-8
}
install_postgres_xl() {
source_os_script pgxl
}
install_postgres() {
set -x
sudo apt-get update
sudo apt-get install -qy postgresql
local pgversion=$(ls -1 /var/lib/postgresql/ | head -n 1)
if [ -z "${TRAVIS:-}" ]; then
# add user to postgresql and trust all connections to localhost
sudo -u postgres dropuser --if-exists $USER || sudo -u postgres dropuser $USER || true
sudo -u postgres createuser --superuser $USER || true
tmp=$(mktemp /tmp/pg_hba.conf.XXXXXXX)
trap "rm -f $tmp" EXIT
{
echo 'host all all 127.0.0.1/32 trust'
echo 'host all all ::1/128 trust'
sudo cat /etc/postgresql/$pgversion/main/pg_hba.conf
} >$tmp
sudo tee /etc/postgresql/$pgversion/main/pg_hba.conf <$tmp >/dev/null
sudo service postgresql restart
fi
}