Compare commits

...
Sign in to create a new pull request.

3 commits
main ... abi

Author SHA1 Message Date
Jérémy Lal
d7418a6a87
Include nginx version in abi from debian/rules 2022-12-20 11:01:06 +01:00
Jérémy Lal
e91cf82605
Fix tabs 2022-12-20 11:01:06 +01:00
Jérémy Lal
d57d47a19b
Provides/Depends nginx-abi-${nginx:abi} 2022-12-20 11:01:06 +01:00
5 changed files with 45 additions and 34 deletions

13
debian/control vendored
View file

@ -22,8 +22,7 @@ Rules-Requires-Root: no
Package: nginx
Architecture: all
Depends: nginx-core (<< ${source:Version}.1~) | nginx-full (<< ${source:Version}.1~) | nginx-light (<< ${source:Version}.1~) | nginx-extras (<< ${source:Version}.1~),
nginx-core (>= ${source:Version}) | nginx-full (>= ${source:Version}) | nginx-light (>= ${source:Version}) | nginx-extras (>= ${source:Version}),
Depends: nginx-abi-${nginx:abi},
${misc:Depends}
Description: small, powerful, scalable web/proxy server
Nginx ("engine X") is a high-performance web and reverse proxy server
@ -62,8 +61,6 @@ Package: nginx-dev
Architecture: all
Multi-Arch: foreign
Depends: ${misc:Depends}, ${S:Build-Depends},
nginx-core (<< ${source:Version}.1~) | nginx-light (<< ${source:Version}.1~) | nginx-extras (<< ${source:Version}.1~),
nginx-core (>= ${source:Version}) | nginx-light (>= ${source:Version}) | nginx-extras (>= ${source:Version})
Provides: dh-sequence-nginx
Description: nginx web/proxy server - development headers
Nginx ("engine X") is a high-performance web and reverse proxy server
@ -88,7 +85,7 @@ Depends: libnginx-mod-http-geoip (= ${binary:Version}),
${shlibs:Depends}
Breaks: nginx-full (<< 1.18.0-1),
Replaces: nginx-full (<< 1.18.0-1),
Provides: httpd, httpd-cgi, nginx
Provides: httpd, httpd-cgi, nginx, nginx-abi-${nginx:abi}
Conflicts: nginx-extras, nginx-light
Suggests: nginx-doc (= ${source:Version})
Description: nginx web/proxy server (standard version)
@ -126,7 +123,7 @@ Depends: libnginx-mod-http-auth-pam,
nginx-core (<< ${source:Version}.1~),
${misc:Depends},
${shlibs:Depends}
Provides: httpd, httpd-cgi, nginx
Provides: httpd, httpd-cgi, nginx, nginx-abi-${nginx:abi}
Suggests: nginx-doc (= ${source:Version})
Description: nginx web/proxy server (standard version with 3rd parties)
Nginx ("engine X") is a high-performance web and reverse proxy server
@ -160,7 +157,7 @@ Depends: libnginx-mod-http-echo (>= 1:0.63-3~),
iproute2,
${misc:Depends},
${shlibs:Depends}
Provides: httpd, httpd-cgi, nginx
Provides: httpd, httpd-cgi, nginx, nginx-abi-${nginx:abi}
Conflicts: nginx-extras, nginx-core
Suggests: nginx-doc (= ${source:Version})
Description: nginx web/proxy server (basic version)
@ -206,7 +203,7 @@ Depends: libnginx-mod-http-auth-pam (>= 1:1.5.3-2~),
iproute2,
${misc:Depends},
${shlibs:Depends}
Provides: httpd, httpd-cgi, nginx
Provides: httpd, httpd-cgi, nginx, nginx-abi-${nginx:abi}
Conflicts: nginx-core, nginx-light
Suggests: nginx-doc (= ${source:Version})
Description: nginx web/proxy server (extended version)

View file

