After fiddling around with rpmbuild
for quite a while, I stumbled upon yum-builddep
. It’s basically a tool to install all packages required to rebuild an RPM package from the SRPM. So if you want to install all “BuildRequires” mentioned in the spec file of a package, invoke
yum-builddep <package name>
The source RPM for the specified package must be available in the yum repository or it can be a local source RPM file.
yum-builddep
itself it part of the yum-utils
package. You can install it with yum
yum install yum-utils
See also yum-builddep manpage
This article can be updated to reference dnf.