Browse Source

Add imap and support deepin

lj2007331@gmail.com 6 years ago
parent
commit
e3138f9aa6

+ 29 - 5
addons.sh

@@ -168,7 +168,7 @@ What Are You Doing?
 \t${CMSG} 1${CEND}. Install/Uninstall PHP opcode cache
 \t${CMSG} 2${CEND}. Install/Uninstall ZendGuardLoader/ionCube PHP Extension
 \t${CMSG} 3${CEND}. Install/Uninstall ImageMagick/GraphicsMagick PHP Extension
-\t${CMSG} 4${CEND}. Install/Uninstall fileinfo PHP Extension
+\t${CMSG} 4${CEND}. Install/Uninstall fileinfo/imap PHP Extension
 \t${CMSG} 5${CEND}. Install/Uninstall memcached/memcache
 \t${CMSG} 6${CEND}. Install/Uninstall Redis
 \t${CMSG} 7${CEND}. Install/Uninstall swoole PHP Extension
@@ -338,19 +338,43 @@ What Are You Doing?
         ;;
       4)
         ACTION_FUN
-        PHP_extension=fileinfo
+        while :; do echo
+          echo "Please select fileinfo/imap:"
+          echo -e "\t${CMSG}1${CEND}. fileinfo"
+          echo -e "\t${CMSG}2${CEND}. imap"
+          read -p "Please input a number:(Default 1 press Enter) " phpext_option
+          [ -z "${phpext_option}" ] && phpext_option=1
+          if [[ ! "${phpext_option}" =~ ^[1,2]$ ]]; then
+            echo "${CWARNING}input error! Please only input number 1~2${CEND}"
+          else
+            if [ "${phpext_option}" = '1' ]; then
+              PHP_extension=fileinfo
+            elif [ "${phpext_option}" = '2' ]; then
+              PHP_extension=imap
+              IMAP_ARGS='--with-kerberos --with-imap --with-imap-ssl'
+              if [ "$OS" == 'CentOS' ]; then
+                yum -y install libc-client-devel
+                [ -a "${OS_BIT}" == '64' -a ! -e /usr/lib/libc-client.so ] && ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+              else
+                apt-get -y install libc-client2007e-dev
+              fi
+            fi
+            break
+          fi
+        done
+
         if [ "${ACTION}" = '1' ]; then
           Check_PHP_Extension
           pushd ${oneinstack_dir}/src > /dev/null
           src_url=http://www.php.net/distributions/php-${PHP_detail_ver}.tar.gz && Download_src
           tar xzf php-${PHP_detail_ver}.tar.gz
-          pushd php-${PHP_detail_ver}/ext/fileinfo
+          pushd php-${PHP_detail_ver}/ext/${PHP_extension}
           ${php_install_dir}/bin/phpize
-          ./configure --with-php-config=${php_install_dir}/bin/php-config
+          ./configure --with-php-config=${php_install_dir}/bin/php-config ${IMAP_ARGS}
           make -j ${THREAD} && make install
           popd;popd
           rm -rf php-${PHP_detail_ver}
-          echo "extension=fileinfo.so" > ${php_install_dir}/etc/php.d/04-fileinfo.ini
+          echo "extension=${PHP_extension}.so" > ${php_install_dir}/etc/php.d/04-${PHP_extension}.ini
           Check_succ
         else
           Uninstall_succ

+ 5 - 8
include/check_download.sh

