diff --git a/cyrus-sasl-time.patch b/cyrus-sasl-time.patch new file mode 100644 index 0000000..22a3e97 --- /dev/null +++ b/cyrus-sasl-time.patch @@ -0,0 +1,22 @@ +--- lib/saslutil.c.bak 2022-02-18 22:50:42.000000000 +0100 ++++ lib/saslutil.c 2026-03-04 01:50:59.161139219 +0100 +@@ -59,9 +59,7 @@ + #ifdef HAVE_UNISTD_H + #include + #endif +-#ifdef HAVE_TIME_H + #include +-#endif + #include "saslint.h" + #include + +--- plugins/cram.c.bak 2022-02-18 22:50:42.000000000 +0100 ++++ plugins/cram.c 2026-03-04 02:04:19.141420436 +0100 +@@ -58,6 +58,7 @@ + #include + + #include "plugin_common.h" ++#include + + #ifdef macintosh + #include diff --git a/cyrus-sasl-time.patch.BAK b/cyrus-sasl-time.patch.BAK new file mode 100644 index 0000000..953dd14 --- /dev/null +++ b/cyrus-sasl-time.patch.BAK @@ -0,0 +1,12 @@ +--- lib/saslutil.c.bak 2022-02-18 22:50:42.000000000 +0100 ++++ lib/saslutil.c 2026-03-04 01:50:59.161139219 +0100 +@@ -59,9 +59,7 @@ + #ifdef HAVE_UNISTD_H + #include + #endif +-#ifdef HAVE_TIME_H + #include +-#endif + #include "saslint.h" + #include + diff --git a/cyrus-sasl-time2.patch b/cyrus-sasl-time2.patch new file mode 100644 index 0000000..836b47e --- /dev/null +++ b/cyrus-sasl-time2.patch @@ -0,0 +1,10 @@ +--- plugins/cram.c.bak 2022-02-18 22:50:42.000000000 +0100 ++++ plugins/cram.c 2026-03-04 02:04:19.141420436 +0100 +@@ -58,6 +58,7 @@ + #include + + #include "plugin_common.h" ++#include + + #ifdef macintosh + #include diff --git a/install-php56.sh b/install-php56.sh new file mode 100755 index 0000000..0d4933e --- /dev/null +++ b/install-php56.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Konfiguration +PHP_VERSION="5.6.40" +PHP_SRC="/usr/local/src/php/php-$PHP_VERSION" +ZLIB_PREFIX="/usr/local/zlib-1.2.11" +INSTALL_PREFIX="/usr/local/php56" + +# 1. Quelle herunterladen +mkdir -p /usr/local/src/php +cd /usr/local/src/php +if [ ! -f "php-$PHP_VERSION.tar.bz2" ]; then + wget https://www.php.net/distributions/php-$PHP_VERSION.tar.bz2 +fi + +# 2. Entpacken +if [ ! -d "$PHP_SRC" ]; then + tar -xjf php-$PHP_VERSION.tar.bz2 +fi + +cd "$PHP_SRC" + +# 3. Patches erstellen (Unix-LF) +cat > php56-fileinfo-fix.patch << 'EOF' +--- ext/fileinfo/libmagic/funcs.c ++++ ext/fileinfo/libmagic/funcs.c +@@ -439,7 +439,7 @@ +-file_replace(struct magic_set *ms, const char *pat, const char *rep) ++void file_replace(struct magic_set *ms, const char *pat, const char *rep) +EOF + +cat > php56-zlib-fix.patch << 'EOF' +--- ext/zlib/zlib.c ++++ ext/zlib/zlib.c +@@ +-static void zm_globals_ctor_zlib(zend_zlib_globals *zlib_globals) ++static void zm_globals_ctor_zlib(void *zlib_globals) ++{ ++ zend_zlib_globals *globals = (zend_zlib_globals *) zlib_globals; ++ globals->output_compression_default = 0; ++ globals->output_compression = 0; ++ globals->output_handler = NULL; ++} +EOF + +cat > php56-mbfl-fix.patch << 'EOF' +--- ext/mbstring/libmbfl/mbfilter/mbfilter.c ++++ ext/mbstring/libmbfl/mbfilter/mbfilter.c +@@ +-int mbfl_mbchar_bytes(int c) ++int mbfl_mbchar_bytes(unsigned int c) +EOF + +# 4. Sicherstellen, dass Unix-Zeilenenden vorhanden sind +dos2unix php56-fileinfo-fix.patch +dos2unix php56-zlib-fix.patch +dos2unix php56-mbfl-fix.patch + +# 5. Patches einspielen +patch -p0 < php56-fileinfo-fix.patch +patch -p0 < php56-zlib-fix.patch +patch -p0 < php56-mbfl-fix.patch + +# 6. Configure & Build +make clean || true +./configure --prefix="$INSTALL_PREFIX" --with-zlib="$ZLIB_PREFIX" \ + --enable-mbstring --with-openssl --enable-soap --enable-zip +make -j$(nproc) +make install + +echo "PHP $PHP_VERSION wurde erfolgreich installiert in $INSTALL_PREFIX" +echo "Führe '$INSTALL_PREFIX/bin/php -v' aus, um die Version zu prüfen." + diff --git a/mod_php_install.sh b/mod_php_install.sh index 9756e91..b8fbd16 100755 --- a/mod_php_install.sh +++ b/mod_php_install.sh @@ -10,6 +10,13 @@ _LIBXML2_VERSION="2.9.4" _PYTHON2_VERSION="2.7.16" _OPENSSL1_VERSION="1.1.1w" +_ZLIB_VERSION="1.2.11" +_PCRE_VERSION="8.45" +_POSTGRESQL_VERSION="17.9" +_CURL_VERSION="8.14.1" +_CYRUS_SASL_VERSION="2.1.28" +_OPENLDAP_VERSION="2.6.10" + #WITHOUT_APACHE_MOD_PHP=true _APACHE_MOD_PHP=no @@ -499,9 +506,15 @@ do fi done PHP_MAIN_VERSION=`echo $VERSION | cut -d '.' -f1,2` -PHP_MAJOR_VERSION=`echo $VERSION | cut -d '.' -f1` -PHP_MINOR_VERSION=`echo $VERSION | cut -d '.' -f2` -PHP_PATCH_LEVEL=`echo $VERSION | cut -d '.' -f3` +declare -i PHP_MAJOR_VERSION=`echo $VERSION | cut -d '.' -f1` +declare -i PHP_MINOR_VERSION=`echo $VERSION | cut -d '.' -f2` +declare -i PHP_PATCH_LEVEL=`echo $VERSION | cut -d '.' -f3` +declare -i PHP_MAIN_VERSION_NUM=$((PHP_MAJOR_VERSION * 100 + PHP_MINOR_VERSION * 10)) +declare -i PHP_VERSION_NUM=$((PHP_MAJOR_VERSION * 100 + PHP_MINOR_VERSION * 10 + PHP_PATCH_LEVEL)) +#echo "" +#echo "PHP_MAIN_VERSION_NUM: $PHP_MAIN_VERSION_NUM" +#echo "PHP_VERSION_NUM: $PHP_VERSION_NUM" +#echo "" # Since version 7.4 package 'libsqlite3-dev' is needed # Since version 7.4 package 'libonig-dev' is needed @@ -527,7 +540,22 @@ else unset MAKEFLAGS fi -if [[ "$PHP_MAIN_VERSION" = "5.6" ]] && [[ $os_version -gt 11 ]]; then +if [[ "$PHP_MAIN_VERSION" = "5.6" ]] && [[ $os_version -gt 12 ]]; then + + warn "For php version 5.6 at debian 13 and above, you need manual installation of + +\t freetype (libfreetype6-dev) +\t libxml2 +\t icu4c (libicu) +\t openssl v 1.1.1 +\t zlib v 1.2.111 +\t pcre v 8.45 +\t postgresql compiled against openssl 1.1 +\t curl compiled against openssl 1.1 +\t cyrus-sasl compiled against openssl 1.1 +\t openldap compiled against cyrus-sasl" + +elif [[ "$PHP_MAIN_VERSION" = "5.6" ]] && [[ $os_version -gt 11 ]]; then warn "For php version 5.6 at debian 12 and above, you need manual installation of @@ -2048,6 +2076,13 @@ _install_icu4c=false _install_libxml2=false _install_python2=false _install_openssl1=false +_install_zlib_1_2=false +_install_pcre_845=false +_install_postgresql=false +_install_curl=false +_install_cyrus_sasl=false +_install_openldap=false + if ([[ "$PHP_MAJOR_VERSION" -eq 7 ]] && [[ "$PHP_MINOR_VERSION" -lt 4 ]]) \ || [[ "$PHP_MAJOR_VERSION" -lt 7 ]] ; then @@ -2217,7 +2252,171 @@ if ([[ "$PHP_MAJOR_VERSION" -eq 7 ]] && [[ "$PHP_MINOR_VERSION" -lt 4 ]]) \ fi + if [[ "$os_dist" = "debian" ]] && [[ $os_version -gt 12 ]] ; then + echo "" + echo "" + echo -e "\033[32m--\033[m" + echo "" + echo "We need to install zlib version 1.2.11" + echo -e "" + echo -e "Which version of zlib should be installed?" + echo "" + ZLIB_VERSION= + if [[ -n "$_ZLIB_VERSION" ]]; then + echononl "zlib Version [${_ZLIB_VERSION}]: " + read ZLIB_VERSION + if [[ "X$ZLIB_VERSION" = "X" ]] ; then + ZLIB_VERSION="$_ZLIB_VERSION" + fi + else + echononl "zlib Version: " + read ZLIB_VERSION + while [[ "X$ZLIB_VERSION" = "X" ]]; do + echo -e "\n \033[33m\033[1zlib version must not be empty!\033[m\n" + echononl "zlib Version: " + read ZLIB_VERSION + done + fi + + _install_zlib_1_2=true + + echo "" + echo "" + echo -e "\033[32m--\033[m" + echo "" + echo "We need to install pcre version 8.45" + echo -e "" + echo -e "Which version of zlib should be installed?" + echo "" + PCRE_VERSION= + if [[ -n "$_PCRE_VERSION" ]]; then + echononl "pcre Version [${_PCRE_VERSION}]: " + read PCRE_VERSION + if [[ "X$PCRE_VERSION" = "X" ]] ; then + PCRE_VERSION="$_PCRE_VERSION" + fi + else + echononl "pcre Version: " + read PCRE_VERSION + while [[ "X$PCRE_VERSION" = "X" ]]; do + echo -e "\n \033[33m\033[1pcre version must not be empty!\033[m\n" + echononl "pcre Version: " + read PCRE_VERSION + done + fi + + _install_pcre_845=true + + echo "" + echo "" + echo -e "\033[32m--\033[m" + echo "" + echo "We need to install a postgreSQL version compiled against OpenSSL 1.1 " + echo -e "" + echo -e "Which version of postgreSQLb should be installed?" + echo "" + POSTGRESQL_VERSION= + if [[ -n "$_POSTGRESQL_VERSION" ]]; then + echononl "postgreSQL Version [${_POSTGRESQL_VERSION}]: " + read POSTGRESQL_VERSION + if [[ "X$POSTGRESQL_VERSION" = "X" ]] ; then + POSTGRESQL_VERSION="$_POSTGRESQL_VERSION" + fi + else + echononl "postgreSQL Version: " + read POSTGRESQL_VERSION + while [[ "X$POSTGRESQL_VERSION" = "X" ]]; do + echo -e "\n \033[33m\033[1pcre version must not be empty!\033[m\n" + echononl "postgreSQL Version: " + read POSTGRESQL_VERSION + done + fi + + _install_postgresql=true + + echo "" + echo "" + echo -e "\033[32m--\033[m" + echo "" + echo "We need to install a curl version compiled against OpenSSL 1.1 " + echo -e "" + echo -e "Which version of curl should be installed?" + echo "" + CURL_VERSION= + if [[ -n "$_CURL_VERSION" ]]; then + echononl "curl Version [${_CURL_VERSION}]: " + read CURL_VERSION + if [[ "X$CURL_VERSION" = "X" ]] ; then + CURL_VERSION="$_CURL_VERSION" + fi + else + echononl "curl Version: " + read CURL_VERSION + while [[ "X$CURL_VERSION" = "X" ]]; do + echo -e "\n \033[33m\033[1curl version must not be empty!\033[m\n" + echononl "curl Version: " + read CURL_VERSION + done + fi + + _install_curl=true + + echo "" + echo "" + echo -e "\033[32m--\033[m" + echo "" + echo "We need to install a cyrus_sasl version compiled against OpenSSL 1.1 " + echo -e "" + echo -e "Which version of cyrus_sasl should be installed?" + echo "" + CYRUS_SASL_VERSION= + if [[ -n "$_CYRUS_SASL_VERSION" ]]; then + echononl "cyrus_sasl Version [${_CYRUS_SASL_VERSION}]: " + read CYRUS_SASL_VERSION + if [[ "X$CYRUS_SASL_VERSION" = "X" ]] ; then + CYRUS_SASL_VERSION="$_CYRUS_SASL_VERSION" + fi + else + echononl "cyrus_sasl Version: " + read CYRUS_SASL_VERSION + while [[ "X$CYRUS_SASL_VERSION" = "X" ]]; do + echo -e "\n \033[33m\033[1cyrus_sasl version must not be empty!\033[m\n" + echononl "cyrus_sasl Version: " + read CYRUS_SASL_VERSION + done + fi + + _install_cyrus_sasl=true + + echo "" + echo "" + echo -e "\033[32m--\033[m" + echo "" + echo "We need to install a openldap version compiled against OpenSSL 1.1 " + echo -e "" + echo -e "Which version of openldap should be installed?" + echo "" + OPENLDAP_VERSION= + if [[ -n "$_OPENLDAP_VERSION" ]]; then + echononl "openldap Version [${_OPENLDAP_VERSION}]: " + read OPENLDAP_VERSION + if [[ "X$OPENLDAP_VERSION" = "X" ]] ; then + OPENLDAP_VERSION="$_OPENLDAP_VERSION" + fi + else + echononl "openldap Version: " + read OPENLDAP_VERSION + while [[ "X$OPENLDAP_VERSION" = "X" ]]; do + echo -e "\n \033[33m\033[1openldap version must not be empty!\033[m\n" + echononl "openldap Version: " + read OPENLDAP_VERSION + done + fi + + _install_openldap=true + + fi fi # if [[ "$PHP_MAJOR_VERSION" -lt 7 ]] @@ -2405,10 +2604,39 @@ if $_install_python2 ; then fi echo "" echo "Install extern OpenSSL...............: $_install_openssl1" -if $_install_python2 ; then +if $_install_openssl1 ; then echo " OpenSSL version...................: $OPENSSL1_VERSION" fi echo "" +echo "Install extern zlib library..........: $_install_zlib_1_2" +if $_install_zlib_1_2 ; then + echo " zlib library version..............: ${ZLIB_VERSION}" +fi +echo "" +echo "Install extern pcre..................: $_install_pcre_845" +if $_install_pcre_845 ; then + echo " pcre version......................: ${PCRE_VERSION}" +fi +echo "" +echo "Install extern postgreSQL............: $_install_postgresql" +if $_install_postgresql ; then + echo " postgreSQL version................: ${POSTGRESQL_VERSION}" +fi +echo "" +echo "Install extern curl..................: $_install_curl" +if $_install_curl ; then + echo " curl version......................: ${CURL_VERSION}" +fi +echo "" +echo "Install extern cyrus-sasl............: $_install_cyrus_sasl" +if $_install_cyrus_sasl ; then + echo " cyrus-sasl version................: ${CYRUS_SASL_VERSION}" +fi +echo "Install extern openldap..............: $_install_openldap" +if $_install_openldap ; then + echo " curl version......................: ${OPENLDAP_VERSION}" +fi +echo "" echo "Skip 'updatedb'......................: $SKIP_UPDATE_DB" echo "" echo "" @@ -3290,10 +3518,15 @@ if $_install_libxml2 && [[ ! -d /usr/local/libxml2-$LIBXML2_VERSION ]]; then cd "$_src_dir_libxml2" +# OLD: ftp://xmlsoft.org/libxml2/${libxml2_archive} +# +# NEW: http://xmlsoft.org/ftp/libxml2/${libxml2_archive} +# http://xmlsoft.org/sources/${libxml2_archive} +# echononl "\tGet source $libxml2_archive .." if [[ ! -f ${_src_dir_libxml2}/$libxml2_archive ]]; then wget -O "${_src_dir_libxml2}/$libxml2_archive" \ - ftp://xmlsoft.org/libxml2/${libxml2_archive} \ + http://xmlsoft.org/sources/${libxml2_archive} \ >> ${_logdir}/main.log 2>&1 if [ "$?" = "0" ]; then echo_ok @@ -3724,6 +3957,1660 @@ if $_install_openssl1 && [[ ! -d /usr/local/openssl-$OPENSSL1_VERSION ]]; then fi +if $_install_zlib_1_2 && [[ ! -d /usr/local/zlib-$ZLIB_VERSION ]]; then + + ## - Install zlib' + ## - + echo "" + echo "" + echo -e "\t---" + echo -e "\t--- Install zlib" + echo -e "\t---" + echo "" + + _NAME="zlib" + + _VERSION="${ZLIB_VERSION}" + + _archive_file="zlib-${_VERSION}.tar.xz" + _download_url="https://toolchains.bootlin.com/downloads/releases/sources/zlib-${_VERSION}/zlib-${_VERSION}.tar.xz" + + _src_dir="/usr/local/src/zlib" + _build_dir="${_src_dir}/zlib-${_VERSION}" + + _install_dir="/usr/local/zlib-${_VERSION}" + + echononl "\tCreate source directory '$_src_dir'.." + if [[ ! -d "$_src_dir" ]]; then + mkdir "$_src_dir" >> ${_logdir}/main.log 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "Cannot create directory '$_src_dir'" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + cd "$_src_dir" + + echononl "\tGet source $_archive_file .." + if [[ ! -f ${_src_dir}/$_archive_file ]]; then + wget -O "${_src_dir}/$_archive_file" \ + ${_download_url} \ + >> ${_logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Cannot Download '$_archive_file'" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + _backup_dir="$_build_dir" + echononl "\tBackup existing directory '${_backup_dir}'.." + if [[ -d "${_backup_dir}" ]]; then + mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg + if [[ $? -eq 0 ]] ; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + echononl "\tUnpack archive \"$_archive_file\".." + + if [[ "${_archive_file}" == *.tar.gz || "${_archive_file}" == *.tgz ]]; then + echo "Entpacke Gzip-Archiv (.tar.gz/.tgz) nach ${_src_dir}..." + tar -xzf "${_archive_file}" -C "${_src_dir}" + + elif [[ "${_archive_file}" == *.tar.xz ]]; then + echo "Entpacke XZ-Archiv (.tar.xz) nach ${_src_dir}..." + tar -xJf "${_archive_file}" -C "${_src_dir}" + + else + fatal "Archive Fehler: Dateiformat von ${_archive_file} wird nicht unterstützt." + fi + + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + cd "$_build_dir" + + config_params="--prefix=${_install_dir}" + + echononl "\tGoing to configure ${_NAME} ${_VERSION} .." + + if [[ -x "./config" ]] ; then + + config_params="--prefix=${_install_dir}" + + ./config ${config_params} > ${_logdir}/${_NAME}-configure.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configuring (Configure) ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-configure.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + + ./configure $config_params >> ${_logdir}/${_NAME}-configure.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configuring ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-configure.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + fi + + echononl "\tGoing to compile ${_NAME} ${_VERSION} .." + make > ${_logdir}/${_NAME}-make.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Compiling ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-make.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + _backup_dir="/usr/local/${_NAME}-${_VERSION}" + echononl "\tBackup existing directory '${_backup_dir}'.." + if [[ -d "${_backup_dir}" ]]; then + mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg + if [[ $? -eq 0 ]] ; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + echononl "\tGoing to install ${_NAME} v${_VERSION}.." + make install > ${_logdir}/${_NAME}-make_install.log 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "Installing ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-make_install.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + echononl "\tSet symlink /usr/local/${_NAME} -> /usr/local/${_NAME}-${_VERSION} .." + if [ -L /usr/local/${_NAME} ];then + rm -f /usr/local/${_NAME} + fi + + ln -s ${_NAME}-${_VERSION} /usr/local/${_NAME} > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + +fi + + +if $_install_pcre_845 && [[ ! -d /usr/local/pcre-${PCRE_VERSION} ]]; then + + ## - Install pcre' + ## - + echo "" + echo "" + echo -e "\t---" + echo -e "\t--- Install pcre" + echo -e "\t---" + echo "" + + _NAME="pcre" + + _VERSION="${PCRE_VERSION}" + + _archive_file="pcre-${_VERSION}.tar.gz" + _download_url="https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz/download" + + _src_dir="/usr/local/src/pcre" + _build_dir="${_src_dir}/pcre-${_VERSION}" + + _install_dir="/usr/local/pcre-${_VERSION}" + + echononl "\tCreate source directory '$_src_dir'.." + if [[ ! -d "$_src_dir" ]]; then + mkdir "$_src_dir" >> ${_logdir}/main.log 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "Cannot create directory '$_src_dir'" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + cd "$_src_dir" + + echononl "\tGet source $_archive_file .." + if [[ ! -f ${_src_dir}/$_archive_file ]]; then + wget -O "${_src_dir}/$_archive_file" \ + ${_download_url} \ + >> ${_logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Cannot Download '$_archive_file'" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + _backup_dir="$_build_dir" + echononl "\tBackup existing directory '${_backup_dir}'.." + if [[ -d "${_backup_dir}" ]]; then + mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg + if [[ $? -eq 0 ]] ; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + echononl "\tUnpack archive \"$_archive_file\".." + + if [[ "${_archive_file}" == *.tar.gz || "${_archive_file}" == *.tgz ]]; then + echo "Entpacke Gzip-Archiv (.tar.gz/.tgz) nach ${_src_dir}..." + tar -xzf "${_src_dir}/${_archive_file}" -C "${_src_dir}" + + elif [[ "${_archive_file}" == *.tar.xz ]]; then + echo "Entpacke XZ-Archiv (.tar.xz) nach ${_src_dir}..." + tar -xJf "${_archive_file}" -C "${_src_dir}" + + else + fatal "Archive Fehler: Dateiformat von ${_archive_file} wird nicht unterstützt." + fi + + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + cd "$_build_dir" + + config_params="--prefix=${_install_dir}" + + echononl "\tGoing to configure ${_NAME} ${_VERSION} .." + + if [[ -x "./config" ]] ; then + + config_params="--prefix=${_install_dir}" + + ./config ${config_params} > ${_logdir}/${_NAME}-configure.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configuring (Configure) ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-configure.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + + ./configure $config_params >> ${_logdir}/${_NAME}-configure.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configuring ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-configure.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + fi + + echononl "\tGoing to compile ${_NAME} ${_VERSION} .." + make > ${_logdir}/${_NAME}-make.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Compiling ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-make.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + _backup_dir="/usr/local/${_NAME}-${_VERSION}" + echononl "\tBackup existing directory '${_backup_dir}'.." + if [[ -d "${_backup_dir}" ]]; then + mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg + if [[ $? -eq 0 ]] ; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + echononl "\tGoing to install ${_NAME} v${_VERSION}.." + make install > ${_logdir}/${_NAME}-make_install.log 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "Installing ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-make_install.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + echononl "\tSet symlink /usr/local/${_NAME} -> /usr/local/${_NAME}-${_VERSION} .." + if [ -L /usr/local/${_NAME} ];then + rm -f /usr/local/${_NAME} + fi + + ln -s ${_NAME}-${_VERSION} /usr/local/${_NAME} > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + +fi + + +if $_install_postgresql && [[ ! -d /usr/local/postgresql-${POSTGRESQL_VERSION} ]]; then + + ## - Install 'postgresql' + ## - + echo "" + echo "" + echo -e "\t---" + echo -e "\t--- Install postgresql" + echo -e "\t---" + echo "" + + _NAME="postgresql" + + _VERSION="${POSTGRESQL_VERSION}" + + _archive_file="postgresql-${_VERSION}.tar.gz" + _download_url="https://ftp.postgresql.org/pub/source/v${_VERSION}/postgresql-${_VERSION}.tar.gz" + + _src_dir="/usr/local/src/${_NAME}" + _build_dir="${_src_dir}/${_NAME}-${_VERSION}" + + _install_dir="/usr/local/${_NAME}-${_VERSION}" + + echononl "\tCreate source directory '$_src_dir'.." + if [[ ! -d "$_src_dir" ]]; then + mkdir "$_src_dir" >> ${_logdir}/main.log 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "Cannot create directory '$_src_dir'" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + cd "$_src_dir" + + echononl "\tGet source $_archive_file .." + if [[ ! -f ${_src_dir}/$_archive_file ]]; then + wget -O "${_src_dir}/$_archive_file" \ + ${_download_url} \ + >> ${_logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Cannot Download '$_archive_file'" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + _backup_dir="$_build_dir" + echononl "\tBackup existing directory '${_backup_dir}'.." + if [[ -d "${_backup_dir}" ]]; then + mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg + if [[ $? -eq 0 ]] ; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + echononl "\tUnpack archive \"$_archive_file\".." + + if [[ "${_archive_file}" == *.tar.gz || "${_archive_file}" == *.tgz ]]; then + tar -xzf "${_src_dir}/${_archive_file}" -C "${_src_dir}" + + elif [[ "${_archive_file}" == *.tar.xz ]]; then + tar -xJf "${_archive_file}" -C "${_src_dir}" + + else + fatal "Archive Fehler: Dateiformat von ${_archive_file} wird nicht unterstützt." + fi + + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + cd "$_build_dir" + + OPENSSL=/usr/local/openssl + + config_params="--prefix=${_install_dir} + --with-ssl=openssl" + + echononl "\tGoing to configure ${_NAME} ${_VERSION} .." + + if [[ -x "./configure" ]] ; then + + #export CPPFLAGS="-I/usr/local/openssl/include" + #export LDFLAGS="-L/usr/local/openssl/lib -Wl,-rpath,/usr/local/openssl/lib" + + CPPFLAGS="-I${OPENSSL}/include" \ + LDFLAGS="-L${OPENSSL}/lib -Wl,-rpath,${OPENSSL}/lib" \ + PKG_CONFIG_PATH="${OPENSSL}/lib/pkgconfig" \ + ./configure $config_params >> ${_logdir}/${_NAME}-configure.log 2>&1 + + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configuring ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-configure.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + elif [[ -x "./config" ]] ; then + + CPPFLAGS="-I${OPENSSL}/include" \ + LDFLAGS="-L${OPENSSL}/lib -Wl,-rpath,${OPENSSL}/lib" \ + PKG_CONFIG_PATH="${OPENSSL}/lib/pkgconfig" \ + ./config ${config_params} > ${_logdir}/${_NAME}-configure.log 2>&1 + + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configuring (Configure) ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-configure.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + fi + + echononl "\tGoing to compile ${_NAME} ${_VERSION} .." + make -j"$(nproc)" > ${_logdir}/${_NAME}-make.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Compiling ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-make.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + _backup_dir="/usr/local/${_NAME}-${_VERSION}" + echononl "\tBackup existing directory '${_backup_dir}'.." + if [[ -d "${_backup_dir}" ]]; then + mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg + if [[ $? -eq 0 ]] ; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + echononl "\tGoing to install ${_NAME} v${_VERSION}.." + make install > ${_logdir}/${_NAME}-make_install.log 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "Installing ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-make_install.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + echononl "\tSet symlink /usr/local/${_NAME} -> /usr/local/${_NAME}-${_VERSION} .." + if [ -L /usr/local/${_NAME} ];then + rm -f /usr/local/${_NAME} + fi + + ln -s ${_NAME}-${_VERSION} /usr/local/${_NAME} > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + #unset CPPFLAGS + #unset LDFLAGS + +fi + + +if $_install_curl && [[ ! -d /usr/local/curl-${CURL_VERSION} ]]; then + + ## - Install 'curl' + ## - + echo "" + echo "" + echo -e "\t---" + echo -e "\t--- Install curl" + echo -e "\t---" + echo "" + + _NAME="curl" + + _VERSION="${CURL_VERSION}" + + _archive_file="curl-${_VERSION}.tar.gz" + _download_url="https://curl.se/download/curl-${_VERSION}.tar.gz" + + _src_dir="/usr/local/src/${_NAME}" + _build_dir="${_src_dir}/${_NAME}-${_VERSION}" + + _install_dir="/usr/local/${_NAME}-${_VERSION}" + + echononl "\tCreate source directory '$_src_dir'.." + if [[ ! -d "$_src_dir" ]]; then + mkdir "$_src_dir" >> ${_logdir}/main.log 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "Cannot create directory '$_src_dir'" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + cd "$_src_dir" + + echononl "\tGet source $_archive_file .." + if [[ ! -f ${_src_dir}/$_archive_file ]]; then + wget -O "${_src_dir}/$_archive_file" \ + ${_download_url} \ + >> ${_logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Cannot Download '$_archive_file'" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + _backup_dir="$_build_dir" + echononl "\tBackup existing directory '${_backup_dir}'.." + if [[ -d "${_backup_dir}" ]]; then + mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg + if [[ $? -eq 0 ]] ; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + echononl "\tUnpack archive \"$_archive_file\".." + + if [[ "${_archive_file}" == *.tar.gz || "${_archive_file}" == *.tgz ]]; then + tar -xzf "${_src_dir}/${_archive_file}" -C "${_src_dir}" + + elif [[ "${_archive_file}" == *.tar.xz ]]; then + tar -xJf "${_archive_file}" -C "${_src_dir}" + + else + fatal "Archive Fehler: Dateiformat von ${_archive_file} wird nicht unterstützt." + fi + + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + cd "$_build_dir" + + OPENSSL=/usr/local/openssl + + config_params="--prefix=${_install_dir} + --with-ssl=${OPENSSL} \ + --disable-ldap \ + --without-libidn2" + + echononl "\tGoing to configure ${_NAME} ${_VERSION} .." + + if [[ -x "./configure" ]] ; then + + CPPFLAGS="-I${OPENSSL}/include" \ + LDFLAGS="-L${OPENSSL}/lib -Wl,-rpath,${OPENSSL}/lib" \ + PKG_CONFIG_PATH="${OPENSSL}/lib/pkgconfig" \ + ./configure $config_params >> ${_logdir}/${_NAME}-configure.log 2>&1 + + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configuring ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-configure.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + elif [[ -x "./config" ]] ; then + + CPPFLAGS="-I${OPENSSL}/include" \ + LDFLAGS="-L${OPENSSL}/lib -Wl,-rpath,${OPENSSL}/lib" \ + PKG_CONFIG_PATH="${OPENSSL}/lib/pkgconfig" \ + ./config ${config_params} > ${_logdir}/${_NAME}-configure.log 2>&1 + + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configuring (Configure) ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-configure.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + fi + + echononl "\tGoing to compile ${_NAME} ${_VERSION} .." + make -j"$(nproc)" > ${_logdir}/${_NAME}-make.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Compiling ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-make.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + _backup_dir="/usr/local/${_NAME}-${_VERSION}" + echononl "\tBackup existing directory '${_backup_dir}'.." + if [[ -d "${_backup_dir}" ]]; then + mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg + if [[ $? -eq 0 ]] ; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + echononl "\tGoing to install ${_NAME} v${_VERSION}.." + make install > ${_logdir}/${_NAME}-make_install.log 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "Installing ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-make_install.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + echononl "\tSet symlink /usr/local/${_NAME} -> /usr/local/${_NAME}-${_VERSION} .." + if [ -L /usr/local/${_NAME} ];then + rm -f /usr/local/${_NAME} + fi + + ln -s ${_NAME}-${_VERSION} /usr/local/${_NAME} > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + #unset CPPFLAGS + #unset LDFLAGS + +fi + + +if $_install_cyrus_sasl && [[ ! -d /usr/local/cyrus-sasl-${CYRUS_SASL_VERSION} ]]; then + + ## - Install 'cyrus_sasl' + ## - + echo "" + echo "" + echo -e "\t---" + echo -e "\t--- Install cyrus-sasl" + echo -e "\t---" + echo "" + + _NAME="cyrus-sasl" + + _VERSION="${CYRUS_SASL_VERSION}" + + _archive_file="cyrus-sasl-${_VERSION}.tar.gz" + _download_url="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-${_VERSION}/cyrus-sasl-${_VERSION}.tar.gz" + + _src_dir="/usr/local/src/${_NAME}" + _build_dir="${_src_dir}/${_NAME}-${_VERSION}" + + _install_dir="/usr/local/${_NAME}-${_VERSION}" + + echononl "\tCreate source directory '$_src_dir'.." + if [[ ! -d "$_src_dir" ]]; then + mkdir "$_src_dir" >> ${_logdir}/main.log 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "Cannot create directory '$_src_dir'" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + cd "$_src_dir" + + echononl "\tGet source $_archive_file .." + if [[ ! -f ${_src_dir}/$_archive_file ]]; then + wget -O "${_src_dir}/$_archive_file" \ + ${_download_url} \ + >> ${_logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Cannot Download '$_archive_file'" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + _backup_dir="$_build_dir" + echononl "\tBackup existing directory '${_backup_dir}'.." + if [[ -d "${_backup_dir}" ]]; then + mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg + if [[ $? -eq 0 ]] ; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + echononl "\tUnpack archive \"$_archive_file\".." + + if [[ "${_archive_file}" == *.tar.gz || "${_archive_file}" == *.tgz ]]; then + tar -xzf "${_src_dir}/${_archive_file}" -C "${_src_dir}" + + elif [[ "${_archive_file}" == *.tar.xz ]]; then + tar -xJf "${_archive_file}" -C "${_src_dir}" + + else + fatal "Archive Fehler: Dateiformat von ${_archive_file} wird nicht unterstützt." + fi + + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + + # Apply patch + # + echononl "\tApply patch 'cyrus-sasl-time.patch'.." + if [[ -f /usr/local/src/php/cyrus-sasl-time.patch ]] ; then + patch -d ${_build_dir} -p0 < /usr/local/src/php/cyrus-sasl-time.patch > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + fatal "$(cat $tmp_err_msg)" + fi + else + echo_failed + fatal "Can't find patchfile '/usr/local/src/php/cyrus-sasl-time.patch'" + fi + + + cd "$_build_dir" + + OPENSSL=/usr/local/openssl + + config_params="--prefix=${_install_dir} + --disable-sample \ + --disable-saslauthd \ + --with-openssl=${OPENSSL}" + + echononl "\tGoing to configure ${_NAME} ${_VERSION} .." + + if [[ -x "./configure" ]] ; then + + CPPFLAGS="-I${OPENSSL}/include" \ + LDFLAGS="-L${OPENSSL}/lib -Wl,-rpath,${OPENSSL}/lib" \ + PKG_CONFIG_PATH="${OPENSSL}/lib/pkgconfig" \ + ./configure $config_params >> ${_logdir}/${_NAME}-configure.log 2>&1 + + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configuring ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-configure.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + elif [[ -x "./config" ]] ; then + + CPPFLAGS="-I${OPENSSL}/include" \ + LDFLAGS="-L${OPENSSL}/lib -Wl,-rpath,${OPENSSL}/lib" \ + PKG_CONFIG_PATH="${OPENSSL}/lib/pkgconfig" \ + ./config ${config_params} > ${_logdir}/${_NAME}-configure.log 2>&1 + + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configuring (Configure) ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-configure.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + fi + + echononl "\tGoing to compile ${_NAME} ${_VERSION} .." + make -j"$(nproc)" > ${_logdir}/${_NAME}-make.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Compiling ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-make.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + _backup_dir="/usr/local/${_NAME}-${_VERSION}" + echononl "\tBackup existing directory '${_backup_dir}'.." + if [[ -d "${_backup_dir}" ]]; then + mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg + if [[ $? -eq 0 ]] ; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + echononl "\tGoing to install ${_NAME} v${_VERSION}.." + make install > ${_logdir}/${_NAME}-make_install.log 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "Installing ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-make_install.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + echononl "\tSet symlink /usr/local/${_NAME} -> /usr/local/${_NAME}-${_VERSION} .." + if [ -L /usr/local/${_NAME} ];then + rm -f /usr/local/${_NAME} + fi + + ln -s ${_NAME}-${_VERSION} /usr/local/${_NAME} > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + +fi + + +if $_install_openldap && [[ ! -d /usr/local/openldap-${OPENLDAP_VERSION} ]]; then + + ## - Install 'openldap' + ## - + echo "" + echo "" + echo -e "\t---" + echo -e "\t--- Install openldap" + echo -e "\t---" + echo "" + + _NAME="openldap" + + _VERSION="${OPENLDAP_VERSION}" + + _archive_file="openldap-${_VERSION}.tar.gz" + _download_url="https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-${_VERSION}.tgz" + + + _src_dir="/usr/local/src/${_NAME}" + _build_dir="${_src_dir}/${_NAME}-${_VERSION}" + + _install_dir="/usr/local/${_NAME}-${_VERSION}" + + echononl "\tCreate source directory '$_src_dir'.." + if [[ ! -d "$_src_dir" ]]; then + mkdir "$_src_dir" >> ${_logdir}/main.log 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "Cannot create directory '$_src_dir'" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + cd "$_src_dir" + + echononl "\tGet source $_archive_file .." + if [[ ! -f ${_src_dir}/$_archive_file ]]; then + wget -O "${_src_dir}/$_archive_file" \ + ${_download_url} \ + >> ${_logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Cannot Download '$_archive_file'" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + _backup_dir="$_build_dir" + echononl "\tBackup existing directory '${_backup_dir}'.." + if [[ -d "${_backup_dir}" ]]; then + mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg + if [[ $? -eq 0 ]] ; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + echononl "\tUnpack archive \"$_archive_file\".." + + if [[ "${_archive_file}" == *.tar.gz || "${_archive_file}" == *.tgz ]]; then + tar -xzf "${_src_dir}/${_archive_file}" -C "${_src_dir}" + + elif [[ "${_archive_file}" == *.tar.xz ]]; then + tar -xJf "${_archive_file}" -C "${_src_dir}" + + else + fatal "Archive Fehler: Dateiformat von ${_archive_file} wird nicht unterstützt." + fi + + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + cd "$_build_dir" + + OPENSSL=/usr/local/openssl + + config_params="--prefix=${_install_dir} + --with-tls=openssl \ + --with-cyrus-sasl \ + --enable-shared \ + --disable-slapd" + + echononl "\tGoing to configure ${_NAME} ${_VERSION} .." + + if [[ -x "./configure" ]] ; then + + CPPFLAGS="-I${OPENSSL}/include -I/usr/local/cyrus-sasl/include" \ + LDFLAGS="-L${OPENSSL}/lib -Wl,-rpath,${OPENSSL}/lib -L/usr/local/cyrus-sasl/lib -Wl,-rpath,/usr/local/cyrus-sasl/lib" \ + ./configure $config_params >> ${_logdir}/${_NAME}-configure.log 2>&1 + + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configuring ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-configure.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + elif [[ -x "./config" ]] ; then + + CPPFLAGS="-I${OPENSSL}/include -I/usr/local/cyrus-sasl/include" \ + LDFLAGS="-L${OPENSSL}/lib -Wl,-rpath,${OPENSSL}/lib -L/usr/local/cyrus-sasl/lib -Wl,-rpath,/usr/local/cyrus-sasl/lib" \ + ./config ${config_params} > ${_logdir}/${_NAME}-configure.log 2>&1 + + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configuring (Configure) ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-configure.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + fi + + echononl "\tGoing to compile ${_NAME} ${_VERSION} .." + make -j"$(nproc)" > ${_logdir}/${_NAME}-make.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Compiling ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-make.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + _backup_dir="/usr/local/${_NAME}-${_VERSION}" + echononl "\tBackup existing directory '${_backup_dir}'.." + if [[ -d "${_backup_dir}" ]]; then + mv "${_backup_dir}" "${_backup_dir}.$_backup_date" > /dev/null 2> $tmp_err_msg + if [[ $? -eq 0 ]] ; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + else + echo_skipped + fi + + echononl "\tGoing to install ${_NAME} v${_VERSION}.." + make install > ${_logdir}/${_NAME}-make_install.log 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "Installing ${_NAME} failed!\n\t see ${_logdir}/${_NAME}-make_install.log for more details" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + + echononl "\tSet symlink /usr/local/${_NAME} -> /usr/local/${_NAME}-${_VERSION} .." + if [ -L /usr/local/${_NAME} ];then + rm -f /usr/local/${_NAME} + fi + + ln -s ${_NAME}-${_VERSION} /usr/local/${_NAME} > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + fi + +fi + ## - Set Symlink ## - /usr/include/x86_64-linux-gnu/gmp.h -> /usr/include/gmp.h @@ -4028,6 +5915,376 @@ else echo_skipped fi +_patch_file="php-5.6-zlib-1.2.11.patch" +echononl "\tApply ${_patch_file}" +if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then + if [[ -f "${_srcdir}/${_patch_file}" ]] ; then + patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi + else + echo_failed + error "Can't find patchfile '${_srcdir}/${_patch_file}'" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi +else + echo_skipped +fi + +_patch_file="php-5.6-libmagic.patch" +echononl "\tApply ${_patch_file}" +if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then + if [[ -f "${_srcdir}/${_patch_file}" ]] ; then + patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi + else + echo_failed + error "Can't find patchfile '${_srcdir}/${_patch_file}'" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi +else + echo_skipped +fi + +_patch_file="php-5.6-mbfl_encoding.patch" +echononl "\tApply ${_patch_file}" +if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then + if [[ -f "${_srcdir}/${_patch_file}" ]] ; then + patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi + else + echo_failed + error "Can't find patchfile '${_srcdir}/${_patch_file}'" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi +else + echo_skipped +fi + +_patch_file="php-5.6-mbfl_put_invalid_char.patch" +echononl "\tApply ${_patch_file}" +if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then + if [[ -f "${_srcdir}/${_patch_file}" ]] ; then + patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi + else + echo_failed + error "Can't find patchfile '${_srcdir}/${_patch_file}'" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi +else + echo_skipped +fi + +_patch_file="php-5.6-session.patch" +echononl "\tApply ${_patch_file}" +if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then + if [[ -f "${_srcdir}/${_patch_file}" ]] ; then + patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi + else + echo_failed + error "Can't find patchfile '${_srcdir}/${_patch_file}'" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi +else + echo_skipped +fi + +_patch_file="php-5.6-wddx.patch" +echononl "\tApply ${_patch_file}" +if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then + if [[ -f "${_srcdir}/${_patch_file}" ]] ; then + patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi + else + echo_failed + error "Can't find patchfile '${_srcdir}/${_patch_file}'" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi +else + echo_skipped +fi + +_patch_file="php-5.6-mkstemp.patch" +echononl "\tApply ${_patch_file}" +if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then + if [[ -f "${_srcdir}/${_patch_file}" ]] ; then + patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi + else + echo_failed + error "Can't find patchfile '${_srcdir}/${_patch_file}'" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi +else + echo_skipped +fi + +_patch_file="php-5.6-reentrancy.patch" +echononl "\tApply ${_patch_file}" +if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then + if [[ -f "${_srcdir}/${_patch_file}" ]] ; then + patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi + else + echo_failed + error "Can't find patchfile '${_srcdir}/${_patch_file}'" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi +else + echo_skipped +fi + +_patch_file="php-5.6-cast.patch" +echononl "\tApply ${_patch_file}" +if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then + if [[ -f "${_srcdir}/${_patch_file}" ]] ; then + patch -d $_builddir -p0 < ${_srcdir}/${_patch_file} > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi + else + echo_failed + error "Can't find patchfile '${_srcdir}/${_patch_file}'" + + echo "" + echononl "download php source archiv yourself and continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interupted by user" + + fi +else + echo_skipped +fi + + echononl "\tChange ownership of unpacked dirextory \"php-$VERSION\"" chown -R root.root php-$VERSION > $tmp_err_msg 2>&1 if [[ $? -eq 0 ]]; then @@ -4057,16 +6314,25 @@ echononl "\tGoing to configure.." ## CXX="/usr/bin/g++-3.4" \ ## CPP="/usr/bin/cpp-3.4" \ ## CFLAGS="$_cflags" LDFLAGS="-s" \ + +#if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then +# export CFLAGS="-O2 -fno-strict-aliasing -Wno-error=incompatible-pointer-types" +#fi +if $_install_openldap ; then + export CPPFLAGS="-I/usr/local/openldap/include -I/usr/local/cyrus-sasl/include \ + -I/usr/local/openssl/include" + export LDFLAGS="-L/usr/local/openldap/lib -Wl,-rpath,/usr/local/openldap/lib \ + -L/usr/local/cyrus-sasl/lib -Wl,-rpath,/usr/local/cyrus-sasl/lib \ + -L/usr/local/openssl/lib -Wl,-rpath,/usr/local/openssl/lib" +fi + config_params=" --prefix=$PREFIX_PHP - --with-pgsql - --with-pdo-pgsql --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --enable-exif --with-zlib --with-gdbm - --with-curl --enable-dba --enable-ftp --with-gmp @@ -4087,12 +6353,13 @@ config_params=" --enable-sysvsem --enable-sysvshm --enable-pcntl - --with-ldap=shared --with-xsl --with-mhash --enable-cgi + --with-ldap=shared --with-xmlrpc" + if $_install_openssl1 ; then config_params="${config_params} --with-openssl=/usr/local/openssl" @@ -4101,6 +6368,51 @@ else --with-openssl" fi +if $_install_zlib_1_2 ; then + config_params="${config_params} + --with-zlib=/usr/local/zlib" +else + config_params="${config_params} + --with-zlib" +fi + +if $_install_pcre_845 ; then + config_params="${config_params} + --with-pcre-regex=/usr/local/pcre" +else + config_params="${config_params} + --with-pcre-regex" +fi + +if $_install_postgresql ; then + config_params="${config_params} + --with-pgsql=/usr/local/postgresql + --with-pdo-pgsql=/usr/local/postgresql" +else + config_params="${config_params} + --with-pgsql + --with-pdo-pgsql" +fi + +if $_install_curl ; then + config_params="${config_params} + --with-curl=/usr/local/curl" +else + config_params="${config_params} + --with-curl" +fi + +if (( PHP_VERSION_NUM < 704 && os_version >= 13 )); then + if $_install_openldap ; then + config_params="${config_params} + --with-ldap" + fi +else + config_params="${config_params} + --with-ldap" +fi + + #if ([[ "$PHP_MAJOR_VERSION" -eq 8 ]] && [[ "$PHP_MINOR_VERSION" -lt 4 ]]) \ # || [[ "$PHP_MAJOR_VERSION" -lt 8 ]] ; then @@ -4138,7 +6450,6 @@ if ([[ "$PHP_MAJOR_VERSION" -eq 7 ]] && [[ "$PHP_MINOR_VERSION" -gt 3 ]]) \ --with-xpm --with-webp --with-zip - --with-zlib --with-pear --with-sodium " @@ -4278,7 +6589,7 @@ fi echononl "\tGoing to compile.." -make > ${_logdir}/php-make.log 2>&1 +make -j"$(nproc)" > ${_logdir}/php-make.log 2>&1 if [ "$?" = "0" ]; then echo_ok else @@ -5790,48 +8101,48 @@ fi ## - Install uploadprogress ## ----- -echo "" >> ${_logdir}/pecl_install.log -echo "" >> ${_logdir}/pecl_install.log -echo "## -----" >> ${_logdir}/pecl_install.log -echo "## - Install uploadprogress" >> ${_logdir}/pecl_install.log -echo "## -----" >> ${_logdir}/pecl_install.log -echo "" >> ${_logdir}/pecl_install.log - -echononl "\tInstall uploadprogress via pecl.." -echo "" >> ${_logdir}/pecl_install.log -echo "printf \"\\n\" | ${PREFIX_PHP}/bin/pecl install uploadprogress" >> ${_logdir}/pecl_install.log -if [[ $PHP_MAJOR_VERSION -lt 7 ]] ; then - printf "\n" | ${PREFIX_PHP}/bin/pecl install uploadprogress >> "${_logdir}/pecl_install.log" 2>&1 - if [ "$?" = "0" ]; then - echo_ok - - echononl "\tphp.ini: extension=uploadprogress .." - zend_extension_uploadprogress=`find ${PREFIX_PHP}/lib/php/extensions -name uploadprogress.so -print` - if [[ -n "$zend_extension_uploadprogress" ]]; then - _extension="uploadprogress.so" - echo "" >> ${_logdir}/pecl_install.log - echo "# php.ini: extension=uploadprogress" >> ${_logdir}/pecl_install.log - echo "perl -i -n -p -e \"s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#\" $PHP_INI_FILE" >> ${_logdir}/pecl_install.log - perl -i -n -p -e "s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#" $PHP_INI_FILE - if [ "$?" = "0" ]; then - echo_ok - else - echo_failed - error "See log file: ${_logdir}/pecl_install.log" - fi - else - echo_skipped - warn "Maybe extension \"uploadprogress.so\" is not supported!" - fi - - else - echo_failed - fi -else - echo_skipped - warn "Pecl extension 'uploadprogress' is only available for PHP versions < 7 - version 7 also excluded." - echo "# Pecl extension 'uploadprogress' is only available for PHP versions < 7" >> ${_logdir}/pecl_install.log -fi +#echo "" >> ${_logdir}/pecl_install.log +#echo "" >> ${_logdir}/pecl_install.log +#echo "## -----" >> ${_logdir}/pecl_install.log +#echo "## - Install uploadprogress" >> ${_logdir}/pecl_install.log +#echo "## -----" >> ${_logdir}/pecl_install.log +#echo "" >> ${_logdir}/pecl_install.log +# +#echononl "\tInstall uploadprogress via pecl.." +#echo "" >> ${_logdir}/pecl_install.log +#echo "printf \"\\n\" | ${PREFIX_PHP}/bin/pecl install uploadprogress" >> ${_logdir}/pecl_install.log +#if [[ $PHP_MAJOR_VERSION -lt 7 ]] ; then +# printf "\n" | ${PREFIX_PHP}/bin/pecl install uploadprogress >> "${_logdir}/pecl_install.log" 2>&1 +# if [ "$?" = "0" ]; then +# echo_ok +# +# echononl "\tphp.ini: extension=uploadprogress .." +# zend_extension_uploadprogress=`find ${PREFIX_PHP}/lib/php/extensions -name uploadprogress.so -print` +# if [[ -n "$zend_extension_uploadprogress" ]]; then +# _extension="uploadprogress.so" +# echo "" >> ${_logdir}/pecl_install.log +# echo "# php.ini: extension=uploadprogress" >> ${_logdir}/pecl_install.log +# echo "perl -i -n -p -e \"s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#\" $PHP_INI_FILE" >> ${_logdir}/pecl_install.log +# perl -i -n -p -e "s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#" $PHP_INI_FILE +# if [ "$?" = "0" ]; then +# echo_ok +# else +# echo_failed +# error "See log file: ${_logdir}/pecl_install.log" +# fi +# else +# echo_skipped +# warn "Maybe extension \"uploadprogress.so\" is not supported!" +# fi +# +# else +# echo_failed +# fi +#else +# echo_skipped +# warn "Pecl extension 'uploadprogress' is only available for PHP versions < 7 - version 7 also excluded." +# echo "# Pecl extension 'uploadprogress' is only available for PHP versions < 7" >> ${_logdir}/pecl_install.log +#fi ## ----- ## - END: Install uploadprogress