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/libzip.sh

48 lines
1.3 KiB

#!/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
2 years ago
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
3 years ago
if [ ! -d ${SERVER_ROOT}/libzip ];then
2 years ago
# cd $SOURCE_ROOT
# if [ ! -f ${SOURCE_ROOT}/libzip-1.3.2.tar.gz ];then
# wget --no-check-certificate -O libzip-1.3.2.tar.gz --no-check-certificate https://nih.at/libzip/libzip-1.3.2.tar.gz -T 20
# fi
# tar -zxvf libzip-1.3.2.tar.gz
# cd libzip-1.3.2
# ./configure --prefix=${SERVER_ROOT}/libzip && make && make install
#cd $SOURCE_ROOT
#rm -rf libzip-1.3.2
#rm -rf libzip-1.3.2.tar.gz
cd $SOURCE_ROOT
2 years ago
if [ ! -f ${SOURCE_ROOT}/libzip-1.6.1.tar.gz ];then
wget --no-check-certificate -O libzip-1.6.1.tar.gz ${HTTP_PREFIX}github.com/nih-at/libzip/releases/download/rel-1-6-1/libzip-1.6.1.tar.gz -T 20
fi
2 years ago
tar -zxvf libzip-1.6.1.tar.gz
2 years ago
cd ${SOURCE_ROOT}/libzip-1.6.1
2 years ago
cmake -DCMAKE_INSTALL_PREFIX=${SERVER_ROOT}/libzip && make && make install
fi