@ -23,17 +23,22 @@
use strict;
use File::Find;
use Debian::Debhelper::Dh_Lib;
use Dpkg::Substvars;
=head1 NAME
dh_nginx - register configuration snippets to the nginx web server
=cut
my $abi;
sub nginx_depends
{
return 'nginx-common (= ${source:Version})'
if (!$abi) {
my $sv = Dpkg::Substvars->new();
$sv->load("/usr/share/nginx/src/debian/libnginx-mod.substvars");
$abi = $sv->get("nginx:abi");
}
return "nginx-abi-$abi";
}
sub nginx_api_installdir
@ -268,30 +273,24 @@ foreach my $package ((@{$dh{DOPACKAGES}}))
}
}
my @postinst_autoscripts;
my @postinst_autoscripts;
if ($#{$PACKAGE_TYPE{'has_a_module'}} >= 0)
{
if ($package !~ m/libnginx-mod-\w+?/)
{
warning("Package $package appears to be an Nginx module. It should comply to the package naming scheme libnginx-mod-<modulename>\n");
}
if ($nginx_in_tree){
addsubstvar($package, "misc:Depends", nginx_depends());
} else {
my $ngx_ver = `grep 'define NGINX_VERSION' /usr/share/nginx/src/src/core/nginx.h | sed -e 's/^.*"\\(.*\\)".*/\\1/'`;
chomp($ngx_ver);
addsubstvar($package, "misc:Depends", "nginx-common (>= $ngx_ver), nginx-common (<< $ngx_ver.1~)");
}
if ($#{$PACKAGE_TYPE{'has_a_module'}} >= 0)
{
if ($package !~ m/libnginx-mod-\w+?/)
{
warning("Package $package appears to be an Nginx module. It should comply to the package naming scheme libnginx-mod-<modulename>\n");
}
addsubstvar($package, "misc:Depends", nginx_depends());
my $modules = "";
foreach my $module (@{$PACKAGE_TYPE{'has_a_module'}})
{
$modules .= "$module ";
}
my $modules = "";
foreach my $module (@{$PACKAGE_TYPE{'has_a_module'}})
{
$modules .= "$module ";
}
push @postinst_autoscripts, ["module", $modules];
}
push @postinst_autoscripts, ["module", $modules];
}
if (! $dh{NOSCRIPTS})
{

View file

@ -37,8 +37,8 @@ sub new {
my $this= $class->SUPER::new(@_);
$this->prefer_out_of_source_building(@_);
$this->{has_ndk} = $this->has_build_dep("libnginx-mod-http-ndk-dev");
if ($this->{has_ndk} == 1){
foreach my $cur (getpackages('arch')) {
foreach my $cur (getpackages('arch')) {
if ($this->{has_ndk} == 1) {
addsubstvar($cur, "misc:Depends", "libnginx-mod-http-ndk");
}
}

View file

@ -2,6 +2,7 @@ debian/build-src/auto usr/share/nginx/src/
debian/build-src/src usr/share/nginx/src/
debian/build-src/conf_flags usr/share/nginx/src/
debian/build-src/configure usr/share/nginx/src/
debian/build-src/debian/libnginx-mod.substvars usr/share/nginx/src/debian/
debian/debhelper/nginx.pm usr/share/perl5/Debian/Debhelper/Sequence/
debian/debhelper/dh_nginx usr/bin/
debian/debhelper/nginx_mod.pm usr/share/perl5/Debian/Debhelper/Buildsystem/

14
debian/rules vendored
View file

@ -1,7 +1,16 @@
#!/usr/bin/make -f
export DH_VERBOSE=1
include /usr/share/dpkg/pkg-info.mk
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
# increase this value when DEB_VERSION_UPSTREAM is the same and ABI breaks because:
# - a patch might change it
# - a build-dependency has changed
# note that debian revision can increase without breaking ABI
nginx_abi = $(DEB_VERSION_UPSTREAM)-1
debian_cflags:=$(shell dpkg-buildflags --get CFLAGS) -fPIC $(shell dpkg-buildflags --get CPPFLAGS)
debian_ldflags:=$(shell dpkg-buildflags --get LDFLAGS) -fPIC
@ -123,6 +132,9 @@ override_dh_installsystemd:
override_dh_installlogrotate:
dh_installlogrotate --package nginx-common --name=nginx
override_dh_gencontrol:
dh_gencontrol -- -Tdebian/substvars -T$(BUILDDIR_src)/debian/libnginx-mod.substvars
build.arch.%:
$(MAKE) -C $(BUILDDIR_$*) build
@ -133,6 +145,8 @@ build.src:
if [ -e $(CURDIR)/configure ]; then cp $(CURDIR)/configure $(BUILDDIR_src)/; fi
echo "NGX_CONF_FLAGS=(" $(basic_configure_flags) ")" > $(BUILDDIR_src)/conf_flags
pod2man debian/debhelper/dh_nginx > $(BUILDDIR_src)/dh_nginx.1
mkdir -p $(BUILDDIR_src)/debian
echo "nginx:abi=$(nginx_abi)" > $(BUILDDIR_src)/debian/libnginx-mod.substvars
strip.arch.%:
dh_strip --package=nginx-$(*) -O--dbgsym-migration='nginx-$(*)-dbg (<< 1.10.1-3~)'