@@ -672,14 +672,11 @@ checkDownload() {
     esac
   fi
 
-  if [ "${db_option}" == '13' ]; then
-    if [[ "${php_option}" =~ ^[1-2]$ ]]; then
-      echo "Download pecl mongo for php..."
-      src_url=https://pecl.php.net/get/mongo-${mongo_pecl_ver}.tgz && Download_src
-    else
-      echo "Download pecl mongodb for php..."
-      src_url=https://pecl.php.net/get/mongodb-${mongodb_pecl_ver}.tgz && Download_src
-    fi
+  if [ -e "${mongo_install_dir}/bin/mongo" -o "${db_option}" == '14' ]; then
+    echo "Download pecl mongo for php..."
+    src_url=https://pecl.php.net/get/mongo-${mongo_pecl_ver}.tgz && Download_src
+    echo "Download pecl mongodb for php..."
+    src_url=https://pecl.php.net/get/mongodb-${mongodb_pecl_ver}.tgz && Download_src
   fi
 
   if [ "${ioncube_yn}" == 'y' ]; then

+ 2 - 2
include/check_os.sh

@@ -23,9 +23,9 @@ elif [ -n "$(grep 'bian' /etc/issue)" -o "$(lsb_release -is 2>/dev/null)" == "De
 elif [ -n "$(grep 'Deepin' /etc/issue)" -o "$(lsb_release -is 2>/dev/null)" == "Deepin" ]; then
   OS=Debian
   [ ! -e "$(which lsb_release)" ] && { apt-get -y update; apt-get -y install lsb-release; clear; }
-  Debian_ver=$(lsb_release -sr | awk -F. '{print $1}')
-# kali rolling
+  Debian_ver=8
 elif [ -n "$(grep 'Kali GNU/Linux Rolling' /etc/issue)" -o "$(lsb_release -is 2>/dev/null)" == "Kali" ]; then
+  # kali rolling
   OS=Debian
   [ ! -e "$(which lsb_release)" ] && { apt-get -y update; apt-get -y install lsb-release; clear; }
   if [ -n "$(grep 'VERSION="2016.*"' /etc/os-release)" ]; then

+ 2 - 2
include/check_sw.sh

@@ -68,7 +68,7 @@ installDepsCentOS() {
   echo "${CMSG}Installing dependencies packages...${CEND}"
   yum check-update
   # Install needed packages
-  pkgList="deltarpm gcc gcc-c++ make cmake autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel krb5-devel libc-client libc-client-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel libaio numactl numactl-libs readline-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel libxslt-devel libicu-devel libevent-devel libtool libtool-ltdl bison gd-devel vim-enhanced pcre-devel zip unzip ntpdate sqlite-devel sysstat patch bc expect expat-devel rsync rsyslog git lsof lrzsz wget"
+  pkgList="deltarpm gcc gcc-c++ make cmake autoconf libjpeg libjpeg-devel libjpeg-turbo libjpeg-turbo-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel krb5-devel libc-client libc-client-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel libaio numactl numactl-libs readline-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel libxslt-devel libicu-devel libevent-devel libtool libtool-ltdl bison gd-devel vim-enhanced pcre-devel zip unzip ntpdate sqlite-devel sysstat patch bc expect expat-devel rsync rsyslog git lsof lrzsz psmisc wget"
   for Package in ${pkgList}; do
     yum -y install ${Package}
   done
@@ -100,7 +100,7 @@ installDepsUbuntu() {
   apt-get -y upgrade -o Dir::Etc::SourceList=/tmp/security.sources.list
 
   # Install needed packages
-  pkgList="gcc g++ make cmake autoconf libjpeg8 libjpeg8-dev libpng12-0 libpng12-dev libpng3 libfreetype6 libfreetype6-dev libxml2 libxml2-dev zlib1g zlib1g-dev libc6 libc6-dev libc-client2007e-dev libglib2.0-0 libglib2.0-dev bzip2 libzip-dev libbz2-1.0 libncurses5 libncurses5-dev libaio1 libaio-dev numactl libreadline-dev curl libcurl3 libcurl4-openssl-dev e2fsprogs libkrb5-3 libkrb5-dev libltdl-dev libidn11 libidn11-dev openssl libssl-dev libtool libevent-dev re2c libsasl2-dev libxslt1-dev libicu-dev libsqlite3-dev patch vim zip unzip tmux htop bc dc expect libexpat1-dev iptables rsyslog rsync git lsof lrzsz ntpdate wget sysv-rc"
+  pkgList="gcc g++ make cmake autoconf libjpeg8 libjpeg8-dev libpng12-0 libpng12-dev libpng3 libfreetype6 libfreetype6-dev libxml2 libxml2-dev zlib1g zlib1g-dev libc6 libc6-dev libc-client2007e-dev libglib2.0-0 libglib2.0-dev bzip2 libzip-dev libbz2-1.0 libncurses5 libncurses5-dev libaio1 libaio-dev numactl libreadline-dev curl libcurl3 libcurl4-openssl-dev e2fsprogs libkrb5-3 libkrb5-dev libltdl-dev libidn11 libidn11-dev openssl libssl-dev libtool libevent-dev re2c libsasl2-dev libxslt1-dev libicu-dev libsqlite3-dev patch vim zip unzip tmux htop bc dc expect libexpat1-dev iptables rsyslog rsync git lsof lrzsz ntpdate psmisc wget sysv-rc"
   for Package in ${pkgList}; do
     apt-get -y install ${Package} --force-yes
   done

+ 1 - 1
include/mysql-8.0.sh

@@ -35,7 +35,6 @@ Install_MySQL80() {
     -DENABLE_DTRACE=0 \
     -DENABLED_LOCAL_INFILE=1 \
     -DDEFAULT_CHARSET=utf8mb4 \
-    -DDEFAULT_COLLATION=utf8mb4_general_ci \
     -DEXTRA_CHARSETS=all
     make -j ${THREAD}
     make install
@@ -90,6 +89,7 @@ server-id = 1
 
 init-connect = 'SET NAMES utf8mb4'
 character-set-server = utf8mb4
+collation-server = utf8mb4_0900_ai_ci
 
 skip-name-resolve
 #skip-networking

+ 10 - 1
include/php-5.3.sh

@@ -53,7 +53,16 @@ Install_PHP53() {
 
   [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
-  [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
+
+  if [ "$OS" == 'CentOS' ]; then
+    ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
+    if [ "${OS_BIT}" == '64' ]; then
+      ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
+      ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+    else
+      ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+    fi
+  fi
 
   [ ! -e '/usr/include/freetype2/freetype' ] &&  ln -s /usr/include/freetype2 /usr/include/freetype2/freetype
 

+ 10 - 1
include/php-5.4.sh

@@ -53,7 +53,16 @@ Install_PHP54() {
 
   [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
-  [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
+
+  if [ "$OS" == 'CentOS' ]; then
+    ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
+    if [ "${OS_BIT}" == '64' ]; then
+      ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
+      ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+    else
+      ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+    fi
+  fi
 
   tar xzf mcrypt-$mcrypt_ver.tar.gz
   pushd mcrypt-$mcrypt_ver

+ 10 - 1
include/php-5.5.sh

@@ -53,7 +53,16 @@ Install_PHP55() {
 
   [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
-  [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
+
+  if [ "$OS" == 'CentOS' ]; then
+    ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
+    if [ "${OS_BIT}" == '64' ]; then
+      ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
+      ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+    else
+      ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+    fi
+  fi
 
   tar xzf mcrypt-$mcrypt_ver.tar.gz
   pushd mcrypt-$mcrypt_ver

+ 10 - 1
include/php-5.6.sh

@@ -53,7 +53,16 @@ Install_PHP56() {
 
   [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
-  [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
+
+  if [ "$OS" == 'CentOS' ]; then
+    ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
+    if [ "${OS_BIT}" == '64' ]; then
+      ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
+      ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+    else
+      ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+    fi
+  fi
 
   tar xzf mcrypt-$mcrypt_ver.tar.gz
   pushd mcrypt-$mcrypt_ver

+ 10 - 1
include/php-7.0.sh

@@ -53,7 +53,16 @@ Install_PHP70() {
 
   [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
-  [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
+
+  if [ "$OS" == 'CentOS' ]; then
+    ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
+    if [ "${OS_BIT}" == '64' ]; then
+      ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
+      ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+    else
+      ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+    fi
+  fi
 
   tar xzf mcrypt-$mcrypt_ver.tar.gz
   pushd mcrypt-$mcrypt_ver

+ 10 - 1
include/php-7.1.sh

@@ -53,7 +53,16 @@ Install_PHP71() {
 
   [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
-  [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
+
+  if [ "$OS" == 'CentOS' ]; then
+    ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
+    if [ "${OS_BIT}" == '64' ]; then
+      ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
+      ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+    else
+      ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+    fi
+  fi
 
   tar xzf mcrypt-$mcrypt_ver.tar.gz
   pushd mcrypt-$mcrypt_ver

+ 9 - 1
include/php-7.2.sh

@@ -57,7 +57,15 @@ Install_PHP72() {
 
   [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
-  [ "$OS" == 'CentOS' ] && { [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
+
+  if [ "$OS" == 'CentOS' ]; then
+    if [ "${OS_BIT}" == '64' ]; then
+      ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
+      ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+    else
+      ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+    fi
+  fi
 
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}

+ 9 - 1
init.d/MongoDB-init-Ubuntu

@@ -55,7 +55,8 @@ NAME=mongod
 # Other configuration options are located in $CONF file. See here for more:
 # http://dochub.mongodb.org/core/configurationoptions
 CONF=/etc/mongod.conf
-PIDFILE=/var/run/$NAME.pid
+PIDFILE=/var/run/mongodb/$NAME.pid
+PIDDIR=`dirname $PIDFILE`
 ENABLE_MONGOD=yes
 
 # Include mongodb defaults if available.
@@ -125,6 +126,13 @@ running() {
 }
 
 start_server() {
+            # Make sure the default pidfile directory exists
+            if [ ! -d $PIDDIR ]; then
+              install -d -m 0755 -o $DAEMONUSER -g $DAEMONGROUP $PIDDIR
+            fi
+	    > $PIDFILE 
+	    chown $DAEMONUSER.$DAEMONGROUP $PIDFILE
+
             # Recommended ulimit values for mongod or mongos
             # See http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
             #

+ 2 - 2
install.sh

@@ -833,13 +833,13 @@ case "${php_option}" in
 esac
 
 # pecl_pgsql
-if [ "${db_option}" == '13' -a -e "${php_install_dir}/bin/phpize" ]; then
+if [ -e "${pgsql_install_dir}/bin/psql" -a -e "${php_install_dir}/bin/phpize" ]; then
   . include/pecl_pgsql.sh
   Install_pecl-pgsql 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 
 # pecl_mongodb
-if [ "${db_option}" == '14' -a -e "${php_install_dir}/bin/phpize" ]; then
+if [ -e "${mongo_install_dir}/bin/mongo" -a -e "${php_install_dir}/bin/phpize" ]; then
   . include/pecl_mongodb.sh
   Install_pecl-mongodb 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi

+ 5 - 5
versions.txt

@@ -79,7 +79,7 @@ pureftpd_ver=1.0.47
 
 # Redis
 redis_ver=4.0.9
-redis_pecl_ver=4.0.1
+redis_pecl_ver=4.0.2
 
 # Memcached
 memcached_ver=1.5.7
@@ -89,7 +89,7 @@ memcached_pecl_php7_ver=3.0.4
 memcache_pecl_ver=3.0.8
 
 # MongoDB
-mongodb_pecl_ver=1.4.2
+mongodb_pecl_ver=1.4.3
 mongo_pecl_ver=1.6.16
 
 # phpMyadmin
@@ -108,7 +108,7 @@ libevent_ver=2.0.22-stable
 tmux_ver=2.6
 htop_ver=2.1.0
 bison_ver=2.7.1
-python_ver=2.7.14
-setuptools_ver=39.0.1
-pip_ver=10.0.0
+python_ver=2.7.15
+setuptools_ver=39.1.0
+pip_ver=10.0.1
 fail2ban_ver=0.10.3.1