Added ability build for custom nginx version for distributive build

This commit is contained in:
Alexey Berezhok
2026-06-21 01:15:00 +03:00
parent 6bebc87323
commit ffc5c20fee
7 changed files with 147 additions and 5 deletions

33
packages/deb/control.sh Normal file
View File

@@ -0,0 +1,33 @@
#!/bin/bash
# This script generates the debian/control file with correct nginx version dependency
# Usage: control.sh [NGINX_VERSION]
# If NGINX_VERSION is not specified, it uses DETECTED_NGINX_VERSION from environment or default "1.24.0"
NGINX_VER="${1:-${DETECTED_NGINX_VERSION:-1.24.0}}"
cat > debian/control << EOF
Source: nginx-mod-rewrite
Section: web
Priority: optional
Maintainer: Alexey Berezhok <a@bayrepo.ru>
Build-Depends: debhelper-compat (=13),
dh-autoreconf,
libssl-dev,
libpcre2-dev,
zlib1g-dev,
nginx (=${NGINX_VER})
Standards-Version: 4.7.0
Homepage: https://docs.brepo.ru/nginx-mod_rewrite
Package: nginx-mod-rewrite
Architecture: any
Depends: \${shlibs:Depends}, nginx (=${NGINX_VER})
Provides: nginx-http-module, nginx-apache-rewrite
Description: Nginx rewrite module dynamic module adding mod_rewrite functionality
Dynamic Nginx module implementing Apache mod_rewrite functionality.
The package is built from Nginx sources and the module's own files, and then
installs only the compiled shared object into /etc/nginx/modules directory.
EOF
echo "Generated debian/control for nginx version: $NGINX_VER"

View File

@@ -0,0 +1,14 @@
Source: nginx-mod-rewrite
Section: web
Priority: optional
Maintainer: Alexey Berezhok <a@bayrepo.ru>
Build-Depends: debhelper (>= 13), bash, openssl-dev, libssl-dev
Standards-Version: 4.7.0
Homepage: https://docs.brepo.ru/nginx-mod_rewrite
Package: nginx-mod-rewrite
Architecture: any
Depends: ${shlibs:Depends}, nginx (>= 1.4.0)
Provides: nginx-http-module, nginx-apache-rewrite
Description: Nginx rewrite module dynamic module adding mod_rewrite functionality
Dynamic Nginx module implementing Apache mod_rewrite functionality.

View File

@@ -7,21 +7,26 @@ export DH_COMPAT=$(DEBHELPER_COMPAT)
export BUILD_DIR = debian/build
export INSTALDIR = debian/nginx-mod-rewrite/usr/share/nginx/modules
export CONFFDIR = debian/nginx-mod-rewrite/etc/nginx/modules
export DOCSDIR = debian/nginx-mod-rewrite/usr/share/info
# Package metadata (matches debian/control)
PACKAGE_NAME = nginx-mod-rewrite
# Set build options
override_dh_auto_build:
bash package_preparer.sh download . system
bash package_preparer.sh build
override_dh_auto_install:
mkdir -p $(INSTALDIR) $(CONFFDIR)
mkdir -p $(INSTALDIR) $(CONFFDIR) $(DOCSDIR)
cp *.so $(INSTALDIR)/
echo 'load_module "$(INSTALDIR)/ngx_http_apache_rewrite_module.so";' > \
$(CONFFDIR)/ngx_http_apache_rewrite_module.conf
cp BUILDINFO.txt $(DOCSDIR)/${PACKAGE_NAME}-BUILDINFO.txt
override_dh_auto_clean:
rm -rf debian/build
rm -f *.so
rm -f BUILDINFO.txt
rm -rf nginx-*
%: