mdserver-web/plugins/php/lib/oniguruma.sh

32 lines
939 B
Bash
Raw Normal View History

2022-07-14 08:45:11 -04:00
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
# echo $rootPath
SERVER_ROOT=$rootPath/lib
SOURCE_ROOT=$rootPath/source/lib
2022-12-19 07:28:12 -05:00
HTTP_PREFIX="https://"
2023-09-09 00:13:16 -04:00
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
2023-09-15 01:28:19 -04:00
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
2022-12-19 07:28:12 -05:00
HTTP_PREFIX="https://ghproxy.com/"
fi
2022-07-14 08:45:11 -04:00
which onig-config
if [ "$?" != "0" ];then
cd ${SOURCE_ROOT}
if [ ! -f ${SOURCE_ROOT}/oniguruma-6.9.4.tar.gz ];then
2022-12-19 22:18:21 -05:00
wget --no-check-certificate -O ${SOURCE_ROOT}/oniguruma-6.9.4.tar.gz ${HTTP_PREFIX}github.com/kkos/oniguruma/archive/v6.9.4.tar.gz
2022-07-14 08:45:11 -04:00
fi
cd ${SOURCE_ROOT} && tar -zxvf oniguruma-6.9.4.tar.gz
2022-07-14 08:46:33 -04:00
cd ${SOURCE_ROOT}/oniguruma-6.9.4 && ./autogen.sh && ./configure --prefix=/usr && make && make install
2022-07-14 08:45:11 -04:00
fi