From fe0f9eb647e0cd7093e9957de2a2630a657d283b Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 16 Jul 2022 00:11:48 +0800 Subject: [PATCH] up --- plugins/php/lib/libmcrypt.sh | 48 +++++++++++++++++++++++++++ plugins/php/versions/common/mcrypt.sh | 2 ++ scripts/install/opensuse.sh | 1 + 3 files changed, 51 insertions(+) create mode 100644 plugins/php/lib/libmcrypt.sh diff --git a/plugins/php/lib/libmcrypt.sh b/plugins/php/lib/libmcrypt.sh new file mode 100644 index 000000000..48d9d38ab --- /dev/null +++ b/plugins/php/lib/libmcrypt.sh @@ -0,0 +1,48 @@ +#!/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 + + +ISFIND="0" +SYS_DIR=(/usr/local /usr) +for S_DIR in ${SYS_DIR[@]}; do + if [ -f $S_DIR/include/mcrypt.h ];then + ISFIND="1" + fi +done + +if [ $ISFIND == "0" ];then + cd $SOURCE_ROOT + if [ ! -f ${SOURCE_ROOT}/libmcrypt-2.5.8.tar.gz ];then + wget -O libmcrypt-2.5.8.tar.gz --no-check-certificate https://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz -T 20 + fi + + tar -zxvf libmcrypt-2.5.8.tar.gz + cd libmcrypt-2.5.8 + ./configure && make && make install && make clean +fi + + +# if [ ! -d ${SERVER_ROOT}/libmcrypt ];then + +# cd $SOURCE_ROOT +# if [ ! -f ${SOURCE_ROOT}/libmcrypt-2.5.8.tar.gz ];then +# wget -O libmcrypt-2.5.8.tar.gz --no-check-certificate https://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz -T 20 +# fi + +# tar -zxvf libmcrypt-2.5.8.tar.gz +# cd libmcrypt-2.5.8 + +# ./configure --prefix=${SERVER_ROOT}/libmcrypt && make && make install +# fi \ No newline at end of file diff --git a/plugins/php/versions/common/mcrypt.sh b/plugins/php/versions/common/mcrypt.sh index 1b5d3e2f7..9efe3564c 100755 --- a/plugins/php/versions/common/mcrypt.sh +++ b/plugins/php/versions/common/mcrypt.sh @@ -45,6 +45,8 @@ Install_lib() echo "php-$version 已安装${LIBNAME},请选择其它版本!" return fi + + cd $serverPath/mdserver-web/plugins/php/lib && bash libmcrypt.sh if [ ! -f "$extFile" ];then diff --git a/scripts/install/opensuse.sh b/scripts/install/opensuse.sh index 5d4cb6e91..ba02326d1 100644 --- a/scripts/install/opensuse.sh +++ b/scripts/install/opensuse.sh @@ -43,6 +43,7 @@ zypper install -y python3-devel zypper install -y python-devel zypper install -y libwebp-devel +zypper install -y libtomcrypt zypper install -y libtomcrypt-devel zypper install -y libXpm-devel