From 3b783daa1840ef2b9fe70cbd1bfc8f43dc6de341 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 27 Nov 2018 19:20:46 +0800 Subject: [PATCH] u --- plugins/csvn/install.sh | 7 ++-- plugins/php/info.json | 4 +-- plugins/php/install.sh | 2 +- plugins/php/versions/5.2/install.sh | 14 -------- plugins/php/versions/52/install.sh | 65 +++++++++++++++++++++++++++++++++++++ scripts/lib.sh | 45 ++++++++++++------------- 6 files changed, 94 insertions(+), 43 deletions(-) delete mode 100755 plugins/php/versions/5.2/install.sh create mode 100755 plugins/php/versions/52/install.sh diff --git a/plugins/csvn/install.sh b/plugins/csvn/install.sh index 6dc9025f8..2b66e8741 100755 --- a/plugins/csvn/install.sh +++ b/plugins/csvn/install.sh @@ -9,14 +9,17 @@ serverPath=$(dirname "$rootPath") install_tmp=${rootPath}/tmp/bt_install.pl + +CSVN_SOURCE='https://github.com/midoks/mdserver-web/releases/download/init/CollabNetSubversionEdge-5.1.4_linux-x86_64.tar.xz' + Install_csvn() { mkdir -p $serverPath/tmp echo '正在安装脚本文件...' > $install_tmp - if [ ! -d $serverPath/tmp/csvn.tar.xz ];then - wget -O $serverPath/tmp/csvn.tar.xz https://github.com/midoks/mdserver-web/releases/download/init/CollabNetSubversionEdge-5.1.4_linux-x86_64.tar.xz + if [ ! -f $serverPath/tmp/csvn.tar.xz ];then + wget -O $serverPath/so/csvn.tar.xz ${CSVN_SOURCE} fi cd $serverPath/tmp && tar -Jxf $serverPath/tmp/csvn.tar.xz diff --git a/plugins/php/info.json b/plugins/php/info.json index 5d84a8f01..be76b6bfe 100755 --- a/plugins/php/info.json +++ b/plugins/php/info.json @@ -5,8 +5,8 @@ "name": "php", "title": "PHP", "default": false, - "versions": ["5.2","7.2"], - "updates": ["5.2.17p1","7.2.0"], + "versions": ["52","72"], + "updates": ["5.2.17","7.2.0"], "tip": "soft", "checks": "server/php/VERSION/bin/php", "display": 1, diff --git a/plugins/php/install.sh b/plugins/php/install.sh index 40815a2a0..e25f7d9bc 100755 --- a/plugins/php/install.sh +++ b/plugins/php/install.sh @@ -23,4 +23,4 @@ if [ ! -d $curPath/versions/$2 ];then exit 0 fi -. $curPath/versions/$2/install.sh $1 +sh -x $curPath/versions/$2/install.sh $1 diff --git a/plugins/php/versions/5.2/install.sh b/plugins/php/versions/5.2/install.sh deleted file mode 100755 index 526e61f69..000000000 --- a/plugins/php/versions/5.2/install.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/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") -serverPath=$(dirname "$rootPath") - - -install_tmp=${rootPath}/tmp/bt_install.pl - -echo $curPath -echo ${1} \ No newline at end of file diff --git a/plugins/php/versions/52/install.sh b/plugins/php/versions/52/install.sh new file mode 100755 index 000000000..a3169914d --- /dev/null +++ b/plugins/php/versions/52/install.sh @@ -0,0 +1,65 @@ +#!/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") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source + +install_tmp=${rootPath}/tmp/bt_install.pl + +# echo $curPath +# echo ${1} +# echo ${serverPath} +# echo ${install_tmp} + + +Install_php() +{ +#------------------------ install start ------------------------------------# +echo "安装php-5.2.17 ..." > $install_tmp +mkdir -p $sourcePath/php +mkdir -p $serverPath/php + +if [ ! -f $sourcePath/php/php-5.2.17.tar.bz2 ];then + wget -O $sourcePath/php/php-5.2.17.tar.bz2 https://museum.php.net/php5/php-5.2.17.tar.bz2 +fi + +if [ ! -d $sourcePath/php/php-5.2.17 ];then + cd $sourcePath/php && tar -Jxf $sourcePath/php/php-5.2.17.tar.bz2 +fi + + +cd $sourcePath/php/php-5.2.17 && ./configure \ +--prefix=$serverPath/php/php52 \ +--exec-prefix=$serverPath/php/php52 \ +--with-config-file-path=$serverPath/php/php55/etc \ +--with-zlib-dir=$serverPath/lib/zlib \ +--without-iconv \ +--enable-zip \ +--enable-mbstring \ +--enable-ftp \ +--enable-wddx \ +--enable-soap \ +--enable-posix \ +--enable-fpm \ +&& make && make install + +#------------------------ install end ------------------------------------# +} + + + +Uninstall_php() +{ + echo "卸载php-5.2.17 ..." > $install_tmp +} + +action=${1} +if [ "${1}" == 'install' ];then + Install_php +else + Uninstall_php +fi diff --git a/scripts/lib.sh b/scripts/lib.sh index 02d154691..eaa021f43 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -4,31 +4,27 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin curPath=`pwd` rootPath=$(dirname "$curPath") serverPath=$(dirname "$rootPath") -tmpPath=$serverPath/tmp +sourcePath=$serverPath/source/lib libPath=$serverPath/lib +mkdir -p $sourcePath mkdir -p $libPath +rm -rf ${libPath}/lib.pl - -Install_Curl() +Install_Zlib() { - if [ -f "/usr/local/curl/newcurl.pl" ];then - return; - fi - cd ${run_path} - curl_version="7.54.1" - if [ ! -f "curl-$curl_version.tar.gz" ];then - wget -O curl-$curl_version.tar.gz ${download_Url}/src/curl-$curl_version.tar.gz -T 5 - fi - tar zxf curl-$curl_version.tar.gz - cd curl-$curl_version - ./configure --prefix=/usr/local/curl --enable-ares --without-nss --with-ssl=/usr/local/openssl - make && make install - cd .. - rm -rf curl-$curl_version - rm -rf curl-$curl_version.tar.gz - echo -e "Install_Curl" >> /www/server/lib.pl - echo -e "Ture" >> /usr/local/curl/newcurl.pl +#----------------------------- zlib start -------------------------# +if [ ! -d ${libPath}/zlib ];then + cd ${sourcePath} + if [ ! -f ${sourcePath}/zlib-1.2.11.tar.gz ];then + wget -O zlib-1.2.11.tar.gz https://github.com/madler/zlib/archive/v1.2.11.tar.gz -T 20 + fi + tar -zxf zlib-1.2.11.tar.gz + cd zlib-1.2.11 + ./configure --prefix=${libPath}/zlib && make && make install +fi +echo -e "Install_Zlib" >> ${libPath}/lib.pl +#----------------------------- zlib end -------------------------# } Install_Libiconv() @@ -175,8 +171,8 @@ Install_Pcre() Install_OpenSSL() { if [ ! -d ${libPath}/openssl ];then - cd ${tmpPath} - if [ ! -d ${tmpPath}openssl-1.0.2q.tar.gz ];then + cd ${sourcePath} + if [ ! -f ${sourcePath}openssl-1.0.2q.tar.gz ];then wget https://github.com/midoks/mdserver-web/releases/download/init/openssl-1.0.2q.tar.gz -T 20 fi tar -zxf openssl-1.0.2q.tar.gz @@ -184,7 +180,9 @@ Install_OpenSSL() ./config --openssldir=${libPath}/openssl zlib-dynamic shared make && make install fi + echo -e "Install_OpenSSL" >> ${libPath}/lib.pl } + Install_Lib() { if [ -f "/www/server/nginx/sbin/nginx" ] || [ -f "/www/server/apache/bin/httpd" ] || [ -f "/www/server/mysql/bin/mysql" ]; then @@ -207,11 +205,10 @@ if [ ! -f "${lockFile}" ];then fi } - +Install_Zlib # Install_Lib Install_OpenSSL # Install_Pcre -# Install_Curl # Install_Mhash # Install_Libmcrypt # Install_Mcrypt