Opened 7 years ago

Closed 7 years ago

#1337 closed defect (fixed)

pkg-oss: `dist` macro changes on CentOS 7 break nginx-module packages

Reported by: davidjb Owned by: Andrei Belov
Priority: minor Milestone:
Component: nginx-package Version: 1.13.x
Keywords: Cc:
uname -a: Linux a26ace3868c3 4.9.36-moby #1 SMP Wed Jul 12 15:29:07 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: pkg-oss

Description

With CentOS 7, the {?dist} macro has changed within spec files from .e7 to .e7.centos. This means that any packages built with the current version of pkg-oss on CentOS 7 have their dependency set on nginx with this dist suffix included like so:

    nginx = 1.12.1-1.el7.centos.ngx

This causes a problem because this dependency is not correct as the EL7 releases for nginx are named like so:

    nginx = 1:1.12.1-1.el7.ngx

The result is that if you try and install a built module whilst having the main nginx yum repo configured, the following failure occurs:

Marking /root/rpmbuild/RPMS/x86_64/nginx-module-shibboleth-debuginfo-1.12.1-1.el7.centos.ngx.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package nginx-module-shibboleth.x86_64 1:1.12.1-1.el7.centos.ngx will be installed
--> Processing Dependency: nginx = 1:1.12.1-1.el7.centos.ngx for package: 1:nginx-module-shibboleth-1.12.1-1.el7.centos.ngx.x86_64
Loading mirror speeds from cached hostfile
 * base: mirror.intergrid.com.au
 * extras: mirror.aarnet.edu.au
 * updates: mirror.overthewire.com.au
---> Package nginx-module-shibboleth-debuginfo.x86_64 1:1.12.1-1.el7.centos.ngx will be installed
--> Finished Dependency Resolution
Error: Package: 1:nginx-module-shibboleth-1.12.1-1.el7.centos.ngx.x86_64 (/nginx-module-shibboleth-1.12.1-1.el7.centos.ngx.x86_64)
           Requires: nginx = 1:1.12.1-1.el7.centos.ngx
           Available: 1:nginx-1.8.0-1.el7.ngx.x86_64 (nginx)
               nginx = 1:1.8.0-1.el7.ngx
           Available: 1:nginx-1.8.1-1.el7.ngx.x86_64 (nginx)
               nginx = 1:1.8.1-1.el7.ngx
           Available: 1:nginx-1.10.0-1.el7.ngx.x86_64 (nginx)
               nginx = 1:1.10.0-1.el7.ngx
           Available: 1:nginx-1.10.1-1.el7.ngx.x86_64 (nginx)
               nginx = 1:1.10.1-1.el7.ngx
           Available: 1:nginx-1.10.2-1.el7.ngx.x86_64 (nginx)
               nginx = 1:1.10.2-1.el7.ngx
           Available: 1:nginx-1.10.3-1.el7.ngx.x86_64 (nginx)
               nginx = 1:1.10.3-1.el7.ngx
           Available: 1:nginx-1.12.0-1.el7.ngx.x86_64 (nginx)
               nginx = 1:1.12.0-1.el7.ngx
           Available: 1:nginx-1.12.1-1.el7.ngx.x86_64 (nginx)
               nginx = 1:1.12.1-1.el7.ngx
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

The change stems from https://bugs.centos.org/view.php?id=7416 so to fix the issue (or at least workaround it), I've taken to adding the following %define into the pkg-oss's nginx-module.spec.in file:

%if 0%{?rhel} == 7
 [...snip...]
# CentOS 7 specifies dist as ".el7.centos" (https://bugs.centos.org/view.php?id=7416)
# but releases for nginx are just ".el7" so force this.
%define dist .el7
%endif

Could this change be applied to the nginx-module.spec.in file? Thanks.

Change History (4)

comment:1 by Andrei Belov, 7 years ago

Status: newaccepted

comment:2 by Andrei Belov, 7 years ago

Owner: set to Andrei Belov
Status: acceptedassigned

comment:3 by Andrei Belov, 7 years ago

Component: othernginx-package

comment:4 by Andrei Belov, 7 years ago

Resolution: fixed
Status: assignedclosed

Thanks for reporting this. We've been using an override for dist in .rpmmacros file on our build hosts for a while. Since https://hg.nginx.org/pkg-oss/rev/b7d0c7c49a78 there's also explicit (re)definition in spec files as well.

Note: See TracTickets for help on using tickets.