Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/plugins/php/lib/icu.sh

56 lines
1.6 KiB

3 years ago
#!/bin/bash
2 years ago
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
3 years ago
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
3 years ago
# echo $rootPath
3 years ago
3 years ago
SERVER_ROOT=$rootPath/lib
SOURCE_ROOT=$rootPath/source/lib
3 years ago
2 years ago
HTTP_PREFIX="https://"
2 years ago
LOCAL_ADDR=common
2 years ago
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
2 years ago
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
2 years ago
LOCAL_ADDR=cn
2 years ago
HTTP_PREFIX="https://ghproxy.com/"
fi
3 years ago
if [ ! -d ${SERVER_ROOT}/icu ];then
2 years ago
cd ${SOURCE_ROOT}
if [ "$LOCAL_ADDR" == 'cn' ];then
if [ ! -f ${SOURCE_ROOT}/icu4c-52_2-src.tgz ];then
wget --no-check-certificate -O ${SOURCE_ROOT}/icu4c-52_2-src.tgz https://dl.midoks.me/lib/icu4c-52_2-src.tgz -T 20
fi
fi
3 years ago
3 years ago
if [ ! -f ${SOURCE_ROOT}/icu4c-52_2-src.tgz ];then
2 years ago
wget --no-check-certificate -O ${SOURCE_ROOT}/icu4c-52_2-src.tgz https://github.com/unicode-org/icu/releases/download/release-52-2/icu4c-52_2-src.tgz
3 years ago
fi
2 years ago
if [ ! -d ${SERVER_ROOT}/lib/icu/lib ];then
3 years ago
cd ${SOURCE_ROOT} && tar -zxvf icu4c-52_2-src.tgz
3 years ago
3 years ago
cd ${SOURCE_ROOT}/icu/source
./runConfigureICU Linux --prefix=${SERVER_ROOT}/icu && make CXXFLAGS="-g -O2 -std=c++11" && make install
2 years ago
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/www/server/lib/icu/lib
if [ -d /etc/ld.so.conf.d ];then
echo "/www/server/lib/icu/lib" > /etc/ld.so.conf.d/mw-icu.conf
elif [[ -f /etc/ld.so.conf ]]; then
echo "/www/server/lib/icu/lib" >> /etc/ld.so.conf
2 years ago
fi
2 years ago
ldconfig
2 years ago
2 years ago
cd $SOURCE_ROOT && rm -rf ${SOURCE_ROOT}/icu
2 years ago
fi
3 years ago
fi