Rechercher

Chapitre 5. New features in RHEL 9

download PDF

This section documents the most notable changes in RPM packaging between Red Hat Enterprise Linux 8 and 9.

5.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.

Ressources supplémentaires

  • rpmbuild(8) man page
  • yum-builddep(1) man page
Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.