Commits

Zhang Huangbin committed fef9eb9

Improve Gentoo support: add USE flags and settings in /etc/make.conf.

  • Participants
  • Parent commits ad8c0cd

Comments (0)

Files changed (3)

iRedMail/conf/core

 
 gentoo_mark_package()
 {
+    [ -f /etc/portage/package.mask ] || touch /etc/portage/package.mask
     ECHO_DEBUG "Mask packages in /etc/portage/package.mask: $@"
     for pkg in $@; do
         if not $(grep "^${pkg}$" /etc/portage/package.mask); then
 
 gentoo_unmark_package()
 {
+    [ -f /etc/portage/package.unmask ] || touch /etc/portage/package.unmask
     for pkg in $@; do
         if not $(grep "^${pkg}$" /etc/portage/package.unmask); then
             ECHO_DEBUG "Unmask packages in /etc/portage/package.unmask: $@"
 
 gentoo_add_use_flags()
 {
+    [ -f /etc/portage/package.use ] || touch /etc/portage/package.use
     # USAGE: gentoo_add_use_flags pkg_name USE_flags
     if [ X"$#" == X'2' ]; then
         echo "${1} ${2}" >> /etc/portage/package.use
     fi
 }
+
+gentoo_add_make_conf()
+{
+    # USAGE: gentoo_add_make_conf VARIABLE VALUE
+    if [ X"$#" == X'2' ]; then
+        export VAR="${1}"
+        export VALUE="${2}"
+
+        # Comment out old setting.
+        perl -pi -e 's/($ENV{VAR}.*)/#${1}/' /etc/make.conf
+
+        # Add new setting.
+        echo "${VAR}='${VALUE}'" >> /etc/make.conf
+
+        unset VAR VALUE
+    fi
+}

iRedMail/conf/global

     export enable_service='enable_service_gentoo'
     export disable_service='disable_service_gentoo'
 
-    # Syslog config file: syslog-nt.
-    export SYSLOG_CONF='/etc/syslog-nt/syslog-ng.conf'
+    # Syslog config file: syslog-ng.
+    export SYSLOG_CONF='/etc/syslog-ng/syslog-ng.conf'
     export SYSLOG_POSTROTATE_CMD=''
 
     # Crontab related.
     export IPTABLES_CONFIG="${ETC_SYSCONFIG_DIR}/iptables"
 
     # Directory used to store SSL/TLS key/cert file.
-    export SSL_FILE_DIR="/etc/pki/tls"
+    export SSL_FILE_DIR="/etc/ssl"
 
     # Yum repository related.
     export YUM_REPOS_DIR='/etc/yum.repos.d'
     # Crontab related.
     export CRON_SPOOL_DIR='/var/cron/tabs'
 
-    # Directory /etc/defaults/ on Debian/Ubuntu.
-    export ETC_SYSCONFIG_DIR='/etc/conf.d'
+    export ETC_SYSCONFIG_DIR='/etc/defaults'
 
     # IPFW rule file.
-    export IPTABLES_CONFIG=""
+    export IPTABLES_CONFIG="${ETC_SYSCONFIG_DIR}/ipfw.rules"
 
     # Directory used to store SSL/TLS key/cert file.
     export SSL_FILE_DIR="/etc/ssl"

iRedMail/functions/packages.sh

         elif [ X"${DISTRO}" == X"GENTOO" ]; then
             ALL_PKGS="${ALL_PKGS} net-nds/openldap"
             ENABLED_SERVICES="${ENABLED_SERVICES} slapd"
+            gentoo_add_use_flags 'net-nds/openldap' 'berkdb crypt ipv6 ssl tcpd overlays perl sasl syslog'
 
             # MySQL server and client.
             ALL_PKGS="${ALL_PKGS} dev-db/mysql"
             ENABLED_SERVICES="${ENABLED_SERVICES} mysql"
+            gentoo_add_use_flags 'dev-db/mysql' 'berkdb community perl ssl big-tables cluster'
         fi
     elif [ X"${BACKEND}" == X"MYSQL" ]; then
         # MySQL server & client.
         elif [ X"${DISTRO}" == X'GENTOO' ]; then
             ALL_PKGS="${ALL_PKGS} dev-db/mysql"
             ENABLED_SERVICES="${ENABLED_SERVICES} mysql"
+            gentoo_add_use_flags 'dev-db/mysql' 'berkdb community perl ssl big-tables cluster'
         fi
     elif [ X"${BACKEND}" == X"PGSQL" ]; then
         export USE_IREDAPD='NO'
         elif [ X"${DISTRO}" == X'GENTOO' ]; then
             ALL_PKGS="${ALL_PKGS} dev-db/postgresql-server"
             ENABLED_SERVICES="${ENABLED_SERVICES} postgresql-${PGSQL_VERSION}"
+            gentoo_add_use_flags 'dev-db/postgresql-server' 'nls pam doc perl python xml'
 
         fi
     fi
     elif [ X"${DISTRO}" == X'GENTOO' ]; then
         ALL_PKGS="${ALL_PKGS} www-servers/apache dev-lang/php"
         ENABLED_SERVICES="${ENABLED_SERVICES} apache2"
+        gentoo_add_use_flags 'dev-libs/apr-util' 'ldap'
+        gentoo_add_use_flags 'www-servers/apache' 'ssl doc ldap suexec'
+        gentoo_add_make_conf 'APACHE2_MODULES' 'actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias auth_digest authn_dbd log_forensic proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http proxy_scgi substitute version'
+        gentoo_add_make_conf 'APACHE2_MPMS' 'prefork'
+
+        gentoo_add_use_flags 'dev-lang/php' 'berkdb bzip2 cli crypt ctype fileinfo filter hash iconv ipv6 json nls phar posix readline session simplexml ssl tokenizer unicode xml zlib apache2 calendar -cdb cgi cjk curl curlwrappers doc flatfile fpm ftp gd gmp imap inifile intl kerberos ldap ldap-sasl mhash mysql mysqli mysqlnd odbc pdo postgres snmp soap sockets spell sqlite sqlite3 suhosin tidy truetype wddx xmlreader xmlrpc xmlwriter xpm xsl zip'
     fi
 
     ###############
     elif [ X"${DISTRO}" == X'GENTOO' ]; then
         ALL_PKGS="${ALL_PKGS} mail-mta/postfix"
         gentoo_unmark_package 'mail-mta/ssmtp'
+        gentoo_add_use_flags 'mail-mta/postfix' 'ipv6 pam ssl cdb dovecot-sasl hardened ldap ldap-bind mbox mysql postgres sasl'
     fi
 
     ENABLED_SERVICES="${ENABLED_SERVICES} postfix"
     elif [ X"${DISTRO}" == X'GENTOO' ]; then
         ALL_PKGS="${ALL_PKGS} net-mail/dovecot"
         DISABLED_SERVICES="${DISABLED_SERVICES} saslauthd"
+        gentoo_add_use_flags 'net-mail/dovecot' 'bzip2 ipv6 maildir pam ssl zlib caps doc kerberos ldap managesieve mbox mdbox mysql postgres sdbox sieve sqlite suid'
     fi
 
     ENABLED_SERVICES="${ENABLED_SERVICES} dovecot"
         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"
+
+        gentoo_add_use_flags 'mail-filter/amavisd-new' 'dkim ldap mysql postgres razor snmp spamassassin'
+        gentoo_add_use_flags 'mail-filter/spamassassin' 'berkdb ipv6 ssl doc ldap mysql postgres sqlite'
+        gentoo_add_use_flags 'app-antivirus/clamav' 'bzip2 iconv ipv6'
     fi
 
     # SPF verification.
     elif [ X"${DISTRO}" == X'GENTOO' ]; then
         ALL_PKGS="${ALL_PKGS} dev-python/jinja dev-python/webpy dev-python/mysql-python"
         [ X"${USE_IREDAPD}" != "YES" ] && ALL_PKGS="${ALL_PKGS} dev-python/python-ldap"
+
+        gentoo_add_use_flags 'dev-python/jinja' 'doc examples i18n vim-syntax'
     fi
 
     #############
             ALL_PKGS="${ALL_PKGS} awstats"
         elif [ X"${DISTRO}" == X'GENTOO' ]; then
             ALL_PKGS="${ALL_PKGS} www-misc/awstats"
+            gentoo_add_use_flags 'www-misc/awstats' 'ipv6 geoip'
         fi
     fi