@@ -71,6 +71,12 @@ BUILD_DIR='/tmp/hestiacp-src'
7171DEB_DIR=" $BUILD_DIR /debs"
7272INSTALL_DIR=' /usr/local/hestia'
7373ARCHIVE_DIR=" ${BUILD_DIR} /archive"
74+ architecture=" $( uname -m) "
75+ if [ $architecture == ' aarch64' ]; then
76+ BUILD_ARCH=' arm64'
77+ else
78+ BUILD_ARCH=' amd64'
79+ fi
7480
7581# Set command variables
7682fork=$1
@@ -233,6 +239,9 @@ if [ "$NGINX_B" = true ] ; then
233239 # Download control, postinst and postrm files
234240 cd DEBIAN
235241 download_file $GIT_REP /nginx/control
242+ if [ " $BUILD_ARCH " != " amd64" ]; then
243+ sed -i " s/amd64/${BUILD_ARCH} /g" " control"
244+ fi
236245 download_file $GIT_REP /nginx/copyright
237246 download_file $GIT_REP /nginx/postinst
238247 download_file $GIT_REP /nginx/postrm
@@ -295,14 +304,31 @@ if [ "$PHP_B" = true ] ; then
295304 cd php-$PHP_V
296305
297306 # Configure PHP
298- ./configure --prefix=/usr/local/hestia/php \
307+ if [ $BUILD_ARCH = ' amd64' ]; then
308+ ./configure --prefix=/usr/local/hestia/php \
299309 --enable-fpm \
300310 --with-fpm-user=admin \
301311 --with-fpm-group=admin \
302312 --with-libdir=lib/x86_64-linux-gnu \
303313 --with-mysqli \
314+ --with-gettext \
304315 --with-curl \
316+ --with-zip \
317+ --with-gmp \
305318 --enable-mbstring
319+ else
320+ ./configure --prefix=/usr/local/hestia/php \
321+ --enable-fpm \
322+ --with-fpm-user=admin \
323+ --with-fpm-group=admin \
324+ --with-libdir=lib/aarch64-linux-gnu \
325+ --with-mysqli \
326+ --with-gettext \
327+ --with-curl \
328+ --with-zip \
329+ --with-gmp \
330+ --enable-mbstring
331+ fi
306332
307333 # Create the files and install them
308334 make -j $NUM_CPUS && make INSTALL_ROOT=$BUILD_DIR install
@@ -318,6 +344,9 @@ if [ "$PHP_B" = true ] ; then
318344 # Download control, postinst and postrm files
319345 cd DEBIAN
320346 download_file $GIT_REP /php/control
347+ if [ " $BUILD_ARCH " != " amd64" ]; then
348+ sed -i " s/amd64/${BUILD_ARCH} /g" " control"
349+ fi
321350 download_file $GIT_REP /php/copyright
322351
323352 # Move php directory
@@ -374,6 +403,9 @@ if [ "$HESTIA_B" = true ] ; then
374403 # Download control, postinst and postrm files
375404 cd DEBIAN
376405 download_file $GIT_REP /hestia/control
406+ if [ " $BUILD_ARCH " != " amd64" ]; then
407+ sed -i " s/amd64/${BUILD_ARCH} /g" " control"
408+ fi
377409 download_file $GIT_REP /hestia/copyright
378410 download_file $GIT_REP /hestia/postinst
379411
0 commit comments