RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2112392 - macros: add new distribution-specific macros for package configurations
Summary: macros: add new distribution-specific macros for package configurations
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: redhat-release
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Stephen Gallagher
QA Contact: Release Test Team
: 2136410 2137741 2137757 2138300 2139025 2139157 2139311 2141059 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2022-07-29 15:08 UTC by Amit Shah
Modified: 2023-05-09 09:28 UTC (History)
26 users (show)

Fixed In Version: redhat-release-9.2-0.8.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2023-05-09 07:55:29 UTC
Type: Bug
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELBLD-10561 0 None None None 2022-07-29 15:26:09 UTC
Red Hat Issue Tracker RHELPLAN-129687 0 None None None 2022-07-29 15:26:13 UTC
Red Hat Issue Tracker RTT-4859 0 None None None 2022-09-22 12:42:36 UTC
Red Hat Issue Tracker RTT-4860 0 None None None 2022-09-22 12:42:39 UTC
Red Hat Product Errata RHBA-2023:2455 0 None None None 2023-05-09 07:55:35 UTC

Description Amit Shah 2022-07-29 15:08:49 UTC
Description of problem:

Define macros for commonly-used strings/urls to distinguish
distributions. Spec files have lots of `%{?fedora:}` and `%{?rhel}`
conditionals which can be defined in one place.

A commit was recently merged to Fedora: 

For changes using those values to actually work, the existing downstreams of Fedora that define %rhel need to add these.

This bz is to track changes in centos-release in Centos Stream.

A similar change will have to be made to redhat-release as well in RHEL sources.  (I do not have access to rhel sources, so this will need to be done by someone else.)

The main benefit of this change is to consolidate spec files and reduce customizations.

Examples where this change will benefit are in gdb.spec, elfutils.spec, clang.spec, gcc.spec.

Note: The component list does not have a 'centos-release' package, so I'm selecting redhat-release here.

Comment 1 Amit Shah 2022-07-29 15:10:33 UTC
The commit intended for CentOS is https://gitlab.com/amitshah/centos-release/-/commit/a16382bdea9c554741a63a4fb2b1f4a685422073.

Comment 5 Pavel Holica 2022-09-22 11:53:21 UTC
I've tried to verify the fix with redhat-release-9.2-0.5.el9, however, I've hit an issue while evaluating dist_debuginfod_url as it's not substituted in RHEL.

# rpm -E '%{dist_vendor}'
Red Hat, Inc.
# rpm -E '%{dist_name}'
Red Hat Enterprise Linux
# rpm -E '%{dist_home_url}'
# rpm -E '%{dist_bug_report_url}'
# rpm -E '%{dist_debuginfod_url}'
error: Too many levels of recursion in macro expansion. It is likely caused by recursive macro declaration.

# cat /usr/lib/rpm/macros.d/macros.dist
# dist macros.

%rhel 9
%__bootstrap         ~bootstrap
%dist %{!?distprefix0:%{?distprefix}}%{expand:%{lua:for i=0,9999 do print("%{?distprefix" .. i .."}") end}}.el9%{?distsuffix}%{?with_bootstrap:~bootstrap}
%el9 1
%dist_vendor         Red Hat, Inc.
%dist_name           Red Hat Enterprise Linux
%dist_home_url       https://www.redhat.com/
%dist_bug_report_url https://bugzilla.redhat.com/
%dist_debuginfod_url %{dist_debuginfod_url}

Comment 8 amitshah 2022-09-24 12:09:40 UTC
Thanks, Florian and Stephen pushing this through!  I owe you some beers :)

Pavel - I believe the lack of the dist_debuginfod_url macro in RHEL is expected -- according to the discussion in https://src.fedoraproject.org/rpms/elfutils/pull-request/9#comment-111860 CentOS and Fedora have a debuginfod server, and the macro is expected to be set there; but RHEL does not have one.

I suppose your test should confirm that this macro isn't set in RHEL -- just to ensure one doesn't sneak in by accident.

Comment 11 Pavel Holica 2022-10-20 11:28:31 UTC
Unfortuantely, is seem that this is still not implemented properly as we're hitting now following error when rpm is used:
error: /usr/lib/rpm/macros.d/macros.dist: line 11: Macro %dist_debuginfod_url has empty body

Moving back to assigned, please fix this.

Comment 12 Pavel Holica 2022-10-20 11:29:35 UTC
*** Bug 2136410 has been marked as a duplicate of this bug. ***

Comment 15 Panu Matilainen 2022-10-26 05:40:43 UTC
*** Bug 2137741 has been marked as a duplicate of this bug. ***

Comment 16 Michal Domonkos 2022-10-26 07:47:16 UTC
*** Bug 2137757 has been marked as a duplicate of this bug. ***

Comment 17 Pavel Holica 2022-10-31 06:39:15 UTC
*** Bug 2138300 has been marked as a duplicate of this bug. ***

Comment 22 Pavel Holica 2022-11-01 06:38:14 UTC
*** Bug 2139025 has been marked as a duplicate of this bug. ***

Comment 24 Pavel Holica 2022-11-02 06:28:17 UTC
*** Bug 2139157 has been marked as a duplicate of this bug. ***

Comment 25 Pavel Holica 2022-11-02 07:23:40 UTC
*** Bug 2139311 has been marked as a duplicate of this bug. ***

Comment 26 Pavel Holica 2022-11-09 07:05:44 UTC
*** Bug 2141059 has been marked as a duplicate of this bug. ***

Comment 30 errata-xmlrpc 2023-05-09 07:55:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (redhat-release bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.