Bug 2112392 - macros: add new distribution-specific macros for package configurations
Summary: macros: add new distribution-specific macros for package configurations
Keywords:
Status: ON_QA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: redhat-release
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Stephen Gallagher
QA Contact: Release Test Team
URL:
Whiteboard:
: 2136410 2137741 2137757 2138300 2139025 2139157 2139311 2141059 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-29 15:08 UTC by Amit Shah
Modified: 2022-11-30 14:26 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:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
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

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: 
https://src.fedoraproject.org/rpms/fedora-release/pull-request/223

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}'
https://www.redhat.com/
# rpm -E '%{dist_bug_report_url}'
https://bugzilla.redhat.com/
# 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. ***


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