forked from sensu/sensu-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_dependencies.sh
executable file
·50 lines (44 loc) · 1.09 KB
/
install_dependencies.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
#!/bin/sh
system=unknown
if [ -f /etc/redhat-release ]; then
system=redhat
elif [ -f /etc/debian_version ]; then
system=debian
elif [ -f /etc/SuSE-release ]; then
system=suse
elif [ -f /etc/gentoo-release ]; then
system=gentoo
elif [ -f /etc/arch-release ]; then
system=arch
elif [ -f /etc/slackware-version ]; then
system=slackware
elif [ -f /etc/lfs-release ]; then
system=lfs
fi
install_epel() {
cat > /etc/yum.repos.d/epel.repo << EOF
[epel]
name=epel
baseurl=http://download.fedoraproject.org/pub/epel/\$releasever/\$basearch
enabled=1
gpgcheck=0
EOF
}
## install platform specific build dependencies
case "$system" in
redhat)
yum clean all
install_epel
yum -y install curl m4 make gcc gcc-c++ rpm-build
;;
debian)
apt-get update
apt-get -y install curl m4 g++ make gcc
;;
suse)
zypper --non-interactive install curl m4 make gcc gcc-c++
;;
*)
echo "WARNING: I don't recognize system [$system]. Going to try to" \
"build without installing any dependencies anyway."
esac