From 2536a794817412d3603ec9e97dca249632a227eb Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 19 Dec 2022 20:28:12 +0800 Subject: [PATCH] update --- plugins/php/lib/icu.sh | 8 +++++++- plugins/php/lib/libiconv.sh | 8 +++++++- plugins/php/lib/oniguruma.sh | 8 +++++++- plugins/php/lib/openssl_10.sh | 8 +++++++- plugins/php/lib/zlib.sh | 8 +++++++- 5 files changed, 35 insertions(+), 5 deletions(-) diff --git a/plugins/php/lib/icu.sh b/plugins/php/lib/icu.sh index f9d0c1a3f..c805e4a75 100644 --- a/plugins/php/lib/icu.sh +++ b/plugins/php/lib/icu.sh @@ -13,10 +13,16 @@ rootPath=$(dirname "$rootPath") SERVER_ROOT=$rootPath/lib SOURCE_ROOT=$rootPath/source/lib +cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") +HTTP_PREFIX="https://" +if [ ! -z "$cn" ];then + HTTP_PREFIX="https://ghproxy.com/" +fi + if [ ! -d ${SERVER_ROOT}/icu ];then if [ ! -f ${SOURCE_ROOT}/icu4c-52_2-src.tgz ];then - wget -O ${SOURCE_ROOT}/icu4c-52_2-src.tgz https://github.com/unicode-org/icu/releases/download/release-52-2/icu4c-52_2-src.tgz + wget -O ${SOURCE_ROOT}/icu4c-52_2-src.tgz ${HTTP_PREFIX}github.com/unicode-org/icu/releases/download/release-52-2/icu4c-52_2-src.tgz fi if [ ! -d ${SERVER_ROOT}/icu/52.2 ];then diff --git a/plugins/php/lib/libiconv.sh b/plugins/php/lib/libiconv.sh index c9f57fa88..8ad47a112 100644 --- a/plugins/php/lib/libiconv.sh +++ b/plugins/php/lib/libiconv.sh @@ -13,9 +13,15 @@ rootPath=$(dirname "$rootPath") SERVER_ROOT=$rootPath/lib SOURCE_ROOT=$rootPath/source/lib +cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") +HTTP_PREFIX="https://" +if [ ! -z "$cn" ];then + HTTP_PREFIX="https://ghproxy.com/" +fi + if [ ! -d ${SERVER_ROOT}/libiconv ];then cd $SOURCE_ROOT - wget -O libiconv-1.15.tar.gz https://github.com/midoks/mdserver-web/releases/download/init/libiconv-1.15.tar.gz -T 5 + wget -O libiconv-1.15.tar.gz ${HTTP_PREFIX}github.com/midoks/mdserver-web/releases/download/init/libiconv-1.15.tar.gz -T 5 tar zxvf libiconv-1.15.tar.gz cd libiconv-1.15 ./configure --prefix=${SERVER_ROOT}/libiconv --enable-static && make && make install diff --git a/plugins/php/lib/oniguruma.sh b/plugins/php/lib/oniguruma.sh index 9168410e9..401950c7b 100644 --- a/plugins/php/lib/oniguruma.sh +++ b/plugins/php/lib/oniguruma.sh @@ -13,11 +13,17 @@ rootPath=$(dirname "$rootPath") SERVER_ROOT=$rootPath/lib SOURCE_ROOT=$rootPath/source/lib +cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") +HTTP_PREFIX="https://" +if [ ! -z "$cn" ];then + HTTP_PREFIX="https://ghproxy.com/" +fi + which onig-config if [ "$?" != "0" ];then cd ${SOURCE_ROOT} if [ ! -f ${SOURCE_ROOT}/oniguruma-6.9.4.tar.gz ];then - wget -O ${SOURCE_ROOT}/oniguruma-6.9.4.tar.gz https://github.com/kkos/oniguruma/archive/v6.9.4.tar.gz + wget -O ${SOURCE_ROOT}/oniguruma-6.9.4.tar.gz ${HTTP_PREFIX}github.com/kkos/oniguruma/archive/v6.9.4.tar.gz fi cd ${SOURCE_ROOT} && tar -zxvf oniguruma-6.9.4.tar.gz cd ${SOURCE_ROOT}/oniguruma-6.9.4 && ./autogen.sh && ./configure --prefix=/usr && make && make install diff --git a/plugins/php/lib/openssl_10.sh b/plugins/php/lib/openssl_10.sh index 90c1155e3..c0a6280e2 100644 --- a/plugins/php/lib/openssl_10.sh +++ b/plugins/php/lib/openssl_10.sh @@ -13,10 +13,16 @@ rootPath=$(dirname "$rootPath") SERVER_ROOT=$rootPath/lib SOURCE_ROOT=$rootPath/source/lib +cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") +HTTP_PREFIX="https://" +if [ ! -z "$cn" ];then + HTTP_PREFIX="https://ghproxy.com/" +fi + if [ ! -d ${SERVER_ROOT}/openssl10 ];then cd ${SOURCE_ROOT} if [ ! -f ${SOURCE_ROOT}/openssl-1.0.2q.tar.gz ];then - wget https://github.com/midoks/mdserver-web/releases/download/init/openssl-1.0.2q.tar.gz -T 20 + wget ${HTTP_PREFIX}github.com/midoks/mdserver-web/releases/download/init/openssl-1.0.2q.tar.gz -T 20 fi tar -zxf openssl-1.0.2q.tar.gz cd openssl-1.0.2q diff --git a/plugins/php/lib/zlib.sh b/plugins/php/lib/zlib.sh index ab6b4c50a..44043a45f 100644 --- a/plugins/php/lib/zlib.sh +++ b/plugins/php/lib/zlib.sh @@ -13,11 +13,17 @@ rootPath=$(dirname "$rootPath") SERVER_ROOT=$rootPath/lib SOURCE_ROOT=$rootPath/source/lib +cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") +HTTP_PREFIX="https://" +if [ ! -z "$cn" ];then + HTTP_PREFIX="https://ghproxy.com/" +fi + if [ ! -d ${SERVER_ROOT}/zlib ];then cd $SOURCE_ROOT if [ ! -f ${SOURCE_ROOT}/zlib-1.2.11.tar.gz ];then - wget -O zlib-1.2.11.tar.gz --no-check-certificate https://github.com/madler/zlib/archive/v1.2.11.tar.gz -T 20 + wget -O zlib-1.2.11.tar.gz --no-check-certificate ${HTTP_PREFIX}github.com/madler/zlib/archive/v1.2.11.tar.gz -T 20 fi tar -zxvf zlib-1.2.11.tar.gz