@@ -106,6 +106,12 @@ BUILD_DIR='/tmp/hestiacp-src'
106106INSTALL_DIR=' /usr/local/hestia'
107107SRC_DIR=" $( cd " $( dirname " $0 " ) /.." && pwd) "
108108ARCHIVE_DIR=" $SRC_DIR /src/archive/"
109+ architecture=" $( uname -m) "
110+ if [ $architecture == ' aarch64' ]; then
111+ BUILD_ARCH=' arm64'
112+ else
113+ BUILD_ARCH=' amd64'
114+ fi
109115RPM_DIR=" $BUILD_DIR /rpm/"
110116DEB_DIR=" $BUILD_DIR /deb/"
111117if [ -f ' /etc/redhat-release' ]; then
204210
205211echo " Build version $BUILD_VER , with Nginx version $NGINX_V and PHP version $PHP_V "
206212
207- BUILD_ARCH=' amd64'
208213HESTIA_V=" ${BUILD_VER} _${BUILD_ARCH} "
209214OPENSSL_V=' 1.1.1j'
210215PCRE_V=' 8.44'
@@ -270,6 +275,7 @@ if [ "$HESTIA_DEBUG" ]; then
270275 echo " Hestia version : $BUILD_VER "
271276 echo " Nginx version : $NGINX_V "
272277 echo " PHP version : $PHP_V "
278+ echo " Architecture : $BUILD_ARCH "
273279 echo " Debug mode : $HESTIA_DEBUG "
274280 echo " Source directory : $SRC_DIR "
275281fi
@@ -372,6 +378,9 @@ if [ "$NGINX_B" = true ] ; then
372378 # Get Debian package files
373379 mkdir -p $BUILD_DIR_HESTIANGINX /DEBIAN
374380 get_branch_file ' src/deb/nginx/control' " $BUILD_DIR_HESTIANGINX /DEBIAN/control"
381+ if [ " $BUILD_ARCH " != " amd64" ]; then
382+ sed -i " s/%amd64%/${BUILD_ARCH} /g" " $BUILD_DIR_HESTIANGINX /DEBIAN/control"
383+ fi
375384 get_branch_file ' src/deb/nginx/copyright' " $BUILD_DIR_HESTIANGINX /DEBIAN/copyright"
376385 get_branch_file ' src/deb/nginx/postinst' " $BUILD_DIR_HESTIANGINX /DEBIAN/postinst"
377386 get_branch_file ' src/deb/nginx/postrm' " $BUILD_DIR_HESTIANGINX /DEBIAN/portrm"
@@ -502,6 +511,9 @@ if [ "$PHP_B" = true ] ; then
502511 [ " $HESTIA_DEBUG " ] && echo DEBUG: mkdir -p $BUILD_DIR_HESTIAPHP /DEBIAN
503512 mkdir -p $BUILD_DIR_HESTIAPHP /DEBIAN
504513 get_branch_file ' src/deb/php/control' " $BUILD_DIR_HESTIAPHP /DEBIAN/control"
514+ if [ " $BUILD_ARCH " != " amd64" ]; then
515+ sed -i " s/%amd64%/${BUILD_ARCH} /g" " $BUILD_DIR_HESTIAPHP /DEBIAN/control"
516+ fi
505517 get_branch_file ' src/deb/php/copyright' " $BUILD_DIR_HESTIAPHP /DEBIAN/copyright"
506518
507519 # Get custom config
@@ -595,6 +607,9 @@ if [ "$HESTIA_B" = true ]; then
595607 # Get Debian package files
596608 mkdir -p $BUILD_DIR_HESTIA /DEBIAN
597609 get_branch_file ' src/deb/hestia/control' " $BUILD_DIR_HESTIA /DEBIAN/control"
610+ if [ " $BUILD_ARCH " != " amd64" ]; then
611+ sed -i " s/%amd64%/${BUILD_ARCH} /g" " $BUILD_DIR_HESTIA /DEBIAN/control"
612+ fi
598613 get_branch_file ' src/deb/hestia/copyright' " $BUILD_DIR_HESTIA /DEBIAN/copyright"
599614 get_branch_file ' src/deb/hestia/postinst' " $BUILD_DIR_HESTIA /DEBIAN/postinst"
600615 chmod +x $BUILD_DIR_HESTIA /DEBIAN/postinst
0 commit comments