Chapter 6. New features in RHEL 9 This section documents the most notable changes in RPM packaging between Red Hat Enterprise Linux 8 and 9. 6.1. Dynamic build dependencies Red Hat Enterprise Linux 9 introduces the %generate_buildrequires section that enables generating dynamic build dependencies. Additional build dependencies can now be generated programmatically at RPM build time, using the newly available %generate_buildrequires script. This is useful when packaging software written in a language in which a specialized utility is commonly used to determine run-time or build-time dependencies, such as Rust, Golang, Node.js, Ruby, Python, or Haskell. You can use the %generate_buildrequires script to dynamically determine which BuildRequires directives are added to a SPEC file at build-time. If present, %generate_buildrequires is executed after the %prep section and can access the unpacked and patched source files. The script must print the found build dependencies to standard output using the same syntax as a regular BuildRequires directive. The rpmbuild utility then checks if the dependencies are met before continuing the build. If some dependencies are missing, a package with the .buildreqs.nosrc.rpm suffix is created, which contains the found BuildRequires and no source files. You can use this package to install the missing build dependencies with the dnf builddep command before restarting the build. For more information, see the DYNAMIC BUILD DEPENDENCIES section in the rpmbuild(8) man page. Additional resources rpmbuild(8) man page yum-builddep(1) man page 6.2. Improved patch declaration 6.2.1. Optional automatic patch and source numbering The Patch: and Source: tags without a number are now automatically numbered based on the order in which they are listed. The numbering is run internally by the rpmbuild utility starting from the last manually numbered entry, or 0 if there is no such entry. For example: 6.2.2. %patchlist and %sourcelist sections It is now possible to list patch and source files without preceding each item with the respective Patch: and Source: tags by using the newly added %patchlist and %sourcelist sections. For example, the following entries: can now be replaced with: 6.2.3. %autopatch now accepts patch ranges The %autopatch macro now accepts the -m and -M parameters to limit the minimum and maximum patch number to apply, respectively: The -m parameter specifies the patch number (inclusive) to start at when applying patches. The -M parameter specifies the patch number (inclusive) to stop at when applying patches. This feature can be useful when an action needs to be performed in between certain patch sets. 6.3. Other features Other new features related to RPM packaging in Red Hat Enterprise Linux 9 include: Fast macro-based dependency generators Powerful macro and %if expressions, including ternary operator and native version comparison Meta (unordered) dependencies Caret version operator ( ^ ), which can be used to express a version that is higher than the base version. This operator complements the tilde ( ~ ) operator, which has the opposite semantics. %elif , %elifos and %elifarch statements

Commands:
Patch: one.patch Patch: another.patch Patch: yet-another.patch
Patch0: one.patch Patch1: another.patch Patch2: yet-another.patch
%patchlist one.patch another.patch yet-another.patch