This commit is contained in:
Marc Beninca 2024-09-09 00:55:49 +02:00
parent 59105a0c54
commit 373f5ef236
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -765,6 +765,87 @@ nameserver ${value}
fi fi
} }
spcd_f_pkg() {
spcd_step_in "OS packages"
local file
# epel
spcd_step "EPEL"
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}")
spcd_f_pm_pkg_install "epel-release"
case "${SPCD_OS_VERSION}" in
"9")
set -- \
"-testing" \
""
;;
"8")
set -- \
"-modular" \
"-testing-modular" \
"-testing" \
""
;;
*) ;;
esac
for file in "${@}"; do
spcd_os_sed "/etc/yum.repos.d/epel${file}.repo" \
"|^metalink|#metalink|" \
"|https://download.example/pub/epel|${SPCD_URL_EPEL}|" \
"|^#baseurl|baseurl|"
done
file="/etc/yum.repos.d/epel-cisco-openh264.repo"
if [ -f "${file}" ]; then
spcd_os_sed "${file}" \
"|^enabled=1|enabled=0|"
fi
;;
*) ;;
esac
# graphviz
spcd_step "GraphViz"
spcd_f_pm_pkg_install "graphviz"
# openssh
spcd_step "OpenSSH"
case "${SPCD_PM}" in
"${SPCD_PM_APK}" | "${SPCD_PM_APT}")
spcd_f_pm_pkg_install "openssh-client"
;;
"${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}")
spcd_f_pm_pkg_install "openssh-clients"
;;
"${SPCD_PM_PACMAN}") spcd_f_pm_pkg_install "openssh" ;;
*) ;;
esac
# plantuml
spcd_step "PlantUML"
spcd_f_pm_pkg_install "plantuml"
# rsync
spcd_step "Rsync"
spcd_f_pm_pkg_install "rsync"
# shell check
spcd_step "ShellCheck"
case "${SPCD_PM}" in
"${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}")
spcd_f_pm_pkg_install "ShellCheck"
;;
*) spcd_f_pm_pkg_install "shellcheck" ;;
esac
# shfmt
spcd_step "ShellFormat"
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}") ;;
"${SPCD_OS_DEBIAN}")
case "${SPCD_OS_VERSION}" in
"bullseye") ;;
*) spcd_f_pm_pkg_install "shfmt" ;;
esac
;;
*) spcd_f_pm_pkg_install "shfmt" ;;
esac
spcd_step_out
}
# ╭───┬──────────────────────────────╮ # ╭───┬──────────────────────────────╮
# │ f │ ca = certificate authorities │ # │ f │ ca = certificate authorities │
# ╰───┴──────────────────────────────╯ # ╰───┴──────────────────────────────╯
@ -1479,87 +1560,6 @@ spcd_step__python_modules() {
spcd_step_out spcd_step_out
} }
spcd_step__install_packages() {
spcd_step_in "OS packages"
local file
# epel
spcd_step "EPEL"
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}")
spcd_f_pm_pkg_install "epel-release"
case "${SPCD_OS_VERSION}" in
"9")
set -- \
"-testing" \
""
;;
"8")
set -- \
"-modular" \
"-testing-modular" \
"-testing" \
""
;;
*) ;;
esac
for file in "${@}"; do
spcd_os_sed "/etc/yum.repos.d/epel${file}.repo" \
"|^metalink|#metalink|" \
"|https://download.example/pub/epel|${SPCD_URL_EPEL}|" \
"|^#baseurl|baseurl|"
done
file="/etc/yum.repos.d/epel-cisco-openh264.repo"
if [ -f "${file}" ]; then
spcd_os_sed "${file}" \
"|^enabled=1|enabled=0|"
fi
;;
*) ;;
esac
# graphviz
spcd_step "GraphViz"
spcd_f_pm_pkg_install "graphviz"
# openssh
spcd_step "OpenSSH"
case "${SPCD_PM}" in
"${SPCD_PM_APK}" | "${SPCD_PM_APT}")
spcd_f_pm_pkg_install "openssh-client"
;;
"${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}")
spcd_f_pm_pkg_install "openssh-clients"
;;
"${SPCD_PM_PACMAN}") spcd_f_pm_pkg_install "openssh" ;;
*) ;;
esac
# plantuml
spcd_step "PlantUML"
spcd_f_pm_pkg_install "plantuml"
# rsync
spcd_step "Rsync"
spcd_f_pm_pkg_install "rsync"
# shell check
spcd_step "ShellCheck"
case "${SPCD_PM}" in
"${SPCD_PM_DNF}" | "${SPCD_PM_ZYPPER}")
spcd_f_pm_pkg_install "ShellCheck"
;;
*) spcd_f_pm_pkg_install "shellcheck" ;;
esac
# shfmt
spcd_step "ShellFormat"
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_ROCKY}") ;;
"${SPCD_OS_DEBIAN}")
case "${SPCD_OS_VERSION}" in
"bullseye") ;;
*) spcd_f_pm_pkg_install "shfmt" ;;
esac
;;
*) spcd_f_pm_pkg_install "shfmt" ;;
esac
spcd_step_out
}
# ╭──────╮ # ╭──────╮
# │ main │ # │ main │
# ╰──────╯ # ╰──────╯
@ -1616,7 +1616,7 @@ spcd_main() {
spcd_step_in "Python" spcd_step_in "Python"
spcd_f_py_install spcd_f_py_install
spcd_step__python_modules spcd_step__python_modules
spcd_step__install_packages spcd_f_pkg
spcd_f_py_save spcd_f_py_save
spcd_f_py_switch spcd_f_py_switch
} }