Added manual build in script

This commit is contained in:
Alexey Berezhok
2026-06-21 23:54:33 +03:00
parent ffc5c20fee
commit 8c241b4075
3 changed files with 52 additions and 0 deletions

View File

@@ -188,3 +188,14 @@ server {
} }
``` ```
Or build manually using the build script, call it from the project root:
```
bash package_preparer.sh installdeps
bash package_preparer.sh download . system
bash package_preparer.sh build
bash package_preparer.sh installmod
```
You need to ensure that additional packages will be installed.

View File

@@ -188,3 +188,14 @@ server {
} }
} }
Или сборка руками с помощью сборочного скрипта, вызывать в корне проекта:
```
bash package_preparer.sh installdeps
bash package_preparer.sh download . system
bash package_preparer.sh build
bash package_preparer.sh installmod
```
Нужно учитывать, чтоб будут установлены дополнительные пакеты.

View File

@@ -172,6 +172,36 @@ EOF
download) download)
download_nginx "$2" "$3" download_nginx "$2" "$3"
;; ;;
installdeps)
# Determine package manager and install nginx
if command -v dnf >/dev/null 2>&1; then
PKG_MGR="dnf"
$PKG_MGR install -y nginx openssl-devel pcre-devel zlib-devel rpm-build gcc gcc-c++ make wget
elif command -v yum >/dev/null 2>&1; then
PKG_MGR="yum"
$PKG_MGR install -y nginx openssl-devel pcre-devel zlib-devel rpm-build gcc gcc-c++ make wget
elif command -v apt-get >/dev/null 2>&1; then
PKG_MGR="apt-get"
apt-get update
$PKG_MGR install -y nginx debhelper-compat dh-autoreconf libssl-dev libpcre2-dev zlib1g-dev make gcc build-essential wget
else
echo "Unsupported package manager."
exit 1
fi
;;
installmod)
if command -v dnf >/dev/null 2>&1 || command -v yum >/dev/null 2>&1; then
mkdir -p /usr/share/nginx/modules /etc/nginx/modules
cp *.so /usr/lib64/nginx/modules/
echo 'load_module "/usr/lib64/nginx/modules/ngx_http_apache_rewrite_module.so";' \
> /usr/share/nginx/modules/ngx_http_apache_rewrite_module.conf
else
mkdir -p /usr/share/nginx/modules/ /etc/nginx/modules
cp *.so /usr/share/nginx/modules/
echo 'load_module "/usr/share/nginx/modules/ngx_http_apache_rewrite_module.so";' \
> /etc/nginx/modules/ngx_http_apache_rewrite_module.conf
fi
;;
packageprep) packageprep)
PKG_MGR="" PKG_MGR=""
NGINX_CUSTOM_VER="$2" NGINX_CUSTOM_VER="$2"