Remove legacy "%global preferred over %define" guideline #1541

Merged
james merged 1 commit from gotmax23/packaging-guidelines:global-req into main 2026-05-28 16:35:54 +00:00

View file

@ -2161,25 +2161,6 @@ Note: If you call Perl or Python in your spec file
(and it is not already a BuildRequires for the package),
you need to explicitly add a BuildRequires for Perl or Python.
== `+%global+` Preferred Over `+%define+`
Use `+%global+` instead of `+%define+`,
unless you really need only locally defined submacros
within other macro definitions (a very rare case).
Rationale: The two macro defining statements behave the same
when they are at the top level of rpm's nesting level.
But when they are used in nested macro expansions
(like in `+%{!?foo: ... }+` constructs,
`+%define+` theoretically only lasts until the end brace (local scope),
while `+%global+` definitions have global scope.
Note that %define and %global differ in more ways than just scope:
the body of a %define'd macro is lazily expanded (i.e., when used),
but the body of %global is expanded at definition time.
It's possible to use %%-escaping to force lazy expansion of %global.
[#handling_locale_files]
== Handling Locale Files