33# set -e
44# Autocompile Script for HestiaCP package Files.
55# For building from local source folder use "~localsrc" keyword as hesia branch name,
6- # and the script will not try to download the arhive from github, since '~' char is
6+ # and the script will not try to download the arhive from github, since '~' char is
77# not accepted in branch name.
88# Compile but dont install -> ./hst_autocompile.sh --hestia --noinstall --keepbuild '~localsrc'
9- # Compile and install -> ./hst_autocompile.sh --hestia --install '~localsrc'
9+ # Compile and install -> ./hst_autocompile.sh --hestia --install '~localsrc'
1010
1111# Clear previous screen output
1212clear
131131fi
132132
133133# Set packages to compile
134- for i in $* ; do
134+ for i in $* ; do
135135 case " $i " in
136136 --all)
137137 NGINX_B=' true'
@@ -190,7 +190,7 @@ if [ -z $branch ]; then
190190fi
191191
192192if [ $( echo " $branch " | grep ' ^~localsrc' ) ]; then
193- branch=$( echo " $branch " | sed ' s/^~//' ) ;
193+ branch=$( echo " $branch " | sed ' s/^~//' ) ;
194194 use_src_folder=' true'
195195else
196196 use_src_folder=' false'
@@ -224,7 +224,7 @@ if [ -e "/etc/redhat-release" ]; then
224224else
225225 HESTIA_V=" ${BUILD_VER} _${BUILD_ARCH} "
226226fi
227- OPENSSL_V=' 3.0.5 '
227+ OPENSSL_V=' 3.0.7 '
228228PCRE_V=' 10.40'
229229ZLIB_V=' 1.2.13'
230230
@@ -324,7 +324,7 @@ branch_dash=$(echo "$branch" |sed 's/\//-/g');
324324
325325if [ " $NGINX_B " = true ] ; then
326326 echo " Building hestia-nginx package..."
327- if [ " $CROSS " = " true" ]; then
327+ if [ " $CROSS " = " true" ]; then
328328 echo " Cross compile not supported for hestia-nginx or hestia-php"
329329 exit 1;
330330 fi
@@ -334,10 +334,10 @@ if [ "$NGINX_B" = true ] ; then
334334 BUILD_DIR_HESTIANGINX=$BUILD_DIR /hestia-nginx_$NGINX_V
335335 if [[ $NGINX_V =~ - ]]; then
336336 BUILD_DIR_NGINX=$BUILD_DIR /nginx-$( echo $NGINX_V | cut -d" -" -f1)
337- else
337+ else
338338 BUILD_DIR_NGINX=$BUILD_DIR /nginx-$( echo $NGINX_V | cut -d" ~" -f1)
339339 fi
340-
340+
341341 if [ " $KEEPBUILD " != ' true' ] || [ ! -d " $BUILD_DIR_HESTIANGINX " ]; then
342342 # Check if target directory exist
343343 if [ -d " $BUILD_DIR_HESTIANGINX " ]; then
471471# ################################################################################
472472
473473if [ " $PHP_B " = true ] ; then
474- if [ " $CROSS " = " true" ]; then
474+ if [ " $CROSS " = " true" ]; then
475475 echo " Cross compile not supported for hestia-nginx or hestia-php"
476476 exit 1;
477477 fi
478-
478+
479479 echo " Building hestia-php package..."
480480
481481 BUILD_DIR_HESTIAPHP=$BUILD_DIR /hestia-php_$PHP_V
482-
482+
483483 BUILD_DIR_PHP=$BUILD_DIR /php-$( echo $PHP_V | cut -d" ~" -f1)
484-
484+
485485 if [[ $PHP_V =~ - ]]; then
486486 BUILD_DIR_PHP=$BUILD_DIR /php-$( echo $PHP_V | cut -d" -" -f1)
487487 else
488488 BUILD_DIR_PHP=$BUILD_DIR /php-$( echo $PHP_V | cut -d" ~" -f1)
489489 fi
490-
490+
491491 if [ " $KEEPBUILD " != ' true' ] || [ ! -d " $BUILD_DIR_HESTIAPHP " ]; then
492492 # Check if target directory exist
493493 if [ -d $BUILD_DIR_HESTIAPHP ]; then
@@ -532,7 +532,7 @@ if [ "$PHP_B" = true ] ; then
532532 # Move php directory
533533 [ " $HESTIA_DEBUG " ] && echo DEBUG: mkdir -p $BUILD_DIR_HESTIAPHP /usr/local/hestia
534534 mkdir -p $BUILD_DIR_HESTIAPHP /usr/local/hestia
535-
535+
536536 [ " $HESTIA_DEBUG " ] && echo DEBUG: rm -r $BUILD_DIR_HESTIAPHP /usr/local/hestia/php
537537 if [ -d $BUILD_DIR_HESTIAPHP /usr/local/hestia/php ]; then
538538 rm -r $BUILD_DIR_HESTIAPHP /usr/local/hestia/php
610610arch=" $BUILD_ARCH "
611611
612612if [ " $HESTIA_B " = true ]; then
613- if [ " $CROSS " = " true" ]; then
613+ if [ " $CROSS " = " true" ]; then
614614 arch=" amd64 arm64"
615615 fi
616- for BUILD_ARCH in $arch ; do
616+ for BUILD_ARCH in $arch ; do
617617 echo " Building Hestia Control Panel package..."
618-
618+
619619 BUILD_DIR_HESTIA=$BUILD_DIR /hestia_$HESTIA_V
620-
620+
621621 # Change to build directory
622622 cd $BUILD_DIR
623-
623+
624624 if [ " $KEEPBUILD " != ' true' ] || [ ! -d " $BUILD_DIR_HESTIA " ]; then
625625 # Check if target directory exist
626626 if [ -d $BUILD_DIR_HESTIA ]; then
627627 rm -r $BUILD_DIR_HESTIA
628628 fi
629-
629+
630630 # Create directory
631631 mkdir -p $BUILD_DIR_HESTIA
632632 fi
633-
633+
634634 cd $BUILD_DIR
635635 rm -rf $BUILD_DIR /hestiacp-$branch_dash
636636 # Download and unpack source files
@@ -640,24 +640,24 @@ if [ "$HESTIA_B" = true ]; then
640640 elif [ -d $SRC_DIR ]; then
641641 download_file $HESTIA_ARCHIVE_LINK ' -' ' fresh' | tar xz
642642 fi
643-
643+
644644 mkdir -p $BUILD_DIR_HESTIA /usr/local/hestia
645-
645+
646646 # Move needed directories
647647 cd $BUILD_DIR /hestiacp-$branch_dash
648648 cp -rf bin func install web $BUILD_DIR_HESTIA /usr/local/hestia/
649-
649+
650650 # Set permissions
651651 find $BUILD_DIR_HESTIA /usr/local/hestia/ -type f -exec chmod -x {} \;
652-
652+
653653 # Allow send email via /usr/local/hestia/web/inc/mail-wrapper.php via cli
654654 chmod +x $BUILD_DIR_HESTIA /usr/local/hestia/web/inc/mail-wrapper.php
655655 # Allow the executable to be executed
656656 chmod +x $BUILD_DIR_HESTIA /usr/local/hestia/bin/*
657657 find $BUILD_DIR_HESTIA /usr/local/hestia/install/ \( -name ' *.sh' \) -exec chmod +x {} \;
658658 chmod -x $BUILD_DIR_HESTIA /usr/local/hestia/install/* .sh
659659 chown -R root:root $BUILD_DIR_HESTIA
660-
660+
661661 if [ " $BUILD_DEB " = true ]; then
662662 # Get Debian package files
663663 mkdir -p $BUILD_DIR_HESTIA /DEBIAN
@@ -670,17 +670,17 @@ if [ "$HESTIA_B" = true ]; then
670670 get_branch_file ' src/deb/hestia/postinst' " $BUILD_DIR_HESTIA /DEBIAN/postinst"
671671 chmod +x $BUILD_DIR_HESTIA /DEBIAN/postinst
672672 chmod +x $BUILD_DIR_HESTIA /DEBIAN/preinst
673-
673+
674674 echo Building Hestia DEB
675675 dpkg-deb -Zxz --build $BUILD_DIR_HESTIA $DEB_DIR
676676 fi
677-
677+
678678 if [ " $BUILD_RPM " = true ]; then
679679 # Get RHEL package files
680680 get_branch_file ' src/rpm/hestia/hestia.spec' " ${BUILD_DIR_HESTIA} /hestia.spec"
681681 sed -i " s/%HESTIA-VERSION%/${HESTIA_V} /g" " ${BUILD_DIR_HESTIA} /hestia.spec"
682682 get_branch_file ' src/rpm/hestia/hestia.service' " ${BUILD_DIR_HESTIA} /hestia.service"
683-
683+
684684 # Build RPM package
685685 mkdir -p $BUILD_DIR /rpmbuild
686686 echo Building Hestia RPM
@@ -689,7 +689,7 @@ if [ "$HESTIA_B" = true ]; then
689689 rm ~ /rpmbuild/RPMS/$( arch) /hestia-* .rpm
690690 rm -rf $BUILD_DIR /rpmbuild
691691 fi
692-
692+
693693 # clear up the source folder
694694 if [ " $KEEPBUILD " != ' true' ]; then
695695 rm -r $BUILD_DIR_HESTIA
0 commit comments