diff --git a/plugins/php/versions/73/install.sh b/plugins/php/versions/73/install.sh index d330efe35..ac95a3175 100755 --- a/plugins/php/versions/73/install.sh +++ b/plugins/php/versions/73/install.sh @@ -10,6 +10,10 @@ sourcePath=${serverPath}/source sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl +function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; } +function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" == "$1"; } +function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; } +function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; } version=7.3.33 PHP_VER=73 @@ -49,6 +53,12 @@ if [ "$IS_64BIT" == "64" ];then OPTIONS="${OPTIONS} --with-libdir=lib64" fi +ZIP_OPTION='--enable-zip' +libzip_version=`pkg-config libzip --modversion` +if version_lt "$libzip_version" "0.11.0" ;then + export PKG_CONFIG_PATH=$serverPath/lib/libzip/lib/pkgconfig + ZIP_OPTION="--with-libzip=$serverPath/lib/libzip" +fi if [ ! -d $serverPath/php/73 ];then cd $sourcePath/php/php${PHP_VER} && ./configure \ diff --git a/plugins/php/versions/74/install.sh b/plugins/php/versions/74/install.sh index da851c24a..9e93d2370 100755 --- a/plugins/php/versions/74/install.sh +++ b/plugins/php/versions/74/install.sh @@ -11,6 +11,11 @@ sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl +function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; } +function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" == "$1"; } +function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; } +function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; } + version=7.4.26 PHP_VER=74 Install_php() @@ -50,9 +55,7 @@ if [ $sysName == 'Darwin' ]; then export LDFLAGS="-L/usr/local/opt/libxml2/lib" else OPTIONS='--without-iconv' - # OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-curl" - # OPTIONS="${OPTIONS} --with-zip=${serverPath}/lib/libzip" fi IS_64BIT=`getconf LONG_BIT` @@ -64,9 +67,9 @@ echo "$sourcePath/php/php${PHP_VER}" ZIP_OPTION='--with-zip' libzip_version=`pkg-config libzip --modversion` -compare_ver=`echo "${libzip_version} >= 0.11"|bc` -if [ "$compare_ver" -eq "1" ];then - ZIP_OPTION="--with-zip=${serverPath}/lib/libzip" +if version_lt "$libzip_version" "0.11.0" ;then + export PKG_CONFIG_PATH=$serverPath/lib/libzip/lib/pkgconfig + ZIP_OPTION="--with-zip=$serverPath/lib/libzip" fi diff --git a/plugins/php/versions/80/install.sh b/plugins/php/versions/80/install.sh index 300b3654a..3d075717b 100755 --- a/plugins/php/versions/80/install.sh +++ b/plugins/php/versions/80/install.sh @@ -10,6 +10,11 @@ sourcePath=${serverPath}/source sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl +function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; } +function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" == "$1"; } +function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; } +function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; } + version=8.0.21 PHP_VER=80 @@ -55,6 +60,13 @@ if [ "$IS_64BIT" == "64" ];then OPTIONS="${OPTIONS} --with-libdir=lib64" fi +ZIP_OPTION='--with-zip' +libzip_version=`pkg-config libzip --modversion` +if version_lt "$libzip_version" "0.11.0" ;then + export PKG_CONFIG_PATH=$serverPath/lib/libzip/lib/pkgconfig + ZIP_OPTION="--with-zip=$serverPath/lib/libzip" +fi + echo "$sourcePath/php/php${PHP_VER}" if [ ! -d $serverPath/php/${PHP_VER} ];then @@ -68,7 +80,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-zlib-dir=$serverPath/lib/zlib \ - --with-zip \ + $ZIP_OPTION \ --enable-ftp \ --enable-mbstring \ --enable-sockets \ diff --git a/plugins/php/versions/81/install.sh b/plugins/php/versions/81/install.sh index f677d84f0..0316cc29b 100755 --- a/plugins/php/versions/81/install.sh +++ b/plugins/php/versions/81/install.sh @@ -10,6 +10,11 @@ sourcePath=${serverPath}/source sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl +function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; } +function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" == "$1"; } +function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; } +function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; } + version=8.1.8 PHP_VER=81 @@ -49,6 +54,13 @@ else OPTIONS="${OPTIONS} --with-curl" fi +ZIP_OPTION='--with-zip' +libzip_version=`pkg-config libzip --modversion` +if version_lt "$libzip_version" "0.11.0" ;then + export PKG_CONFIG_PATH=$serverPath/lib/libzip/lib/pkgconfig + ZIP_OPTION="--with-zip=$serverPath/lib/libzip" +fi + echo "$sourcePath/php/php${PHP_VER}" @@ -63,7 +75,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-zlib-dir=$serverPath/lib/zlib \ - --with-zip \ + $ZIP_OPTION \ --enable-ftp \ --enable-mbstring \ --enable-sockets \ diff --git a/plugins/php/versions/82/install.sh b/plugins/php/versions/82/install.sh index 33d3c6fad..c18779c45 100755 --- a/plugins/php/versions/82/install.sh +++ b/plugins/php/versions/82/install.sh @@ -10,6 +10,11 @@ sourcePath=${serverPath}/source sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl +function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; } +function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" == "$1"; } +function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; } +function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; } + version=8.2.0alpha2 PHP_VER=82 @@ -50,6 +55,14 @@ if [ "$IS_64BIT" == "64" ];then OPTIONS="${OPTIONS} --with-libdir=lib64" fi +ZIP_OPTION='--with-zip' +libzip_version=`pkg-config libzip --modversion` +if version_lt "$libzip_version" "0.11.0" ;then + export PKG_CONFIG_PATH=$serverPath/lib/libzip/lib/pkgconfig + ZIP_OPTION="--with-zip=$serverPath/lib/libzip" +fi + + echo "$sourcePath/php/php${PHP_VER}" if [ ! -d $serverPath/php/${PHP_VER} ];then @@ -63,7 +76,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-zlib-dir=$serverPath/lib/zlib \ - --with-zip \ + $ZIP_OPTION \ --enable-mbstring \ --enable-ftp \ --enable-sockets \