#!/bin/sh VERSION=1.0 FILES=http://files.directadmin.com WEB=ap2 CONFIGURE=configure.php5 VER=2007f CB=/usr/local/directadmin/custombuild O=/usr/local/directadmin/custombuild/options.conf CB_VER=1 V=`grep '^custombuild=' $O | cut -d= -f2 | cut -d. -f1` if [ "$V" = "2" ]; then CB_VER=2; PHP_CONFIGURE=`${CB}/build used_configs | grep 'PHP (default) configuration file' | cut -d: -f2 | cut -d\ -f2` PHP2_CONFIGURE=`${CB}/build used_configs | grep 'PHP (additional) configuration file' | cut -d: -f2 | cut -d\ -f2` #make sure its sane: if ! echo ${PHP_CONFIGURE} | grep -m1 -q 'configure.php'; then echo "Cannot extract php configure from path: ${PHP_CONFIGURE}"; exit 1; fi #works for both configure and custom folders, as its the same count. CONFIGURE=`echo ${PHP_CONFIGURE} | cut -d/ -f8` WEB=`echo ${PHP_CONFIGURE} | cut -d/ -f7` echo "CustomBuild 2.0"; echo "WEB=${WEB}"; echo "CONFIGURE=${CONFIGURE}"; if echo ${PHP2_CONFIGURE} | grep -m1 -q 'configure.php'; then CONFIGURE2=`echo ${PHP2_CONFIGURE} | cut -d/ -f8` WEB2=`echo ${PHP2_CONFIGURE} | cut -d/ -f7` echo "WEB2=${WEB2}"; echo "CONFIGURE2=${CONFIGURE2}"; fi fi if [ -s /etc/debian_version ]; then apt-get -y install libpam0g-dev else yum -y install pam-devel fi cd /usr/local #wget -O imap-${VER}.tar.gz ftp://ftp.cac.washington.edu/imap/imap-${VER}.tar.gz wget -O imap-${VER}.tar.gz ${FILES}/services/all/imap/imap-${VER}.tar.gz if [ ! -s imap-${VER}.tar.gz ]; then echo "Cannot find imap-${VER}.tar.gz for extraction"; exit 1; fi tar xvzf imap-${VER}.tar.gz cd imap-${VER} UW_PATCH=1006_openssl1.1_autoverify.patch wget -O ${UW_PATCH} ${FILES}/services/custombuild/patches/${UW_PATCH} if [ -s ${UW_PATCH} ]; then patch -p1 < ${UW_PATCH} else echo "Cannot get uw-imap openssl patch: ${UW_PATCH}" echo ' https://bugs.debian.org/828589' echo ' https://bugzilla.redhat.com/attachment.cgi?id=1388349&action=diff#a/1006_openssl1.1_autoverify.patch_sec1' fi make lr5 EXTRACFLAGS=-fPIC mkdir lib mkdir include cp c-client/*.c lib/ cp c-client/*.h include/ cp c-client/c-client.a lib/libc-client.a cd /usr/local/directadmin/custombuild if [ ! -s custom/${WEB}/${CONFIGURE} ]; then mkdir -p custom/${WEB} cp configure/${WEB}/${CONFIGURE} custom/${WEB}/ fi if ! grep -m1 -q with-imap custom/${WEB}/${CONFIGURE}; then perl -pi -e 's#--with-openssl \\#--with-openssl --with-imap=/usr/local/imap-2007f --with-imap-ssl \\#' custom/${WEB}/${CONFIGURE} perl -pi -e 's#"--with-openssl" \\#"--with-openssl" "--with-imap=/usr/local/imap-2007f" "--with-imap-ssl" \\#' custom/${WEB}/${CONFIGURE} fi if echo ${PHP2_CONFIGURE} | grep -m1 -q 'configure.php'; then if [ ! -s custom/${WEB2}/${CONFIGURE2} ]; then mkdir -p custom/${WEB2} cp configure/${WEB2}/${CONFIGURE2} custom/${WEB2}/ fi if ! grep -m1 -q with-imap custom/${WEB2}/${CONFIGURE2}; then perl -pi -e 's#--with-openssl \\#--with-openssl --with-imap=/usr/local/imap-2007f --with-imap-ssl \\#' custom/${WEB2}/${CONFIGURE2} perl -pi -e 's#"--with-openssl" \\#"--with-openssl" "--with-imap=/usr/local/imap-2007f" "--with-imap-ssl" \\#' custom/${WEB2}/${CONFIGURE2} fi fi ./build php n