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

37 lines
1.1 KiB
Bash
Raw Permalink Normal View History

2022-07-14 08:45:11 -04:00
#!/bin/bash
2023-11-08 12:32:59 -05:00
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
2022-07-14 08:45:11 -04:00
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
2024-02-08 03:46:43 -05:00
HTTP_PREFIX="https://mirror.ghproxy.com/"
2022-12-19 07:28:12 -05:00
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
2023-10-30 14:08:29 -04:00
fi
if [ ! -d cd ${SOURCE_ROOT}/oniguruma-6.9.4 ];then
cd ${SOURCE_ROOT} && tar -zxvf oniguruma-6.9.4.tar.gz
fi
2022-07-14 08:46:33 -04:00
cd ${SOURCE_ROOT}/oniguruma-6.9.4 && ./autogen.sh && ./configure --prefix=/usr && make && make install
2023-10-30 14:08:29 -04:00
cd $SOURCE_ROOT && rm -rf $SOURCE_ROOT/oniguruma-6.9.4
2022-07-14 08:45:11 -04:00
fi