get-deps.sh: teach it about amazon linux

This commit is contained in:
Wez Furlong
2023-12-08 09:45:18 -07:00
parent 54f3c0d7fa
commit d7e1c6afad
+41
View File
@@ -68,6 +68,44 @@ fedora_deps() {
'telnet'
}
amazon_deps() {
if have_command 'dnf'; then
YUM="$SUDO dnf"
elif have_command 'yum'; then
YUM="$SUDO yum"
else
echo "No idea what package manager to use, sorry! (perhaps 'dnf' or 'yum' is not in \$PATH?)"
return 1
fi
# perl stuff moved around in different versions of the distro.
# Make a soft attempt under this name.
$YUM install -y 'perl-FindBin' 'perl-File-Compare' || true
if ! have_command 'curl' ; then
# Some systems have curl-minimal which won't tolerate us
# trying to install curl, so only try to install if we
# don't have it already
$YUM install -y 'curl'
fi
$YUM install -y \
'binutils' \
'ca-certificates' \
'clang-devel' \
'cmake' \
'gcc' \
'gcc-c++' \
'glibc-devel' \
'git' \
'kernel-devel' \
'kernel-headers' \
'make' \
'openssl-devel' \
'pkg-config' \
'python3' \
'python3-pip' \
'rpm-build' \
'rpm-sign'
}
mariner_deps() {
if have_command 'dnf'; then
YUM="$SUDO dnf"
@@ -279,6 +317,9 @@ case $ID in
mariner)
mariner_deps
;;
amzn)
amazon_deps
;;
*)
echo "Couldn't find OS by ID, found ID: $ID"
echo "Fallback to detecting '/etc/<name>-release'"