From 373f5ef236f4118e3056f2b5fe1c7669a2aff3dd Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 9 Sep 2024 00:55:49 +0200 Subject: [PATCH] f/pkg --- spcd/bootstrap.sh | 164 +++++++++++++++++++++++----------------------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 3bda802..6477eaf 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -765,6 +765,87 @@ nameserver ${value} 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 │ # ╰───┴──────────────────────────────╯ @@ -1479,87 +1560,6 @@ spcd_step__python_modules() { 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 │ # ╰──────╯ @@ -1616,7 +1616,7 @@ spcd_main() { spcd_step_in "Python" spcd_f_py_install spcd_step__python_modules - spcd_step__install_packages + spcd_f_pkg spcd_f_py_save spcd_f_py_switch }