From 790959232726834c072dc38a92c10d35dbdf9cac Mon Sep 17 00:00:00 2001 From: UmaShankar Avagadda Date: Thu, 15 Feb 2024 15:42:33 +0530 Subject: [PATCH] ZCS-14464:Install p7zip-plugins from EPEL repo (#270) --- rpmconf/Install/Util/modules/packages.sh | 1 + rpmconf/Install/Util/utilfunc.sh | 78 ++++++++++++++++++++++++ 2 files changed, 79 insertions(+) diff --git a/rpmconf/Install/Util/modules/packages.sh b/rpmconf/Install/Util/modules/packages.sh index c7f05eb5d..0b93b1f3b 100755 --- a/rpmconf/Install/Util/modules/packages.sh +++ b/rpmconf/Install/Util/modules/packages.sh @@ -143,6 +143,7 @@ installPackages() { fi removeExistingInstall + installEPELRepo if [ "${#repo_pkg_names[@]}" -gt 0 ] then diff --git a/rpmconf/Install/Util/utilfunc.sh b/rpmconf/Install/Util/utilfunc.sh index d0c2c781b..55e3fa145 100755 --- a/rpmconf/Install/Util/utilfunc.sh +++ b/rpmconf/Install/Util/utilfunc.sh @@ -2497,6 +2497,7 @@ getInstallPackages() { if [ x"$ZMTYPE_INSTALLABLE" = "xNETWORK" ]; then selectChatVideo fi + isp7zipRequired checkRequiredSpace isInstalled zimbra-store @@ -2515,6 +2516,83 @@ getInstallPackages() { done } +isp7zipRequired() { + P7ZIPREQUIRED=no + if [[ $MTA_SELECTED == "yes" && $PLATFORM = "RHEL9_64" ]]; then + isInstalled p7zip-plugins + if [ x$PKGINSTALLED = "x" ]; then + askYN "Install p7zip-plugins from epel-release repository (without p7zip-plugins, some decoders for Amavis may not be available)." "Y" + if [ $response = "yes" ]; then + P7ZIPREQUIRED=yes + fi + fi + fi +} + +installEPELRepo() { + if [ $P7ZIPREQUIRED = "yes" ]; then + OS_NAME=`grep -E '^(NAME)=' /etc/os-release | cut -d = -f 2 | tr -d '"'` + case "$OS_NAME" in + "Red Hat"*) + isInstalled epel-release-latest-9 + if [ x$PKGINSTALLED = "x" ]; then + echo -n "Installing epel-release-latest-9..." + if ! yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y >>$LOGFILE 2>&1 ; then + echo "failed to install epel-release." + exit 1 + else + echo "done." + fi + fi + echo -n "Installing p7zip-plugins..." + if ! yum install p7zip-plugins --enablerepo=epel -y >>$LOGFILE 2>&1 ; then + echo "failed to install p7zip-plugins." + exit 1 + else + echo "done." + fi + ;; + "Oracle"*) + isInstalled oracle-epel-release-el9 + if [ x$PKGINSTALLED = "x" ]; then + echo -n "Installing oracle-epel-release-el9..." + if ! yum install oracle-epel-release-el9 -y >>$LOGFILE 2>&1 ; then + echo "failed to install epel-release." + exit 1 + else + echo "done." + fi + fi + echo -n "Installing p7zip-plugins..." + if ! yum install p7zip-plugins --enablerepo=ol9_developer_EPEL -y >>$LOGFILE 2>&1 ; then + echo "failed to install p7zip-plugins." + exit 1 + else + echo "done." + fi + ;; + "Rocky"*|"CentOS"*) + isInstalled epel-release + if [ x$PKGINSTALLED = "x" ]; then + echo -n "Installing epel-release..." + if ! yum install epel-release -y > /dev/null >>$LOGFILE 2>&1 ; then + echo "failed to install epel-release." + exit 1 + else + echo "done." + fi + fi + echo -n "Installing p7zip-plugins..." + if ! yum install p7zip-plugins --enablerepo=epel -y >>$LOGFILE 2>&1; then + echo "failed to install p7zip-plugins." + exit 1 + else + echo "done." + fi + ;; + esac + fi +} selectChatVideo() { # install chat-video extension and chat-video classic, modern zimlets if [ $STORE_SELECTED = "yes" ] ; then