Pārlūkot izejas kodu

Build php-fpm with openssl.

Raphael Schneeberger 7 gadi atpakaļ
vecāks
revīzija
cd38806e74
1 mainītis faili ar 64 papildinājumiem un 66 dzēšanām
  1. 64 66
      src/hst_autocompile.sh

+ 64 - 66
src/hst_autocompile.sh

@@ -24,7 +24,7 @@ ZLIB='https://www.zlib.net/zlib-'$ZLIB_V'.tar.gz'
 PHP='http://de2.php.net/distributions/php-'$PHP_V'.tar.gz'
 
 # Set package dependencies for compiling
-SOFTWARE='build-essential libxml2-dev libz-dev libcurl4-gnutls-dev unzip'
+SOFTWARE='build-essential libxml2-dev libz-dev libcurl4-gnutls-dev unzip openssl libssl-dev pkg-config'
 
 # Define a timestamp function
 timestamp() {
@@ -80,86 +80,86 @@ fi
 if [ "$NGINX_B" = true ] ; then
   # Change to build directory
   cd $BUILD_DIR
-  
+
   # Check if target directory exist
   if [ -d $BUILD_DIR/hestia-nginx_$HESTIA_V ]; then
-  	#mv $BUILD_DIR/hestia-nginx_$HESTIA_V $BUILD_DIR/hestia-nginx_$HESTIA_V-$(timestamp)
-  	rm -r $BUILD_DIR/hestia-nginx_$HESTIA_V
+        #mv $BUILD_DIR/hestia-nginx_$HESTIA_V $BUILD_DIR/hestia-nginx_$HESTIA_V-$(timestamp)
+        rm -r $BUILD_DIR/hestia-nginx_$HESTIA_V
   fi
-  
+
   # Create directory
   mkdir $BUILD_DIR/hestia-nginx_$HESTIA_V
-  
+
   # Download and unpack source files
   wget -qO- $NGINX | tar xz
   wget -qO- $OPENSSL | tar xz
   wget -qO- $PCRE | tar xz
   wget -qO- $ZLIB | tar xz
-  
+
   # Change to nginx directory
   cd nginx-$NGINX_V
-  
+
   # configure nginx
-  ./configure 	--prefix=/usr/local/hestia/nginx \
-  		--with-http_ssl_module \
-  		--with-openssl=../openssl-$OPENSSL_V \
-  		--with-openssl-opt=enable-ec_nistp_64_gcc_128 \
-  		--with-openssl-opt=no-nextprotoneg \
-  		--with-openssl-opt=no-weak-ssl-ciphers \
-  		--with-openssl-opt=no-ssl3 \
-  		--with-pcre=../pcre-$PCRE_V \
-  	        --with-pcre-jit \
-  		--with-zlib=../zlib-$ZLIB_V
-  
+  ./configure   --prefix=/usr/local/hestia/nginx \
+                --with-http_ssl_module \
+                --with-openssl=../openssl-$OPENSSL_V \
+                --with-openssl-opt=enable-ec_nistp_64_gcc_128 \
+                --with-openssl-opt=no-nextprotoneg \
+                --with-openssl-opt=no-weak-ssl-ciphers \
+                --with-openssl-opt=no-ssl3 \
+                --with-pcre=../pcre-$PCRE_V \
+                --with-pcre-jit \
+                --with-zlib=../zlib-$ZLIB_V
+
   # Check install directory and move if exists
   if [ -d $INSTALL_DIR ]; then
-  	#mv $INSTALL_DIR $INSTALL_DIR$(timestamp)
-  	rm -r $INSTALL_DIR
+        #mv $INSTALL_DIR $INSTALL_DIR$(timestamp)
+        rm -r $INSTALL_DIR
   fi
-  
+
   # Create the files and install them
   make && make install
-  
+
   # Cleare up unused files
   cd $BUILD_DIR
   rm -r nginx-$NGINX_V openssl-$OPENSSL_V pcre-$PCRE_V zlib-$ZLIB_V
-  
+
   # Prepare Deb Package Folder Structure
   cd hestia-nginx_$HESTIA_V/
   mkdir -p usr/local/hestia etc/init.d DEBIAN
-  
+
   # Download control, postinst and postrm files
   cd DEBIAN
   wget $GIT_REP/nginx/control
   wget $GIT_REP/nginx/copyright
   wget $GIT_REP/nginx/postinst
   wget $GIT_REP/nginx/postrm
-  
+
   # Set permission
   chmod +x postinst postrm
-  
+
   # Move nginx directory
   cd ..
   mv /usr/local/hestia/nginx usr/local/hestia/
-  
+
   # Get Service File
   cd etc/init.d
   wget $GIT_REP/nginx/hestia
   chmod +x hestia
-  
+
   # Get nginx.conf
   cd ../../
   rm usr/local/hestia/nginx/conf/nginx.conf
   wget $GIT_REP/nginx/nginx.conf -O usr/local/hestia/nginx/conf/nginx.conf
-  
+
   # copy binary
   cp usr/local/hestia/nginx/sbin/nginx usr/local/hestia/nginx/sbin/hestia-nginx
-  
+
   # change permission and build the package
   cd $BUILD_DIR
   chown -R  root:root hestia-nginx_$HESTIA_V
   dpkg-deb --build hestia-nginx_$HESTIA_V
-  
+
   # clear up the source folder
   rm -r hestia-nginx_$HESTIA_V
 fi
@@ -173,70 +173,68 @@ fi
 if [ "$PHP_B" = true ] ; then
   # Change to build directory
   cd $BUILD_DIR
-  
+
   # Check if target directory exist
   if [ -d $BUILD_DIR/hestia-php_$HESTIA_V ]; then
-  	#mv $BUILD_DIR/hestia-php_$HESTIA_V $BUILD_DIR/hestia-php_$HESTIA_V-$(timestamp)
-  	rm -r $BUILD_DIR/hestia-php_$HESTIA_V
+        #mv $BUILD_DIR/hestia-php_$HESTIA_V $BUILD_DIR/hestia-php_$HESTIA_V-$(timestamp)
+        rm -r $BUILD_DIR/hestia-php_$HESTIA_V
   fi
-  
+
   # Create directory
   mkdir $BUILD_DIR/hestia-php_$HESTIA_V
-  
+
   # Download and unpack source files
   wget -qO- $PHP | tar xz
-  wget -qO- $OPENSSL | tar xz
-  
+
   # Change to php directory
   cd php-$PHP_V
-  
+
   # Configure PHP
-  ./configure	--prefix=/usr/local/hestia/php \
+  ./configure   --prefix=/usr/local/hestia/php \
               --enable-fpm \
               --with-zlib \
               --with-fpm-user=admin \
               --with-fpm-group=admin \
-              --with-openssl=../openssl-$OPENSSL_V \
-              --with-mysql \
+              --with-openssl \
+              --with-libdir=lib/x86_64-linux-gnu \
               --with-mysqli \
               --with-curl \
               --enable-mbstring
-  
+
   # Create the files and install them
   make && make install
-  
+
   # Cleare up unused files
   cd $BUILD_DIR
   rm -r php-$PHP_V
-  rm -r openssl-$OPENSSL_V
-  
+
   # Prepare Deb Package Folder Structure
   cd hestia-php_$HESTIA_V/
   mkdir -p usr/local/hestia DEBIAN
-  
+
   # Download control, postinst and postrm files
   cd DEBIAN
   wget $GIT_REP/php/control
   wget $GIT_REP/php/copyright
- 
+
   # Move php directory
   cd ..
   mv /usr/local/hestia/php usr/local/hestia/
-   
+
   # Get php-fpm.conf
   wget $GIT_REP/php/php-fpm.conf -O usr/local/hestia/php/etc/php-fpm.conf
 
   # Get php.ini
-  wget $GIT_REP/php/php.ini -O usr/local/hestia/php/lib/php.ini  
+  wget $GIT_REP/php/php.ini -O usr/local/hestia/php/lib/php.ini
 
   # copy binary
   cp usr/local/hestia/php/sbin/php-fpm usr/local/hestia/php/sbin/hestia-php
-  
+
   # change permission and build the package
   cd $BUILD_DIR
   chown -R  root:root hestia-php_$HESTIA_V
   dpkg-deb --build hestia-php_$HESTIA_V
-  
+
   # clear up the source folder
   rm -r hestia-php_$HESTIA_V
 fi
@@ -250,48 +248,48 @@ fi
 if [ "$HESTIA_B" = true ] ; then
   # Change to build directory
   cd $BUILD_DIR
-  
+
   # Check if target directory exist
   if [ -d $BUILD_DIR/hestia_$HESTIA_V ]; then
-  	#mv $BUILD_DIR/hestia_$HESTIA_V $BUILD_DIR/hestia_$HESTIA_V-$(timestamp)
-  	rm -r $BUILD_DIR/hestia_$HESTIA_V
+        #mv $BUILD_DIR/hestia_$HESTIA_V $BUILD_DIR/hestia_$HESTIA_V-$(timestamp)
+        rm -r $BUILD_DIR/hestia_$HESTIA_V
   fi
-  
+
   # Create directory
   mkdir $BUILD_DIR/hestia_$HESTIA_V
-  
+
   # Download and unpack source files
   wget $HESTIA
   unzip -q master.zip
   rm master.zip
-  
+
   # Prepare Deb Package Folder Structure
   cd hestia_$HESTIA_V/
   mkdir -p usr/local/hestia DEBIAN
-  
+
   # Download control, postinst and postrm files
   cd DEBIAN
   wget $GIT_REP/hestia/control
   wget $GIT_REP/hestia/copyright
   wget $GIT_REP/hestia/postinst
-  
+
   # Set permission
   chmod +x postinst
- 
+
   # Move needed directories
   cd ../../hestiacp-master
   mv bin func install upd web ../hestia_$HESTIA_V/usr/local/hestia/
-   
+
   # Set permission
   cd ../hestia_$HESTIA_V/usr/local/hestia/bin
   chmod +x *
-  
+
   # change permission and build the package
   cd $BUILD_DIR
   chown -R root:root hestia_$HESTIA_V
   dpkg-deb --build hestia_$HESTIA_V
-  
+
   # clear up the source folder
   rm -r hestia_$HESTIA_V
   rm -r hestiacp-master
-fi
+fi