Commits

Zhang Huangbin committed a4a679f

Install packages on Gentoo.

Comments (0)

Files changed (4)

iRedMail/conf/core

 install_pkg_gentoo()
 {
     ECHO_INFO "Installing package(s): $@"
-    emerge --ask n $@
+    emerge $@
     if [ X"$?" != X"0" ]; then
         ECHO_ERROR "Installation failed, please check the terminal output."
         ECHO_ERROR "If you're not sure what the problem is, try to get help in iRedMail"
 remove_pkg_gentoo()
 {
     ECHO_INFO "Removing package(s): $@"
-    emerge -C --ask n $@
+    emerge -C $@
     [ X"$?" != X"0" ] && ECHO_ERROR "Package removed failed, please check the terminal output."
 }
 

iRedMail/conf/global

 
 export PROG_NAME='iRedMail'
 export PROG_NAME_LOWERCASE='iredmail'
-export PROG_VERSION='0.8.0-beta1'
+export PROG_VERSION='0.8.0-beta'
 
 # -----------------
 # ---- Generic ----
     export LOCAL_REPO_FILE="${YUM_REPOS_DIR}/${LOCAL_REPO_NAME}.repo"
 
     # Override default value.
-    export PKG_DIALOG="dialog${PKG_ARCH}"
-    export PKG_BZIP2="bzip2${PKG_ARCH}"
+    export PKG_DIALOG="dev-util/dialog"
+    export PKG_BZIP2="app-arch/bzip2"
 
 elif [ X"${DISTRO}" == X"FREEBSD" ]; then
     # System user: root.

iRedMail/dialog/config_via_dialog.sh

 " 20 76 "${VMAIL_USER_HOME_DIR}" 2>/tmp/vmail_user_home_dir
 
 VMAIL_USER_HOME_DIR="$(cat /tmp/vmail_user_home_dir)"
-export VMAIL_USER_HOME_DIR="${VMAIL_USER_HOME_DIR}" && echo "export VMAIL_USER_HOME_DIR='${VMAIL_USER_HOME_DIR}'" >> ${CONFIG_FILE}
-export STORAGE_BASE_DIR="${VMAIL_USER_HOME_DIR}" && echo "export STORAGE_BASE_DIR='${VMAIL_USER_HOME_DIR}'" >> ${CONFIG_FILE}
-export SIEVE_DIR="${VMAIL_USER_HOME_DIR}/sieve" && echo "export SIEVE_DIR='${SIEVE_DIR}'" >>${CONFIG_FILE}
+export VMAIL_USER_HOME_DIR="${VMAIL_USER_HOME_DIR}"
+export STORAGE_BASE_DIR="${VMAIL_USER_HOME_DIR}"
+export SIEVE_DIR="${VMAIL_USER_HOME_DIR}/sieve"
+echo "export VMAIL_USER_HOME_DIR='${VMAIL_USER_HOME_DIR}'" >> ${CONFIG_FILE}
+echo "export STORAGE_BASE_DIR='${VMAIL_USER_HOME_DIR}'" >> ${CONFIG_FILE}
+echo "export SIEVE_DIR='${SIEVE_DIR}'" >>${CONFIG_FILE}
 rm -f /tmp/vmail_user_home_dir
 
 # --------------------------------------------------
     'MySQL' "The world's most popular open source database" 'off' \
     'PostgreSQL' 'Powerful, open source database system' 'off' \
     2>/tmp/backend
+fi
 
 BACKEND_ORIG="$(cat /tmp/backend)"
 if [ X"${BACKEND_ORIG}" == X'OpenLDAP' ]; then

iRedMail/functions/packages.sh

             # Ubuntu >= 9.10.
             ENABLED_SERVICES="rsyslog ${ENABLED_SERVICES}"
         fi
+    elif [ X"${DISTRO}" == X"GENTOO" ]; then
+        ENABLED_SERVICES="syslog-ng ${ENABLED_SERVICES}"
     fi
 
     #################################################
             # MySQL server and client.
             ALL_PKGS="${ALL_PKGS} mysql-server mysql-client"
             ENABLED_SERVICES="${ENABLED_SERVICES} mysql"
+        elif [ X"${DISTRO}" == X"GENTOO" ]; then
+            ALL_PKGS="${ALL_PKGS} net-nds/openldap"
+            ENABLED_SERVICES="${ENABLED_SERVICES} slapd"
+
+            # MySQL server and client.
+            ALL_PKGS="${ALL_PKGS} dev-db/mysql"
+            ENABLED_SERVICES="${ENABLED_SERVICES} mysql"
         fi
     elif [ X"${BACKEND}" == X"MYSQL" ]; then
         # MySQL server & client.
 
             # For Awstats.
             [ X"${USE_AWSTATS}" == X"YES" ] && ALL_PKGS="${ALL_PKGS} libapache2-mod-auth-mysql"
+
+        elif [ X"${DISTRO}" == X'GENTOO' ]; then
+            ALL_PKGS="${ALL_PKGS} dev-db/mysql"
+            ENABLED_SERVICES="${ENABLED_SERVICES} mysql"
         fi
     elif [ X"${BACKEND}" == X"PGSQL" ]; then
         export USE_IREDAPD='NO'
 
             # Postfix module
             ALL_PKGS="${ALL_PKGS} postfix-pgsql"
+        elif [ X"${DISTRO}" == X'GENTOO' ]; then
+            ALL_PKGS="${ALL_PKGS} dev-db/postgresql-server"
+            ENABLED_SERVICES="${ENABLED_SERVICES} postgresql-${PGSQL_VERSION}"
+
         fi
     fi
 
         fi
 
         ENABLED_SERVICES="${ENABLED_SERVICES} apache2"
-    else
-        :
+    elif [ X"${DISTRO}" == X'GENTOO' ]; then
+        ALL_PKGS="${ALL_PKGS} www-servers/apache dev-lang/php"
+        ENABLED_SERVICES="${ENABLED_SERVICES} apache2"
     fi
 
     ###############
         ALL_PKGS="${ALL_PKGS} postfix"
     elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
         ALL_PKGS="${ALL_PKGS} postfix postfix-pcre"
+    elif [ X"${DISTRO}" == X'GENTOO' ]; then
+        ALL_PKGS="${ALL_PKGS} mail-mta/postfix"
     fi
 
     ENABLED_SERVICES="${ENABLED_SERVICES} postfix"
 dbc_authmethod_user=''
 EOF
         fi
-    else
-        :
+    elif [ X"${DISTRO}" == X'GENTOO' ]; then
+        ALL_PKGS="${ALL_PKGS} mail-filter/policyd"
+        ENABLED_SERVICES="${ENABLED_SERVICES} policyd"
     fi
 
     # Dovecot.
                 ALL_PKGS="${ALL_PKGS} dovecot-pgsql"
             fi
         fi
-    else
-        :
+    elif [ X"${DISTRO}" == X'GENTOO' ]; then
+        ALL_PKGS="${ALL_PKGS} net-mail/dovecot"
+        DISABLED_SERVICES="${DISABLED_SERVICES} saslauthd"
     fi
 
     ENABLED_SERVICES="${ENABLED_SERVICES} dovecot"
         ALL_PKGS="${ALL_PKGS} amavisd-new libcrypt-openssl-rsa-perl libmail-dkim-perl clamav-freshclam clamav-daemon spamassassin altermime arj zoo nomarch cpio lzop cabextract p7zip rpm unrar-free ripole"
         ENABLED_SERVICES="${ENABLED_SERVICES} ${AMAVISD_RC_SCRIPT_NAME} clamav-daemon clamav-freshclam"
         DISABLED_SERVICES="${DISABLED_SERVICES} spamassassin"
-    else
-        :
+
+    elif [ X"${DISTRO}" == X'GENTOO' ]; then
+        ALL_PKGS="${ALL_PKGS} mail-filter/amavisd-new mail-filter/spamassassin app-antivirus/clamav net-mail/altermime"
+        ENABLED_SERVICES="${ENABLED_SERVICES} ${AMAVISD_RC_SCRIPT_NAME} clamd"
+        DISABLED_SERVICES="${DISABLED_SERVICES} spamd"
     fi
 
     # SPF verification.
 
     elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
         ALL_PKGS="${ALL_PKGS} libmail-spf-perl"
+
+    elif [ X"${DISTRO}" == X'GENTOO' ]; then
+        ALL_PKGS="${ALL_PKGS} dev-perl/Mail-SPF dev-perl/Mail-SPF-Query"
     fi
 
     # phpPgAdmin
             ALL_PKGS="${ALL_PKGS} phpPgAdmin"
         elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
             ALL_PKGS="${ALL_PKGS} phppgadmin"
+        elif [ X"${DISTRO}" == X'GENTOO' ]; then
+            ALL_PKGS="${ALL_PKGS} dev-db/phppgadmin"
         fi
     fi
 
         # Don't append 'iredapd' to ${ENABLED_SERVICES} since we don't have
         # RC script ready in early stage.
         #ENABLED_SERVICES="${ENABLED_SERVICES} iredapd"
-    else
-        :
     fi
-    #### End iRedAPD ####
 
     # iRedAdmin.
     # Force install all dependence to help customers install iRedAdmin-Pro.
     elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
         ALL_PKGS="${ALL_PKGS} libapache2-mod-wsgi python-mysqldb python-jinja2 python-netifaces python-webpy"
         [ X"${USE_IREDAPD}" != "YES" ] && ALL_PKGS="${ALL_PKGS} python-ldap"
+    elif [ X"${DISTRO}" == X'GENTOO' ]; then
+        ALL_PKGS="${ALL_PKGS} dev-python/jinja dev-python/webpy dev-python/mysql-python dev-python/netifaces"
+        [ X"${USE_IREDAPD}" != "YES" ] && ALL_PKGS="${ALL_PKGS} dev-python/python-ldap"
     fi
 
     #############
             ALL_PKGS="${ALL_PKGS} awstats"
         elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
             ALL_PKGS="${ALL_PKGS} awstats"
+        elif [ X"${DISTRO}" == X'GENTOO' ]; then
+            ALL_PKGS="${ALL_PKGS} www-misc/awstats"
         fi
     fi
 
             ]; then
             ALL_PKGS="${ALL_PKGS} fail2ban"
             ENABLED_SERVICES="${ENABLED_SERVICES} fail2ban"
+        elif [ X"${DISTRO}" == X'GENTOO' ]; then
+            ALL_PKGS="${ALL_PKGS} net-analyzer/fail2ban"
+            ENABLED_SERVICES="${ENABLED_SERVICES} fail2ban"
         fi
 
         if [ X"${DISTRO}" == X"RHEL" ]; then
     elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
         ALL_PKGS="${ALL_PKGS} bzip2 acl patch cron tofrodos"
         ENABLED_SERVICES="${ENABLED_SERVICES} cron"
-    else
-        :
+    elif [ X"${DISTRO}" == X'GENTOO' ]; then
+        ALL_PKGS="${ALL_PKGS} app-text/dos2unix"
     fi
     #### End Misc packages & services ####