|
|
@@ -6,7 +6,7 @@
|
|
|
# and the script will not try to download the arhive from github, since '~' char is
|
|
|
# not accepted in branch name.
|
|
|
# Compile but dont install -> ./hst_autocompile.sh --hestia --noinstall --keepbuild '~localsrc'
|
|
|
-# Compilea and install -> ./hst_autocompile.sh --hestia --install '~localsrc'
|
|
|
+# Compile and install -> ./hst_autocompile.sh --hestia --install '~localsrc'
|
|
|
|
|
|
# Clear previous screen output
|
|
|
clear
|
|
|
@@ -106,6 +106,12 @@ BUILD_DIR='/tmp/hestiacp-src'
|
|
|
INSTALL_DIR='/usr/local/hestia'
|
|
|
SRC_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
|
ARCHIVE_DIR="$SRC_DIR/src/archive/"
|
|
|
+architecture="$(uname -m)"
|
|
|
+if [ $architecture == 'aarch64' ]; then
|
|
|
+ BUILD_ARCH='arm64'
|
|
|
+else
|
|
|
+ BUILD_ARCH='amd64'
|
|
|
+fi
|
|
|
RPM_DIR="$BUILD_DIR/rpm/"
|
|
|
DEB_DIR="$BUILD_DIR/deb/"
|
|
|
if [ -f '/etc/redhat-release' ]; then
|
|
|
@@ -204,7 +210,6 @@ fi
|
|
|
|
|
|
echo "Build version $BUILD_VER, with Nginx version $NGINX_V and PHP version $PHP_V"
|
|
|
|
|
|
-BUILD_ARCH='amd64'
|
|
|
HESTIA_V="${BUILD_VER}_${BUILD_ARCH}"
|
|
|
OPENSSL_V='1.1.1j'
|
|
|
PCRE_V='8.44'
|
|
|
@@ -249,7 +254,11 @@ if [ "$dontinstalldeps" != 'true' ]; then
|
|
|
|
|
|
# Fix for Debian PHP Envroiment
|
|
|
if [ ! -e /usr/local/include/curl ]; then
|
|
|
- ln -s /usr/include/x86_64-linux-gnu/curl /usr/local/include/curl
|
|
|
+ if [ $BUILD_ARCH == "amd64" ]; then
|
|
|
+ ln -s /usr/include/x86_64-linux-gnu/curl /usr/local/include/curl
|
|
|
+ else
|
|
|
+ echo "No x86_64 working"
|
|
|
+ fi
|
|
|
fi
|
|
|
fi
|
|
|
fi
|
|
|
@@ -270,6 +279,7 @@ if [ "$HESTIA_DEBUG" ]; then
|
|
|
echo "Hestia version : $BUILD_VER"
|
|
|
echo "Nginx version : $NGINX_V"
|
|
|
echo "PHP version : $PHP_V"
|
|
|
+ echo "Architecture : $BUILD_ARCH"
|
|
|
echo "Debug mode : $HESTIA_DEBUG"
|
|
|
echo "Source directory : $SRC_DIR"
|
|
|
fi
|
|
|
@@ -372,6 +382,9 @@ if [ "$NGINX_B" = true ] ; then
|
|
|
# Get Debian package files
|
|
|
mkdir -p $BUILD_DIR_HESTIANGINX/DEBIAN
|
|
|
get_branch_file 'src/deb/nginx/control' "$BUILD_DIR_HESTIANGINX/DEBIAN/control"
|
|
|
+ if [ "$BUILD_ARCH" != "amd64" ]; then
|
|
|
+ sed -i "s/amd64/${BUILD_ARCH}/g" "$BUILD_DIR_HESTIANGINX/DEBIAN/control"
|
|
|
+ fi
|
|
|
get_branch_file 'src/deb/nginx/copyright' "$BUILD_DIR_HESTIANGINX/DEBIAN/copyright"
|
|
|
get_branch_file 'src/deb/nginx/postinst' "$BUILD_DIR_HESTIANGINX/DEBIAN/postinst"
|
|
|
get_branch_file 'src/deb/nginx/postrm' "$BUILD_DIR_HESTIANGINX/DEBIAN/portrm"
|
|
|
@@ -451,18 +464,33 @@ if [ "$PHP_B" = true ] ; then
|
|
|
cd $BUILD_DIR_PHP
|
|
|
|
|
|
# Configure PHP
|
|
|
- ./configure --prefix=/usr/local/hestia/php \
|
|
|
- --enable-fpm \
|
|
|
- --with-fpm-user=admin \
|
|
|
- --with-fpm-group=admin \
|
|
|
- --with-libdir=lib/x86_64-linux-gnu \
|
|
|
- --with-mysqli \
|
|
|
- --with-gettext \
|
|
|
- --with-curl \
|
|
|
- --with-zip \
|
|
|
- --with-gmp \
|
|
|
- --enable-intl \
|
|
|
- --enable-mbstring
|
|
|
+ if [ $BUILD_ARCH = 'amd64' ]; then
|
|
|
+ ./configure --prefix=/usr/local/hestia/php \
|
|
|
+ --enable-fpm \
|
|
|
+ --with-fpm-user=admin \
|
|
|
+ --with-fpm-group=admin \
|
|
|
+ --with-libdir=lib/x86_64-linux-gnu \
|
|
|
+ --with-mysqli \
|
|
|
+ --with-gettext \
|
|
|
+ --with-curl \
|
|
|
+ --with-zip \
|
|
|
+ --with-gmp \
|
|
|
+ --enable-intl \
|
|
|
+ --enable-mbstring
|
|
|
+ else
|
|
|
+ ./configure --prefix=/usr/local/hestia/php \
|
|
|
+ --enable-fpm \
|
|
|
+ --with-fpm-user=admin \
|
|
|
+ --with-fpm-group=admin \
|
|
|
+ --with-libdir=lib/aarch64-linux-gnu \
|
|
|
+ --with-mysqli \
|
|
|
+ --with-gettext \
|
|
|
+ --with-curl \
|
|
|
+ --with-zip \
|
|
|
+ --with-gmp \
|
|
|
+ --enable-intl \
|
|
|
+ --enable-mbstring
|
|
|
+ fi
|
|
|
fi
|
|
|
|
|
|
cd $BUILD_DIR_PHP
|
|
|
@@ -503,6 +531,9 @@ if [ "$PHP_B" = true ] ; then
|
|
|
[ "$HESTIA_DEBUG" ] && echo DEBUG: mkdir -p $BUILD_DIR_HESTIAPHP/DEBIAN
|
|
|
mkdir -p $BUILD_DIR_HESTIAPHP/DEBIAN
|
|
|
get_branch_file 'src/deb/php/control' "$BUILD_DIR_HESTIAPHP/DEBIAN/control"
|
|
|
+ if [ "$BUILD_ARCH" != "amd64" ]; then
|
|
|
+ sed -i "s/amd64/${BUILD_ARCH}/g" "$BUILD_DIR_HESTIAPHP/DEBIAN/control"
|
|
|
+ fi
|
|
|
get_branch_file 'src/deb/php/copyright' "$BUILD_DIR_HESTIAPHP/DEBIAN/copyright"
|
|
|
|
|
|
# Get custom config
|
|
|
@@ -600,6 +631,9 @@ if [ "$HESTIA_B" = true ]; then
|
|
|
# Get Debian package files
|
|
|
mkdir -p $BUILD_DIR_HESTIA/DEBIAN
|
|
|
get_branch_file 'src/deb/hestia/control' "$BUILD_DIR_HESTIA/DEBIAN/control"
|
|
|
+ if [ "$BUILD_ARCH" != "amd64" ]; then
|
|
|
+ sed -i "s/amd64/${BUILD_ARCH}/g" "$BUILD_DIR_HESTIA/DEBIAN/control"
|
|
|
+ fi
|
|
|
get_branch_file 'src/deb/hestia/copyright' "$BUILD_DIR_HESTIA/DEBIAN/copyright"
|
|
|
get_branch_file 'src/deb/hestia/postinst' "$BUILD_DIR_HESTIA/DEBIAN/postinst"
|
|
|
chmod +x $BUILD_DIR_HESTIA/DEBIAN/postinst
|