According to <a href="file:///usr/share/doc/rpm-4.0.4/apidocs/tsort.html">file:///usr/share/doc/rpm-4.0.4/apidocs/tsort.html</a>
rpm allows BuildRequires-specialization for sections. I suggest to use it in the output of buildreq.
I have a reason for this: now, when BuildRequires are not specialized, rpmbuild often doesn\'t want to proceed with some action like \"--clean\" because some of the BuildRequires are not there. This is inconvenient because in most cases the packages listed in BuildRequires are not really required for %clean or a certain other action.
I suggest that buildreq generates three kinds of build-dependencies:
first, it traces something like \'rpmbuild -bE\' and sees what is required to preprocess the spec; these dependencies are written as BuildPreReq. Then it traces %prep and writes BuildRequires(prep) and then it traces %build and writes BuiildRequires(build).
Isn't it better to fix --clean? The thing is, rpmbuild -bs usually won't need BuildRequires either (might need BuildPreReq though) and still one would cope with --nodeps just to wrap up an srpm.