Commits

Zhang Huangbin  committed f2e1a83

Variable renamed to avoid conflict in FreeBSD ports tree: ARCH -> OS_ARCH.

  • Participants
  • Parent commits 7021884

Comments (0)

Files changed (4)

File iRedMail/conf/global

 # Check hardware architecture.
 arch="$(uname -m)"
 case $arch in
-    i[3456]86) export ARCH='i386' ;;
-    x86_64|amd64) export ARCH='x86_64' ;;
+    i[3456]86) export OS_ARCH='i386' ;;
+    x86_64|amd64) export OS_ARCH='x86_64' ;;
     armv6l)
         # Debian ARM platform and Raspberry Pi.
-        export ARCH='armhf' ;;
+        export OS_ARCH='armhf' ;;
     *)
         echo "Your architecture is not supported yet: ${arch}."
         echo "Both i386 and x86_64 are supported by ${PROG_NAME}."
             export UNSUPPORTED_RELEASE='YES'
         fi
 
-        export PKG_ARCH=".${ARCH}"
-        if [ X"${ARCH}" == X"i386" ]; then
+        export PKG_ARCH=".${OS_ARCH}"
+        if [ X"${OS_ARCH}" == X"i386" ]; then
             export PKG_ARCH=''
         fi
 

File iRedMail/conf/openldap

 
     # Module related.
     export OPENLDAP_MODULE_PATH='/usr/lib/openldap'
-    if [ X"${ARCH}" == X'x86_64' ]; then
+    if [ X"${OS_ARCH}" == X'x86_64' ]; then
         export OPENLDAP_MODULE_PATH='/usr/lib64/openldap'
     fi
 

File iRedMail/functions/packages_freebsd.sh

     # Make it don't popup dialog while building ports.
     export PACKAGE_BUILDING='yes'
     export BATCH='yes'
+
     export WANT_OPENLDAP_VER='24'
     export WANT_MYSQL_VER='55'
     export WANT_PGSQL_VER='93'
     export WANT_BDB_VER='48'
     export WANT_APACHE_VER='22'
 
-    freebsd_add_make_conf 'WITHOUT_X11' 'yes'
+    freebsd_add_make_conf 'OPTIONS_SET' 'SASL'
+    freebsd_add_make_conf 'OPTIONS_UNSET' 'X11'
     freebsd_add_make_conf 'WANT_OPENLDAP_VER' "${WANT_OPENLDAP_VER}"
     freebsd_add_make_conf 'WANT_MYSQL_VER' "${WANT_MYSQL_VER}"
     freebsd_add_make_conf 'WANT_PGSQL_VER' "${WANT_PGSQL_VER}"
     freebsd_add_make_conf 'DEFAULT_VERSIONS' 'python=2.7 python2=2.7'
     freebsd_add_make_conf 'APACHE_PORT' "www/apache${WANT_APACHE_VER}"
-    freebsd_add_make_conf 'WITH_SASL' 'yes'
     freebsd_add_make_conf 'WANT_BDB_VER' "${WANT_BDB_VER}"
 
     for p in \
 
     # m4. DEPENDENCE.
     cat > /var/db/ports/devel_m4/options <<EOF
-WITHOUT_LIBSIGSEGV=true
+OPTIONS_FILE_SET+=LIBSIGSEGV
 EOF
 
     # libiconv. DEPENDENCE.
     cat > /var/db/ports/converters_libiconv/options <<EOF
-WITH_EXTRA_ENCODINGS=true
-WITH_EXTRA_PATCHES=true
+OPTIONS_FILE_SET+=DOCS
+OPTIONS_FILE_SET+=ENCODINGS
+OPTIONS_FILE_SET+=PATCHES
 EOF
 
     # Cyrus-SASL2. DEPENDENCE.
 EOF
 
     if [ X"${BACKEND}" == X'OPENLDAP' -o X"${BACKEND}" == X'MYSQL' ]; then
-        ${CMD_SED} -e 's#WITHOUT_MYSQL=true#WITH_MYSQL=true#' /var/db/ports/japanese_p5-Mail-SpamAssassin/options
+        ${CMD_SED} -e 's#OPTIONS_FILE_UNSET+=MYSQL#OPTIONS_FILE_SET+=MYSQL#' /var/db/ports/japanese_p5-Mail-SpamAssassin/options
     elif [ X"${BACKEND}" == X'PGSQL' ]; then
-        ${CMD_SED} -e 's#WITHOUT_PGSQL=true#WITH_PGSQL=true#' /var/db/ports/japanese_p5-Mail-SpamAssassin/options
+        ${CMD_SED} -e 's#OPTIONS_FILE_UNSET+=PGSQL#OPTIONS_FILE_SET+=PGSQL#' /var/db/ports/japanese_p5-Mail-SpamAssassin/options
     fi
     rm -f /var/db/ports/japanese_p5-Mail-SpamAssassin/options${SED_EXTENSION} &>/dev/null
 
 
     # Enable RAR support on i386 only since it requires 32-bit libraries
     # installed under /usr/lib32.
-    if [ X"${ARCH}" == X'i386' ]; then
+    if [ X"${OS_ARCH}" == X'i386' ]; then
         ${CMD_SED} -e 's#OPTIONS_FILE_UNSET+=RAR#OPTIONS_FILE_SET+=RAR#' /var/db/ports/security_amavisd-new/options
     fi
     rm -f /var/db/ports/security_amavisd-new/options${SED_EXTENSION} &>/dev/null
                 # Get time as a UNIX timestamp (seconds elapsed since Jan 1, 1970 0:00 UTC)
                 port_start_time="$(date +%s)"
 
-                make WITH_COMPAT=yes DISABLE_LICENSES=yes fetch-recursive
+                make DISABLE_LICENSES=yes fetch-recursive
                 if [ X"$?" == X"0" ]; then
                     # Log used time
                     used_time="$(($(date +%s)-port_start_time))"

File iRedMail/pkgs/get_all.sh

     export PKG_WGET="wget${PKG_ARCH}"
 
 elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
-    if [ X"${ARCH}" == X"x86_64" ]; then
+    if [ X"${OS_ARCH}" == X"x86_64" ]; then
         export pkg_arch='amd64'
     else
-        export pkg_arch="${ARCH}"
+        export pkg_arch="${OS_ARCH}"
     fi
 
     # Special package.
     # we should take more care of.
     # iRedMail version number, OS distribution, release version, code name, backend.
     ECHO_INFO "Checking new version of iRedMail ..."
-    ${FETCH_CMD} "${IREDMAIL_MIRROR}/version/check.py/iredmail_os?iredmail_version=${PROG_VERSION}&arch=${ARCH}&distro=${DISTRO}&distro_version=${DISTRO_VERSION}&distro_code_name=${DISTRO_CODENAME}" &>/dev/null
+    ${FETCH_CMD} "${IREDMAIL_MIRROR}/version/check.py/iredmail_os?iredmail_version=${PROG_VERSION}&arch=${OS_ARCH}&distro=${DISTRO}&distro_version=${DISTRO_VERSION}&distro_code_name=${DISTRO_CODENAME}" &>/dev/null
 
     UPDATE_AVAILABLE='NO'
     if ls iredmail_os* &>/dev/null; then