From a36592073c3620a03067769402e830ff0bf9e210 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Tue, 8 Apr 2025 23:54:22 -0400 Subject: [PATCH] [ADD] script installation arch linux --- script/install/install_arch_linux.sh | 62 ++++++++++++++++++++++++++++ script/install/install_dev.sh | 13 +++--- 2 files changed, 69 insertions(+), 6 deletions(-) create mode 100755 script/install/install_arch_linux.sh diff --git a/script/install/install_arch_linux.sh b/script/install/install_arch_linux.sh new file mode 100755 index 0000000..a239fd3 --- /dev/null +++ b/script/install/install_arch_linux.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +install_package() { + local package_name=$1 + + # Check package is already installed + if pacman -Qs "$package_name" > /dev/null; then + echo "$package_name is already installed." + else + echo "Installation of package $package_name..." + yes|yay -S "$package_name" + fi +} + +# Odoo installation +install_package postgis +install_package postgresql +install_package mariadb +install_package libev +install_package wkhtmltopdf + +echo "Need password to create symbolic link, create postgres user and install npm :" +sudo ln -fs /usr/lib/libldap.so /usr/lib/libldap_r.so + +sudo su - postgres -c "createuser -s ${EL_USER}" 2>/dev/null || true + +echo -e "\n---- Update NPM ----" +install_package npm + +sudo npm install npm@latest -g +retVal=$? +if [[ $retVal -ne 0 ]]; then + echo "npm install npm lastest installation error." + exit 1 +fi +sudo npm install -g rtlcss +retVal=$? +if [[ $retVal -ne 0 ]]; then + echo "npm install rtlcss installation error." + exit 1 +fi +sudo npm install -g less +retVal=$? +if [[ $retVal -ne 0 ]]; then + echo "npm install less installation error." + exit 1 +fi + +echo -e "\n---- Test tool ----" +npm install +retVal=$? +if [[ $retVal -ne 0 ]]; then + echo "npm install prettier + plugin-xml installation error." + exit 1 +fi + +# TODO install nginx + +# ERPLibre installation +install_package cmake +install_package parallel +install_package tk diff --git a/script/install/install_dev.sh b/script/install/install_dev.sh index 0bdd3a7..d5283bf 100755 --- a/script/install/install_dev.sh +++ b/script/install/install_dev.sh @@ -1,17 +1,18 @@ #!/usr/bin/env bash if [[ "${OSTYPE}" == "linux-gnu" ]]; then - OS=$(lsb_release -si) - VERSION=$(cat /etc/issue) - if [[ "${OS}" == *"Ubuntu"* ]]; then - if [[ "${VERSION}" == Ubuntu\ 18.04* || "${VERSION}" == Ubuntu\ 20.04* || "${VERSION}" == Ubuntu\ 22.04* || "${VERSION}" == Ubuntu\ 22.10* || "${VERSION}" == Ubuntu\ 23.04* || "${VERSION}" == Ubuntu\ 23.10* || "${VERSION}" == Ubuntu\ 24.04* ]]; then + source /etc/os-release + if [[ "${ID}" == "ubuntu" ]]; then + if [[ "${VERSION_ID}" == "18.04" || "${VERSION_ID}" == "20.04" || "${VERSION_ID}" == "22.04" || "${VERSION_ID}" == "22.10" || "${VERSION_ID}" == "23.04" || "${VERSION_ID}" == "23.10" || "${VERSION_ID}" == "24.04" ]]; then echo "\n---- linux-gnu installation process started ----" ./script/install/install_debian_dependency.sh else - echo "Your version is not supported, only support 18.04, 20.04 and 22.04 - 24.04 : ${VERSION}" + echo "Your version is not supported, only support 18.04, 20.04 and 22.04 - 24.04 : ${VERSION_ID}" fi - elif [[ "${OS}" == *"Debian"* ]]; then + elif [[ "${ID}" == "debian" ]]; then ./script/install/install_debian_dependency.sh + elif [[ "${ID}" == "arch" ]]; then + ./script/install/install_arch_linux.sh else ./script/install/install_debian_dependency.sh echo "Your Linux system is not supported, only support Ubuntu 18.04 or Ubuntu 20.04 or Ubuntu 22.04 - Ubuntu 23.10 - Ubuntu 24.04 ."