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

31 lines
1.1 KiB
Bash
Raw Normal View History

2022-12-19 22:18:21 -05: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-12-19 22:18:21 -05: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
VERSION=1.0.18
#----------------------------- libsodium start -------------------------#
2022-12-24 09:29:33 -05:00
if [ ! -f /usr/local/lib/libsodium.so ];then
2022-12-19 22:18:21 -05:00
cd ${SOURCE_ROOT}
if [ ! -f ${SOURCE_ROOT}/libsodium-${VERSION}-stable.tar.gz ];then
# wget --no-check-certificate -O libsodium-1.0.18-stable.tar.gz https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable.tar.gz -T 20
wget --no-check-certificate -O libsodium-${VERSION}-stable.tar.gz https://download.libsodium.org/libsodium/releases/libsodium-${VERSION}-stable.tar.gz -T 20
fi
tar -zxvf libsodium-${VERSION}-stable.tar.gz
cd libsodium-stable
2023-10-19 12:49:46 -04:00
./configure && make && make check && make install
2023-10-30 14:08:29 -04:00
cd $SOURCE_ROOT && rm -rf $SOURCE_ROOT/libsodium-stable
2022-12-19 22:18:21 -05:00
fi
#----------------------------- libsodium end -------------------------#