autobuildrequires man page
autobuildrequires — Work out the BuildRequires of an RPM build automatically
auto-br-rpmbuild -ba foo.spec auto-br [build-command ...]
Autobuildrequires analyzes an RPM package build to find out what BuildRequires lines it needs.
Instead of using
"rpmbuild", use this command:
auto-br-rpmbuild -ba foo.spec
(all the usual rpmbuild flags are supported). The command will build your package and then output a list of
"BuildRequires" lines that it thinks your package needs.
If your build command is more complex and/or doesn't use rpmbuild, then use:
auto-br [build-command ...]
How It Works
The basic "magic" is a C
"LD_PRELOAD" module, auto-buildrequires-preload.c, which intercepts some system calls to determine which files the build is looking at. Those get logged to a simple text file.
The Perl analysis script, auto-br-analyze.pl, runs afterwards on the logfile, and uses rpm to find out which packages those files belong to. Those are printed out as the list of BuildRequires.
A shell script, auto-br, brings the whole thing together.
This program returns 0 if successful, or non-zero if there was an error.
Richard W.M. Jones <http://people.redhat.com/~rjones/>
Copyright (C) 2008-2015 Red Hat Inc.
auto-br(1) and auto-br-rpmbuild(1) are aliases of autobuildrequires(1).