-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall_dependencies.sh
More file actions
executable file
·82 lines (71 loc) · 2.78 KB
/
Copy pathinstall_dependencies.sh
File metadata and controls
executable file
·82 lines (71 loc) · 2.78 KB
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
#!/bin/sh
# install_dependencies.sh
# Detects the Linux distribution and installs the required dependencies
# for building the Secure Chrome Launcher.
set -e
echo "[INFO] Detecting package manager..."
if [ -f /etc/os-release ]; then
. /etc/os-release
OS=$NAME
DISTRO_ID=$ID
fi
install_debian() {
echo "[INFO] Detected Debian/Ubuntu based system."
echo "[INFO] Running: sudo apt-get update && sudo apt-get install -y libseccomp-dev libyaml-dev build-essential cmake pkg-config"
sudo apt-get update
sudo apt-get install -y libseccomp-dev libyaml-dev build-essential cmake pkg-config
}
install_redhat() {
echo "[INFO] Detected RHEL/CentOS/Fedora based system."
if command -v dnf >/dev/null 2>&1; then
echo "[INFO] Running: sudo dnf install -y libseccomp-devel libyaml-devel gcc make cmake pkgconfig"
sudo dnf install -y libseccomp-devel libyaml-devel gcc make cmake pkgconfig
else
echo "[INFO] Running: sudo yum install -y libseccomp-devel libyaml-devel gcc make cmake pkgconfig"
sudo yum install -y libseccomp-devel libyaml-devel gcc make cmake pkgconfig
fi
}
install_arch() {
echo "[INFO] Detected Arch Linux based system."
echo "[INFO] Running: sudo pacman -S --noconfirm libseccomp libyaml base-devel cmake"
sudo pacman -S --noconfirm libseccomp libyaml base-devel cmake
}
install_alpine() {
echo "[INFO] Detected Alpine Linux."
echo "[INFO] Running: sudo apk add libseccomp-dev libyaml-dev build-base cmake extra-cmake-modules"
sudo apk add libseccomp-dev libyaml-dev build-base cmake extra-cmake-modules
}
install_suse() {
echo "[INFO] Detected OpenSUSE/SLES."
echo "[INFO] Running: sudo zypper install -y libseccomp-devel libyaml-devel gcc make cmake pkg-config"
sudo zypper install -y libseccomp-devel libyaml-devel gcc make cmake pkg-config
}
# Auto-detect logic
if [ -f /etc/debian_version ]; then
install_debian
elif [ -f /etc/redhat-release ]; then
install_redhat
elif [ -f /etc/arch-release ]; then
install_arch
elif [ -f /etc/alpine-release ]; then
install_alpine
elif [ -f /etc/SuSE-release ] || [ "$DISTRO_ID" = "opensuse" ] || [ "$DISTRO_ID" = "sles" ]; then
install_suse
else
# Fallback to command check
if command -v apt-get >/dev/null 2>&1; then
install_debian
elif command -v dnf >/dev/null 2>&1 || command -v yum >/dev/null 2>&1; then
install_redhat
elif command -v pacman >/dev/null 2>&1; then
install_arch
elif command -v apk >/dev/null 2>&1; then
install_alpine
elif command -v zypper >/dev/null 2>&1; then
install_suse
else
echo "[ERROR] Unsupported package manager. Please install 'libseccomp' development headers manually."
exit 1
fi
fi
echo "[INFO] Dependencies installed successfully."