|
@@ -246,7 +246,7 @@ if [ "$dontinstalldeps" != 'true' ]; then
|
|
|
# Install needed software
|
|
# Install needed software
|
|
|
if [ "$OSTYPE" = 'rhel' ]; then
|
|
if [ "$OSTYPE" = 'rhel' ]; then
|
|
|
# Set package dependencies for compiling
|
|
# Set package dependencies for compiling
|
|
|
- SOFTWARE='gcc gcc-c++ make libxml2-devel zlib-devel libzip-devel gmp-devel libcurl-devel gnutls-devel unzip openssl openssl-devel pkg-config sqlite-devel oniguruma-devel rpm-build wget tar git curl perl-IPC-Cmd perl-File-Copy-Recursive perl-FindBin perl-File-Compare'
|
|
|
|
|
|
|
+ SOFTWARE='wget tar git curl mock rpm-build rpmdevtools'
|
|
|
|
|
|
|
|
echo "Updating system DNF repositories..."
|
|
echo "Updating system DNF repositories..."
|
|
|
dnf install -y -q 'dnf-command(config-manager)'
|
|
dnf install -y -q 'dnf-command(config-manager)'
|
|
@@ -257,9 +257,13 @@ if [ "$dontinstalldeps" != 'true' ]; then
|
|
|
dnf upgrade -y -q
|
|
dnf upgrade -y -q
|
|
|
echo "Installing dependencies for compilation..."
|
|
echo "Installing dependencies for compilation..."
|
|
|
dnf install -y -q $SOFTWARE
|
|
dnf install -y -q $SOFTWARE
|
|
|
|
|
+ rpmdev-setuptree
|
|
|
|
|
+ if [ ! -d "/var/lib/mock/rocky+epel-9-$(arch)-bootstrap" ]; then
|
|
|
|
|
+ mock -r rocky+epel-9-$(arch) --init
|
|
|
|
|
+ fi
|
|
|
else
|
|
else
|
|
|
# Set package dependencies for compiling
|
|
# Set package dependencies for compiling
|
|
|
- SOFTWARE='build-essential libxml2-dev libz-dev libzip-dev libgmp-dev libcurl4-gnutls-dev unzip openssl libssl-dev pkg-config libsqlite3-dev libonig-dev rpm lsb-release'
|
|
|
|
|
|
|
+ SOFTWARE='wget tar git curl build-essential libxml2-dev libz-dev libzip-dev libgmp-dev libcurl4-gnutls-dev unzip openssl libssl-dev pkg-config libsqlite3-dev libonig-dev rpm lsb-release'
|
|
|
|
|
|
|
|
echo "Updating system APT repositories..."
|
|
echo "Updating system APT repositories..."
|
|
|
apt-get -qq update > /dev/null 2>&1
|
|
apt-get -qq update > /dev/null 2>&1
|
|
@@ -329,86 +333,86 @@ if [ "$NGINX_B" = true ]; then
|
|
|
echo "Cross compile not supported for hestia-nginx or hestia-php"
|
|
echo "Cross compile not supported for hestia-nginx or hestia-php"
|
|
|
exit 1
|
|
exit 1
|
|
|
fi
|
|
fi
|
|
|
- # Change to build directory
|
|
|
|
|
- cd $BUILD_DIR
|
|
|
|
|
|
|
|
|
|
- BUILD_DIR_HESTIANGINX=$BUILD_DIR/hestia-nginx_$NGINX_V
|
|
|
|
|
- if [[ $NGINX_V =~ - ]]; then
|
|
|
|
|
- BUILD_DIR_NGINX=$BUILD_DIR/nginx-$(echo $NGINX_V | cut -d"-" -f1)
|
|
|
|
|
- else
|
|
|
|
|
- BUILD_DIR_NGINX=$BUILD_DIR/nginx-$(echo $NGINX_V | cut -d"~" -f1)
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ if [ "$BUILD_DEB" = true ]; then
|
|
|
|
|
+ # Change to build directory
|
|
|
|
|
+ cd $BUILD_DIR
|
|
|
|
|
|
|
|
- if [ "$KEEPBUILD" != 'true' ] || [ ! -d "$BUILD_DIR_HESTIANGINX" ]; then
|
|
|
|
|
- # Check if target directory exist
|
|
|
|
|
- if [ -d "$BUILD_DIR_HESTIANGINX" ]; then
|
|
|
|
|
- #mv $BUILD_DIR/hestia-nginx_$NGINX_V $BUILD_DIR/hestia-nginx_$NGINX_V-$(timestamp)
|
|
|
|
|
- rm -r "$BUILD_DIR_HESTIANGINX"
|
|
|
|
|
|
|
+ BUILD_DIR_HESTIANGINX=$BUILD_DIR/hestia-nginx_$NGINX_V
|
|
|
|
|
+ if [[ $NGINX_V =~ - ]]; then
|
|
|
|
|
+ BUILD_DIR_NGINX=$BUILD_DIR/nginx-$(echo $NGINX_V | cut -d"-" -f1)
|
|
|
|
|
+ else
|
|
|
|
|
+ BUILD_DIR_NGINX=$BUILD_DIR/nginx-$(echo $NGINX_V | cut -d"~" -f1)
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
- # Create directory
|
|
|
|
|
- mkdir -p $BUILD_DIR_HESTIANGINX
|
|
|
|
|
|
|
+ if [ "$KEEPBUILD" != 'true' ] || [ ! -d "$BUILD_DIR_HESTIANGINX" ]; then
|
|
|
|
|
+ # Check if target directory exist
|
|
|
|
|
+ if [ -d "$BUILD_DIR_HESTIANGINX" ]; then
|
|
|
|
|
+ #mv $BUILD_DIR/hestia-nginx_$NGINX_V $BUILD_DIR/hestia-nginx_$NGINX_V-$(timestamp)
|
|
|
|
|
+ rm -r "$BUILD_DIR_HESTIANGINX"
|
|
|
|
|
+ fi
|
|
|
|
|
|
|
|
- # Download and unpack source files
|
|
|
|
|
- download_file $NGINX '-' | tar xz
|
|
|
|
|
- download_file $OPENSSL '-' | tar xz
|
|
|
|
|
- download_file $PCRE '-' | tar xz
|
|
|
|
|
- download_file $ZLIB '-' | tar xz
|
|
|
|
|
|
|
+ # Create directory
|
|
|
|
|
+ mkdir -p $BUILD_DIR_HESTIANGINX
|
|
|
|
|
+
|
|
|
|
|
+ # Download and unpack source files
|
|
|
|
|
+ download_file $NGINX '-' | tar xz
|
|
|
|
|
+ download_file $OPENSSL '-' | tar xz
|
|
|
|
|
+ download_file $PCRE '-' | tar xz
|
|
|
|
|
+ download_file $ZLIB '-' | tar xz
|
|
|
|
|
+
|
|
|
|
|
+ # Change to nginx directory
|
|
|
|
|
+ cd $BUILD_DIR_NGINX
|
|
|
|
|
+
|
|
|
|
|
+ # 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=../pcre2-$PCRE_V \
|
|
|
|
|
+ --with-pcre-jit \
|
|
|
|
|
+ --with-zlib=../zlib-$ZLIB_V
|
|
|
|
|
+ fi
|
|
|
|
|
|
|
|
# Change to nginx directory
|
|
# Change to nginx directory
|
|
|
cd $BUILD_DIR_NGINX
|
|
cd $BUILD_DIR_NGINX
|
|
|
|
|
|
|
|
- # 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=../pcre2-$PCRE_V \
|
|
|
|
|
- --with-pcre-jit \
|
|
|
|
|
- --with-zlib=../zlib-$ZLIB_V
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
- # Change to nginx directory
|
|
|
|
|
- cd $BUILD_DIR_NGINX
|
|
|
|
|
-
|
|
|
|
|
- # Check install directory and remove if exists
|
|
|
|
|
- if [ -d "$BUILD_DIR$INSTALL_DIR" ]; then
|
|
|
|
|
- rm -r "$BUILD_DIR$INSTALL_DIR"
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
- # Copy local hestia source files
|
|
|
|
|
- if [ "$use_src_folder" == 'true' ] && [ -d $SRC_DIR ]; then
|
|
|
|
|
- cp -rf "$SRC_DIR/" $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ # Check install directory and remove if exists
|
|
|
|
|
+ if [ -d "$BUILD_DIR$INSTALL_DIR" ]; then
|
|
|
|
|
+ rm -r "$BUILD_DIR$INSTALL_DIR"
|
|
|
|
|
+ fi
|
|
|
|
|
|
|
|
- # Create the files and install them
|
|
|
|
|
- make -j $NUM_CPUS && make DESTDIR=$BUILD_DIR install
|
|
|
|
|
|
|
+ # Copy local hestia source files
|
|
|
|
|
+ if [ "$use_src_folder" == 'true' ] && [ -d $SRC_DIR ]; then
|
|
|
|
|
+ cp -rf "$SRC_DIR/" $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
+ fi
|
|
|
|
|
|
|
|
- # Clear up unused files
|
|
|
|
|
- if [ "$KEEPBUILD" != 'true' ]; then
|
|
|
|
|
- rm -r $BUILD_DIR_NGINX $BUILD_DIR/openssl-$OPENSSL_V $BUILD_DIR/pcre2-$PCRE_V $BUILD_DIR/zlib-$ZLIB_V
|
|
|
|
|
- fi
|
|
|
|
|
- cd $BUILD_DIR_HESTIANGINX
|
|
|
|
|
|
|
+ # Create the files and install them
|
|
|
|
|
+ make -j $NUM_CPUS && make DESTDIR=$BUILD_DIR install
|
|
|
|
|
|
|
|
- # Move nginx directory
|
|
|
|
|
- mkdir -p $BUILD_DIR_HESTIANGINX/usr/local/hestia
|
|
|
|
|
- rm -rf $BUILD_DIR_HESTIANGINX/usr/local/hestia/nginx
|
|
|
|
|
- mv $BUILD_DIR/usr/local/hestia/nginx $BUILD_DIR_HESTIANGINX/usr/local/hestia/
|
|
|
|
|
|
|
+ # Clear up unused files
|
|
|
|
|
+ if [ "$KEEPBUILD" != 'true' ]; then
|
|
|
|
|
+ rm -r $BUILD_DIR_NGINX $BUILD_DIR/openssl-$OPENSSL_V $BUILD_DIR/pcre2-$PCRE_V $BUILD_DIR/zlib-$ZLIB_V
|
|
|
|
|
+ fi
|
|
|
|
|
+ cd $BUILD_DIR_HESTIANGINX
|
|
|
|
|
|
|
|
- # Remove original nginx.conf (will use custom)
|
|
|
|
|
- rm -f $BUILD_DIR_HESTIANGINX/usr/local/hestia/nginx/conf/nginx.conf
|
|
|
|
|
|
|
+ # Move nginx directory
|
|
|
|
|
+ mkdir -p $BUILD_DIR_HESTIANGINX/usr/local/hestia
|
|
|
|
|
+ rm -rf $BUILD_DIR_HESTIANGINX/usr/local/hestia/nginx
|
|
|
|
|
+ mv $BUILD_DIR/usr/local/hestia/nginx $BUILD_DIR_HESTIANGINX/usr/local/hestia/
|
|
|
|
|
|
|
|
- # copy binary
|
|
|
|
|
- cp $BUILD_DIR_HESTIANGINX/usr/local/hestia/nginx/sbin/nginx $BUILD_DIR_HESTIANGINX/usr/local/hestia/nginx/sbin/hestia-nginx
|
|
|
|
|
|
|
+ # Remove original nginx.conf (will use custom)
|
|
|
|
|
+ rm -f $BUILD_DIR_HESTIANGINX/usr/local/hestia/nginx/conf/nginx.conf
|
|
|
|
|
|
|
|
- # change permission and build the package
|
|
|
|
|
- cd $BUILD_DIR
|
|
|
|
|
- chown -R root:root $BUILD_DIR_HESTIANGINX
|
|
|
|
|
|
|
+ # copy binary
|
|
|
|
|
+ mv $BUILD_DIR_HESTIANGINX/usr/local/hestia/nginx/sbin/nginx $BUILD_DIR_HESTIANGINX/usr/local/hestia/nginx/sbin/hestia-nginx
|
|
|
|
|
|
|
|
- if [ "$BUILD_DEB" = true ]; then
|
|
|
|
|
|
|
+ # change permission and build the package
|
|
|
|
|
+ cd $BUILD_DIR
|
|
|
|
|
+ chown -R root:root $BUILD_DIR_HESTIANGINX
|
|
|
# Get Debian package files
|
|
# Get Debian package files
|
|
|
mkdir -p $BUILD_DIR_HESTIANGINX/DEBIAN
|
|
mkdir -p $BUILD_DIR_HESTIANGINX/DEBIAN
|
|
|
get_branch_file 'src/deb/nginx/control' "$BUILD_DIR_HESTIANGINX/DEBIAN/control"
|
|
get_branch_file 'src/deb/nginx/control' "$BUILD_DIR_HESTIANGINX/DEBIAN/control"
|
|
@@ -432,35 +436,34 @@ if [ "$NGINX_B" = true ]; then
|
|
|
# Build the package
|
|
# Build the package
|
|
|
echo Building Nginx DEB
|
|
echo Building Nginx DEB
|
|
|
dpkg-deb -Zxz --build $BUILD_DIR_HESTIANGINX $DEB_DIR
|
|
dpkg-deb -Zxz --build $BUILD_DIR_HESTIANGINX $DEB_DIR
|
|
|
|
|
+
|
|
|
|
|
+ rm -r $BUILD_DIR/usr
|
|
|
|
|
+
|
|
|
|
|
+ if [ "$KEEPBUILD" != 'true' ]; then
|
|
|
|
|
+ # Clean up the source folder
|
|
|
|
|
+ rm -r hestia- nginx_$NGINX_V
|
|
|
|
|
+ rm -rf $BUILD_DIR/rpmbuild
|
|
|
|
|
+ if [ "$use_src_folder" == 'true' ] && [ -d $BUILD_DIR/hestiacp-$branch_dash ]; then
|
|
|
|
|
+ rm -r $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
+ fi
|
|
|
|
|
+ fi
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
if [ "$BUILD_RPM" = true ]; then
|
|
if [ "$BUILD_RPM" = true ]; then
|
|
|
# Get RHEL package files
|
|
# Get RHEL package files
|
|
|
- get_branch_file 'src/rpm/nginx/hestia-nginx.spec' "${BUILD_DIR_HESTIANGINX}/hestia-nginx.spec"
|
|
|
|
|
- sed -i "s/%HESTIA-NGINX-VERSION%/${NGINX_V}/g" "${BUILD_DIR_HESTIANGINX}/hestia-nginx.spec"
|
|
|
|
|
- get_branch_file 'src/rpm/nginx/hestia-nginx.service' "${BUILD_DIR_HESTIANGINX}/hestia-nginx.service"
|
|
|
|
|
|
|
+ get_branch_file 'src/rpm/nginx/nginx.conf' "$HOME/rpmbuild/SOURCES/nginx.conf"
|
|
|
|
|
+ get_branch_file 'src/rpm/nginx/hestia-nginx.spec' "$HOME/rpmbuild/SPECS/hestia-nginx.spec"
|
|
|
|
|
+ get_branch_file 'src/rpm/nginx/hestia-nginx.service' "$HOME/rpmbuild/SOURCES/hestia-nginx.service"
|
|
|
|
|
|
|
|
- # Custom config
|
|
|
|
|
- get_branch_file 'src/rpm/nginx/nginx.conf' "${BUILD_DIR_HESTIANGINX}/usr/local/hestia/nginx/conf/nginx.conf"
|
|
|
|
|
|
|
+ # Download source files
|
|
|
|
|
+ download_file $NGINX "$HOME/rpmbuild/SOURCES/"
|
|
|
|
|
|
|
|
# Build the package
|
|
# Build the package
|
|
|
- mkdir -p $BUILD_DIR/rpmbuild
|
|
|
|
|
echo Building Nginx RPM
|
|
echo Building Nginx RPM
|
|
|
- rpmbuild -bb --define "sourcedir $BUILD_DIR_HESTIANGINX" --buildroot=$BUILD_DIR/rpmbuild/ ${BUILD_DIR_HESTIANGINX}/hestia-nginx.spec > ${BUILD_DIR_HESTIANGINX}.rpm.log
|
|
|
|
|
- cp ~/rpmbuild/RPMS/$(arch)/hestia-nginx-*.rpm $RPM_DIR
|
|
|
|
|
- rm ~/rpmbuild/RPMS/$(arch)/hestia-nginx-*.rpm
|
|
|
|
|
- rm -rf $BUILD_DIR/rpmbuild
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
- rm -r $BUILD_DIR/usr
|
|
|
|
|
-
|
|
|
|
|
- if [ "$KEEPBUILD" != 'true' ]; then
|
|
|
|
|
- # Clean up the source folder
|
|
|
|
|
- rm -r hestia-nginx_$NGINX_V
|
|
|
|
|
- rm -rf $BUILD_DIR/rpmbuild
|
|
|
|
|
- if [ "$use_src_folder" == 'true' ] && [ -d $BUILD_DIR/hestiacp-$branch_dash ]; then
|
|
|
|
|
- rm -r $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ rpmbuild -bs ~/rpmbuild/SPECS/hestia-nginx.spec
|
|
|
|
|
+ mock -r rocky+epel-9-$(arch) ~/rpmbuild/SRPMS/hestia-nginx-$NGINX_V-1.el9.src.rpm
|
|
|
|
|
+ cp /var/lib/mock/rocky+epel-9-$(arch)/result/*.rpm $RPM_DIR
|
|
|
|
|
+ rm -rf ~/rpmbuild/SPECS/* ~/rpmbuild/SOURCES/* ~/rpmbuild/SRPMS/*
|
|
|
fi
|
|
fi
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
@@ -478,77 +481,74 @@ if [ "$PHP_B" = true ]; then
|
|
|
|
|
|
|
|
echo "Building hestia-php package..."
|
|
echo "Building hestia-php package..."
|
|
|
|
|
|
|
|
- BUILD_DIR_HESTIAPHP=$BUILD_DIR/hestia-php_$PHP_V
|
|
|
|
|
-
|
|
|
|
|
- BUILD_DIR_PHP=$BUILD_DIR/php-$(echo $PHP_V | cut -d"~" -f1)
|
|
|
|
|
|
|
+ if [ "$BUILD_DEB" = true ]; then
|
|
|
|
|
+ BUILD_DIR_HESTIAPHP=$BUILD_DIR/hestia-php_$PHP_V
|
|
|
|
|
|
|
|
- if [[ $PHP_V =~ - ]]; then
|
|
|
|
|
- BUILD_DIR_PHP=$BUILD_DIR/php-$(echo $PHP_V | cut -d"-" -f1)
|
|
|
|
|
- else
|
|
|
|
|
BUILD_DIR_PHP=$BUILD_DIR/php-$(echo $PHP_V | cut -d"~" -f1)
|
|
BUILD_DIR_PHP=$BUILD_DIR/php-$(echo $PHP_V | cut -d"~" -f1)
|
|
|
- fi
|
|
|
|
|
|
|
|
|
|
- if [ "$KEEPBUILD" != 'true' ] || [ ! -d "$BUILD_DIR_HESTIAPHP" ]; then
|
|
|
|
|
- # Check if target directory exist
|
|
|
|
|
- if [ -d $BUILD_DIR_HESTIAPHP ]; then
|
|
|
|
|
- rm -r $BUILD_DIR_HESTIAPHP
|
|
|
|
|
|
|
+ if [[ $PHP_V =~ - ]]; then
|
|
|
|
|
+ BUILD_DIR_PHP=$BUILD_DIR/php-$(echo $PHP_V | cut -d"-" -f1)
|
|
|
|
|
+ else
|
|
|
|
|
+ BUILD_DIR_PHP=$BUILD_DIR/php-$(echo $PHP_V | cut -d"~" -f1)
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
- # Create directory
|
|
|
|
|
- mkdir -p $BUILD_DIR_HESTIAPHP
|
|
|
|
|
|
|
+ if [ "$KEEPBUILD" != 'true' ] || [ ! -d "$BUILD_DIR_HESTIAPHP" ]; then
|
|
|
|
|
+ # Check if target directory exist
|
|
|
|
|
+ if [ -d $BUILD_DIR_HESTIAPHP ]; then
|
|
|
|
|
+ rm -r $BUILD_DIR_HESTIAPHP
|
|
|
|
|
+ fi
|
|
|
|
|
|
|
|
- # Download and unpack source files
|
|
|
|
|
- cd $BUILD_DIR
|
|
|
|
|
- download_file $PHP '-' | tar xz
|
|
|
|
|
|
|
+ # Create directory
|
|
|
|
|
+ mkdir -p $BUILD_DIR_HESTIAPHP
|
|
|
|
|
+
|
|
|
|
|
+ # Download and unpack source files
|
|
|
|
|
+ cd $BUILD_DIR
|
|
|
|
|
+ download_file $PHP '-' | tar xz
|
|
|
|
|
+
|
|
|
|
|
+ # Change to untarred php directory
|
|
|
|
|
+ cd $BUILD_DIR_PHP
|
|
|
|
|
+
|
|
|
|
|
+ # Configure PHP
|
|
|
|
|
+ ./configure --prefix=/usr/local/hestia/php \
|
|
|
|
|
+ --with-libdir=lib/$(arch)-linux-gnu \
|
|
|
|
|
+ --enable-fpm --with-fpm-user=admin --with-fpm-group=admin \
|
|
|
|
|
+ --with-openssl \
|
|
|
|
|
+ --with-mysqli \
|
|
|
|
|
+ --with-gettext \
|
|
|
|
|
+ --with-curl \
|
|
|
|
|
+ --with-zip \
|
|
|
|
|
+ --with-gmp \
|
|
|
|
|
+ --enable-mbstring
|
|
|
|
|
+ fi
|
|
|
|
|
|
|
|
- # Change to untarred php directory
|
|
|
|
|
cd $BUILD_DIR_PHP
|
|
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/$(arch)-linux-gnu \
|
|
|
|
|
- --with-openssl \
|
|
|
|
|
- --with-mysqli \
|
|
|
|
|
- --with-gettext \
|
|
|
|
|
- --with-curl \
|
|
|
|
|
- --with-zip \
|
|
|
|
|
- --with-gmp \
|
|
|
|
|
- --enable-mbstring
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ # Create the files and install them
|
|
|
|
|
+ make -j $NUM_CPUS && make INSTALL_ROOT=$BUILD_DIR install
|
|
|
|
|
|
|
|
- cd $BUILD_DIR_PHP
|
|
|
|
|
-
|
|
|
|
|
- # Create the files and install them
|
|
|
|
|
- make -j $NUM_CPUS && make INSTALL_ROOT=$BUILD_DIR install
|
|
|
|
|
-
|
|
|
|
|
- # Copy local hestia source files
|
|
|
|
|
- if [ "$use_src_folder" == 'true' ] && [ -d $SRC_DIR ]; then
|
|
|
|
|
- [ "$HESTIA_DEBUG" ] && echo DEBUG: cp -rf "$SRC_DIR/" $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
- cp -rf "$SRC_DIR/" $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
- fi
|
|
|
|
|
- # Move php directory
|
|
|
|
|
- [ "$HESTIA_DEBUG" ] && echo DEBUG: mkdir -p $BUILD_DIR_HESTIAPHP/usr/local/hestia
|
|
|
|
|
- mkdir -p $BUILD_DIR_HESTIAPHP/usr/local/hestia
|
|
|
|
|
-
|
|
|
|
|
- [ "$HESTIA_DEBUG" ] && echo DEBUG: rm -r $BUILD_DIR_HESTIAPHP/usr/local/hestia/php
|
|
|
|
|
- if [ -d $BUILD_DIR_HESTIAPHP/usr/local/hestia/php ]; then
|
|
|
|
|
- rm -r $BUILD_DIR_HESTIAPHP/usr/local/hestia/php
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ # Copy local hestia source files
|
|
|
|
|
+ if [ "$use_src_folder" == 'true' ] && [ -d $SRC_DIR ]; then
|
|
|
|
|
+ [ "$HESTIA_DEBUG" ] && echo DEBUG: cp -rf "$SRC_DIR/" $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
+ cp -rf "$SRC_DIR/" $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
+ fi
|
|
|
|
|
+ # Move php directory
|
|
|
|
|
+ [ "$HESTIA_DEBUG" ] && echo DEBUG: mkdir -p $BUILD_DIR_HESTIAPHP/usr/local/hestia
|
|
|
|
|
+ mkdir -p $BUILD_DIR_HESTIAPHP/usr/local/hestia
|
|
|
|
|
|
|
|
- [ "$HESTIA_DEBUG" ] && echo DEBUG: mv ${BUILD_DIR}/usr/local/hestia/php ${BUILD_DIR_HESTIAPHP}/usr/local/hestia/
|
|
|
|
|
- mv ${BUILD_DIR}/usr/local/hestia/php ${BUILD_DIR_HESTIAPHP}/usr/local/hestia/
|
|
|
|
|
|
|
+ [ "$HESTIA_DEBUG" ] && echo DEBUG: rm -r $BUILD_DIR_HESTIAPHP/usr/local/hestia/php
|
|
|
|
|
+ if [ -d $BUILD_DIR_HESTIAPHP/usr/local/hestia/php ]; then
|
|
|
|
|
+ rm -r $BUILD_DIR_HESTIAPHP/usr/local/hestia/php
|
|
|
|
|
+ fi
|
|
|
|
|
|
|
|
- # copy binary
|
|
|
|
|
- [ "$HESTIA_DEBUG" ] && echo DEBUG: cp $BUILD_DIR_HESTIAPHP/usr/local/hestia/php/sbin/php-fpm $BUILD_DIR_HESTIAPHP/usr/local/hestia/php/sbin/hestia-php
|
|
|
|
|
- cp $BUILD_DIR_HESTIAPHP/usr/local/hestia/php/sbin/php-fpm $BUILD_DIR_HESTIAPHP/usr/local/hestia/php/sbin/hestia-php
|
|
|
|
|
|
|
+ [ "$HESTIA_DEBUG" ] && echo DEBUG: mv ${BUILD_DIR}/usr/local/hestia/php ${BUILD_DIR_HESTIAPHP}/usr/local/hestia/
|
|
|
|
|
+ mv ${BUILD_DIR}/usr/local/hestia/php ${BUILD_DIR_HESTIAPHP}/usr/local/hestia/
|
|
|
|
|
|
|
|
- # Change permissions and build the package
|
|
|
|
|
- chown -R root:root $BUILD_DIR_HESTIAPHP
|
|
|
|
|
|
|
+ # copy binary
|
|
|
|
|
+ [ "$HESTIA_DEBUG" ] && echo DEBUG: cp $BUILD_DIR_HESTIAPHP/usr/local/hestia/php/sbin/php-fpm $BUILD_DIR_HESTIAPHP/usr/local/hestia/php/sbin/hestia-php
|
|
|
|
|
+ cp $BUILD_DIR_HESTIAPHP/usr/local/hestia/php/sbin/php-fpm $BUILD_DIR_HESTIAPHP/usr/local/hestia/php/sbin/hestia-php
|
|
|
|
|
|
|
|
- if [ "$BUILD_DEB" = true ]; then
|
|
|
|
|
|
|
+ # Change permissions and build the package
|
|
|
|
|
+ chown -R root:root $BUILD_DIR_HESTIAPHP
|
|
|
# Get Debian package files
|
|
# Get Debian package files
|
|
|
[ "$HESTIA_DEBUG" ] && echo DEBUG: mkdir -p $BUILD_DIR_HESTIAPHP/DEBIAN
|
|
[ "$HESTIA_DEBUG" ] && echo DEBUG: mkdir -p $BUILD_DIR_HESTIAPHP/DEBIAN
|
|
|
mkdir -p $BUILD_DIR_HESTIAPHP/DEBIAN
|
|
mkdir -p $BUILD_DIR_HESTIAPHP/DEBIAN
|
|
@@ -575,36 +575,35 @@ if [ "$PHP_B" = true ]; then
|
|
|
echo Building PHP DEB
|
|
echo Building PHP DEB
|
|
|
[ "$HESTIA_DEBUG" ] && echo DEBUG: dpkg-deb -Zxz --build $BUILD_DIR_HESTIAPHP $DEB_DIR
|
|
[ "$HESTIA_DEBUG" ] && echo DEBUG: dpkg-deb -Zxz --build $BUILD_DIR_HESTIAPHP $DEB_DIR
|
|
|
dpkg-deb -Zxz --build $BUILD_DIR_HESTIAPHP $DEB_DIR
|
|
dpkg-deb -Zxz --build $BUILD_DIR_HESTIAPHP $DEB_DIR
|
|
|
|
|
+
|
|
|
|
|
+ rm -r $BUILD_DIR/usr
|
|
|
|
|
+
|
|
|
|
|
+ # clear up the source folder
|
|
|
|
|
+ if [ "$KEEPBUILD" != 'true' ]; then
|
|
|
|
|
+ rm -r $BUILD_DIR/php-$(echo $PHP_V | cut -d"~" -f1)
|
|
|
|
|
+ rm -r $BUILD_DIR_HESTIAPHP
|
|
|
|
|
+ if [ "$use_src_folder" == 'true' ] && [ -d $BUILD_DIR/hestiacp-$branch_dash ]; then
|
|
|
|
|
+ rm -r $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
+ fi
|
|
|
|
|
+ fi
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
if [ "$BUILD_RPM" = true ]; then
|
|
if [ "$BUILD_RPM" = true ]; then
|
|
|
# Get RHEL package files
|
|
# Get RHEL package files
|
|
|
- get_branch_file 'src/rpm/php/hestia-php.spec' "${BUILD_DIR_HESTIAPHP}/hestia-php.spec"
|
|
|
|
|
- sed -i "s/%HESTIA-PHP-VERSION%/${PHP_V}/g" "${BUILD_DIR_HESTIAPHP}/hestia-php.spec"
|
|
|
|
|
- get_branch_file 'src/rpm/php/hestia-php.service' "${BUILD_DIR_HESTIAPHP}/hestia-php.service"
|
|
|
|
|
|
|
+ get_branch_file 'src/rpm/php/php-fpm.conf' "$HOME/rpmbuild/SOURCES/php-fpm.conf"
|
|
|
|
|
+ get_branch_file 'src/rpm/php/php.ini' "$HOME/rpmbuild/SOURCES/php.ini"
|
|
|
|
|
+ get_branch_file 'src/rpm/php/hestia-php.spec' "$HOME/rpmbuild/SPECS/hestia-php.spec"
|
|
|
|
|
+ get_branch_file 'src/rpm/php/hestia-php.service' "$HOME/rpmbuild/SOURCES/hestia-php.service"
|
|
|
|
|
|
|
|
- # Get custom config
|
|
|
|
|
- get_branch_file 'src/rpm/php/php-fpm.conf' "${BUILD_DIR_HESTIAPHP}/usr/local/hestia/php/etc/php-fpm.conf"
|
|
|
|
|
- get_branch_file 'src/rpm/php/php.ini' "${BUILD_DIR_HESTIAPHP}/usr/local/hestia/php/lib/php.ini"
|
|
|
|
|
|
|
+ # Download source files
|
|
|
|
|
+ download_file $PHP "$HOME/rpmbuild/SOURCES/"
|
|
|
|
|
|
|
|
# Build RPM package
|
|
# Build RPM package
|
|
|
- mkdir -p $BUILD_DIR/rpmbuild
|
|
|
|
|
echo Building PHP RPM
|
|
echo Building PHP RPM
|
|
|
- rpmbuild -bb --define "sourcedir $BUILD_DIR_HESTIAPHP" --buildroot=$BUILD_DIR/rpmbuild/ ${BUILD_DIR_HESTIAPHP}/hestia-php.spec > ${BUILD_DIR_HESTIAPHP}.rpm.log
|
|
|
|
|
- cp ~/rpmbuild/RPMS/$(arch)/hestia-php-*.rpm $RPM_DIR
|
|
|
|
|
- rm ~/rpmbuild/RPMS/$(arch)/hestia-php-*.rpm
|
|
|
|
|
- rm -rf $BUILD_DIR/rpmbuild
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
- rm -r $BUILD_DIR/usr
|
|
|
|
|
-
|
|
|
|
|
- # clear up the source folder
|
|
|
|
|
- if [ "$KEEPBUILD" != 'true' ]; then
|
|
|
|
|
- rm -r $BUILD_DIR/php-$(echo $PHP_V | cut -d"~" -f1)
|
|
|
|
|
- rm -r $BUILD_DIR_HESTIAPHP
|
|
|
|
|
- if [ "$use_src_folder" == 'true' ] && [ -d $BUILD_DIR/hestiacp-$branch_dash ]; then
|
|
|
|
|
- rm -r $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ rpmbuild -bs ~/rpmbuild/SPECS/hestia-php.spec
|
|
|
|
|
+ mock -r rocky+epel-9-$(arch) ~/rpmbuild/SRPMS/hestia-php-$PHP_V-1.el9.src.rpm
|
|
|
|
|
+ cp /var/lib/mock/rocky+epel-9-$(arch)/result/*.rpm $RPM_DIR
|
|
|
|
|
+ rm -rf ~/rpmbuild/SPECS/* ~/rpmbuild/SOURCES/* ~/rpmbuild/SRPMS/*
|
|
|
fi
|
|
fi
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
@@ -623,49 +622,48 @@ if [ "$HESTIA_B" = true ]; then
|
|
|
for BUILD_ARCH in $arch; do
|
|
for BUILD_ARCH in $arch; do
|
|
|
echo "Building Hestia Control Panel package..."
|
|
echo "Building Hestia Control Panel package..."
|
|
|
|
|
|
|
|
- BUILD_DIR_HESTIA=$BUILD_DIR/hestia_$HESTIA_V
|
|
|
|
|
-
|
|
|
|
|
- # Change to build directory
|
|
|
|
|
- cd $BUILD_DIR
|
|
|
|
|
|
|
+ if [ "$BUILD_DEB" = true ]; then
|
|
|
|
|
+ BUILD_DIR_HESTIA=$BUILD_DIR/hestia_$HESTIA_V
|
|
|
|
|
|
|
|
- if [ "$KEEPBUILD" != 'true' ] || [ ! -d "$BUILD_DIR_HESTIA" ]; then
|
|
|
|
|
- # Check if target directory exist
|
|
|
|
|
- if [ -d $BUILD_DIR_HESTIA ]; then
|
|
|
|
|
- rm -r $BUILD_DIR_HESTIA
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ # Change to build directory
|
|
|
|
|
+ cd $BUILD_DIR
|
|
|
|
|
|
|
|
- # Create directory
|
|
|
|
|
- mkdir -p $BUILD_DIR_HESTIA
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ if [ "$KEEPBUILD" != 'true' ] || [ ! -d "$BUILD_DIR_HESTIA" ]; then
|
|
|
|
|
+ # Check if target directory exist
|
|
|
|
|
+ if [ -d $BUILD_DIR_HESTIA ]; then
|
|
|
|
|
+ rm -r $BUILD_DIR_HESTIA
|
|
|
|
|
+ fi
|
|
|
|
|
|
|
|
- cd $BUILD_DIR
|
|
|
|
|
- rm -rf $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
- # Download and unpack source files
|
|
|
|
|
- if [ "$use_src_folder" == 'true' ]; then
|
|
|
|
|
- [ "$HESTIA_DEBUG" ] && echo DEBUG: cp -rf "$SRC_DIR/" $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
- cp -rf "$SRC_DIR/" $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
- elif [ -d $SRC_DIR ]; then
|
|
|
|
|
- download_file $HESTIA_ARCHIVE_LINK '-' 'fresh' | tar xz
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ # Create directory
|
|
|
|
|
+ mkdir -p $BUILD_DIR_HESTIA
|
|
|
|
|
+ fi
|
|
|
|
|
|
|
|
- mkdir -p $BUILD_DIR_HESTIA/usr/local/hestia
|
|
|
|
|
|
|
+ cd $BUILD_DIR
|
|
|
|
|
+ rm -rf $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
+ # Download and unpack source files
|
|
|
|
|
+ if [ "$use_src_folder" == 'true' ]; then
|
|
|
|
|
+ [ "$HESTIA_DEBUG" ] && echo DEBUG: cp -rf "$SRC_DIR/" $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
+ cp -rf "$SRC_DIR/" $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
+ elif [ -d $SRC_DIR ]; then
|
|
|
|
|
+ download_file $HESTIA_ARCHIVE_LINK '-' 'fresh' | tar xz
|
|
|
|
|
+ fi
|
|
|
|
|
|
|
|
- # Move needed directories
|
|
|
|
|
- cd $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
- cp -rf bin func install web $BUILD_DIR_HESTIA/usr/local/hestia/
|
|
|
|
|
|
|
+ mkdir -p $BUILD_DIR_HESTIA/usr/local/hestia
|
|
|
|
|
|
|
|
- # Set permissions
|
|
|
|
|
- find $BUILD_DIR_HESTIA/usr/local/hestia/ -type f -exec chmod -x {} \;
|
|
|
|
|
|
|
+ # Move needed directories
|
|
|
|
|
+ cd $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
+ cp -rf bin func install web $BUILD_DIR_HESTIA/usr/local/hestia/
|
|
|
|
|
|
|
|
- # Allow send email via /usr/local/hestia/web/inc/mail-wrapper.php via cli
|
|
|
|
|
- chmod +x $BUILD_DIR_HESTIA/usr/local/hestia/web/inc/mail-wrapper.php
|
|
|
|
|
- # Allow the executable to be executed
|
|
|
|
|
- chmod +x $BUILD_DIR_HESTIA/usr/local/hestia/bin/*
|
|
|
|
|
- find $BUILD_DIR_HESTIA/usr/local/hestia/install/ \( -name '*.sh' \) -exec chmod +x {} \;
|
|
|
|
|
- chmod -x $BUILD_DIR_HESTIA/usr/local/hestia/install/*.sh
|
|
|
|
|
- chown -R root:root $BUILD_DIR_HESTIA
|
|
|
|
|
|
|
+ # Set permissions
|
|
|
|
|
+ find $BUILD_DIR_HESTIA/usr/local/hestia/ -type f -exec chmod -x {} \;
|
|
|
|
|
|
|
|
- if [ "$BUILD_DEB" = true ]; then
|
|
|
|
|
|
|
+ # Allow send email via /usr/local/hestia/web/inc/mail-wrapper.php via cli
|
|
|
|
|
+ chmod +x $BUILD_DIR_HESTIA/usr/local/hestia/web/inc/mail-wrapper.php
|
|
|
|
|
+ # Allow the executable to be executed
|
|
|
|
|
+ chmod +x $BUILD_DIR_HESTIA/usr/local/hestia/bin/*
|
|
|
|
|
+ find $BUILD_DIR_HESTIA/usr/local/hestia/install/ \( -name '*.sh' \) -exec chmod +x {} \;
|
|
|
|
|
+ chmod -x $BUILD_DIR_HESTIA/usr/local/hestia/install/*.sh
|
|
|
|
|
+ chown -R root:root $BUILD_DIR_HESTIA
|
|
|
# Get Debian package files
|
|
# Get Debian package files
|
|
|
mkdir -p $BUILD_DIR_HESTIA/DEBIAN
|
|
mkdir -p $BUILD_DIR_HESTIA/DEBIAN
|
|
|
get_branch_file 'src/deb/hestia/control' "$BUILD_DIR_HESTIA/DEBIAN/control"
|
|
get_branch_file 'src/deb/hestia/control' "$BUILD_DIR_HESTIA/DEBIAN/control"
|
|
@@ -680,29 +678,34 @@ if [ "$HESTIA_B" = true ]; then
|
|
|
|
|
|
|
|
echo Building Hestia DEB
|
|
echo Building Hestia DEB
|
|
|
dpkg-deb -Zxz --build $BUILD_DIR_HESTIA $DEB_DIR
|
|
dpkg-deb -Zxz --build $BUILD_DIR_HESTIA $DEB_DIR
|
|
|
|
|
+
|
|
|
|
|
+ # clear up the source folder
|
|
|
|
|
+ if [ "$KEEPBUILD" != 'true' ]; then
|
|
|
|
|
+ rm -r $BUILD_DIR_HESTIA
|
|
|
|
|
+ rm -rf hestiacp-$branch_dash
|
|
|
|
|
+ fi
|
|
|
|
|
+ cd $BUILD_DIR/hestiacp-$branch_dash
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
if [ "$BUILD_RPM" = true ]; then
|
|
if [ "$BUILD_RPM" = true ]; then
|
|
|
|
|
+ # Pre-clean
|
|
|
|
|
+ rm -rf ~/rpmbuild/SOURCES/*
|
|
|
|
|
+
|
|
|
# Get RHEL package files
|
|
# Get RHEL package files
|
|
|
- get_branch_file 'src/rpm/hestia/hestia.spec' "${BUILD_DIR_HESTIA}/hestia.spec"
|
|
|
|
|
- sed -i "s/%HESTIA-VERSION%/${HESTIA_V}/g" "${BUILD_DIR_HESTIA}/hestia.spec"
|
|
|
|
|
- get_branch_file 'src/rpm/hestia/hestia.service' "${BUILD_DIR_HESTIA}/hestia.service"
|
|
|
|
|
|
|
+ get_branch_file 'src/rpm/hestia/hestia.spec' "$HOME/rpmbuild/SPECS/hestia.spec"
|
|
|
|
|
+ get_branch_file 'src/rpm/hestia/hestia.service' "$HOME/rpmbuild/SOURCES/hestia.service"
|
|
|
|
|
+
|
|
|
|
|
+ # Generate source tar.gz
|
|
|
|
|
+ tar -czf $HOME/rpmbuild/SOURCES/hestia-$BUILD_VER.tar.gz -C $SRC_DIR/.. hestiacp
|
|
|
|
|
|
|
|
# Build RPM package
|
|
# Build RPM package
|
|
|
- mkdir -p $BUILD_DIR/rpmbuild
|
|
|
|
|
echo Building Hestia RPM
|
|
echo Building Hestia RPM
|
|
|
- rpmbuild -bb --define "sourcedir $BUILD_DIR_HESTIA" --buildroot=$BUILD_DIR/rpmbuild/ ${BUILD_DIR_HESTIA}/hestia.spec > ${BUILD_DIR_HESTIA}.rpm.log
|
|
|
|
|
- cp ~/rpmbuild/RPMS/$(arch)/hestia-*.rpm $RPM_DIR
|
|
|
|
|
- rm ~/rpmbuild/RPMS/$(arch)/hestia-*.rpm
|
|
|
|
|
- rm -rf $BUILD_DIR/rpmbuild
|
|
|
|
|
|
|
+ rpmbuild -bs ~/rpmbuild/SPECS/hestia.spec
|
|
|
|
|
+ mock -r rocky+epel-9-$(arch) ~/rpmbuild/SRPMS/hestia-$BUILD_VER-1.el9.src.rpm
|
|
|
|
|
+ cp /var/lib/mock/rocky+epel-9-$(arch)/result/*.rpm $RPM_DIR
|
|
|
|
|
+ rm -rf ~/rpmbuild/SPECS/* ~/rpmbuild/SOURCES/* ~/rpmbuild/SRPMS/*
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
- # clear up the source folder
|
|
|
|
|
- if [ "$KEEPBUILD" != 'true' ]; then
|
|
|
|
|
- rm -r $BUILD_DIR_HESTIA
|
|
|
|
|
- rm -rf hestiacp-$branch_dash
|
|
|
|
|
- fi
|
|
|
|
|
- cd $BUILD_DIR/hestiacp-$branch_dash
|
|
|
|
|
done
|
|
done
|
|
|
fi
|
|
fi
|
|
|
|
|
|