-
Notifications
You must be signed in to change notification settings - Fork 37
/
dependencies.sh
executable file
·71 lines (61 loc) · 1.38 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
dependNix="libboost-chrono-dev \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-thread-dev \
libssl-dev \
zlib1g-dev"
dependWin="mingw-w64-x86_64-boost \
mingw-w64-x86_64-openssl \
mingw-w64-x86_64-zlib"
kernel=$(uname -a)
function anotherDistr() {
echo "Just install libboost and libopenssl dev packages on your pc"
return 0
}
function installDnf() {
sudo dnf install boost-devel g++
}
function installDeb() {
sudo apt-get install $dependNix
return 0
}
function installOnGentoo() {
sudo emerge --deep --newuse dev-libs/boost dev-libs/openssl
return 0
}
function installOnWin() {
pacman -S $dependWin
return 0
}
function doInstallDepencies() {
case "$1" in
*Ubuntu* | *Debian*)
installDeb
;;
*gentoo*)
installOnGentoo
;;
*MINGW64*)
installOnWin
;;
*dnf*)
installDnf
;;
*)
anotherDistr
;;
esac
}
isLsbReleaseExists=$(which lsb_release > /dev/null 2>&1; echo $?)
if [ $isLsbReleaseExists -eq 0 ]; then
distr=$(lsb_release -i)
doInstallDepencies "$distr"
elif test -e /etc/fedora-release || which dnf > /dev/null; then
printf "Like you use fedora/redhat distr\n"
doInstallDepencies "dnf"
else
doInstallDepencies "$kernel"
fi