Red Hat Bugzilla – Bug 494422
rpmlint does not find empty "Requires:" tag
Last modified: 2009-04-06 16:19:41 EDT
rpmlint-0.85-2.fc10.noarch does not find an empty "Requires:" tag (suggesting automatic requires), but rpm refuses to build with "error: line xx: Empty tag: Requires:".
I'm not sure if this is a missing feature of rpmlint, or that rpmbuild is incorrect (i.e. should accept an empty Requires: tag for auto requires).
From http://fedoraproject.org/wiki/PackageMaintainers/CreatingPackageHowTo#Spec_file_pieces_explained :
"Requires: A comma-separate list of packages that are required when the program is installed. Note that the list of packages for Requires (what's required when running) and BuildRequires (what's required to build the binary RPM) are independent; a package may be in one list but not the other, or it could be in both. The "Requires" list is automatically determined by rpm, so normally you don't need to put anything here. But if you want to highlight some specific packages as being required, or require a package that rpm can't detect should be required, then add it here."
Empty "Requires:" is a specfile syntax error, therefore it does not make much sense to create a specific check in rpmlint - it'll be rejected by rpmbuild anyway. Current versions of rpmlint (0.87 will appear in the next update batch for F-10) will pass through possible error messages from rpm though:
$ rpmlint /home/scop/tmp/noreplace-perms-1.1.spec
/home/scop/tmp/noreplace-perms-1.1.spec: E: specfile-error error: line 7: Empty tag: Requires:
The information in Wiki is badly worded - it doesn't mean that one should leave the Requires tag empty, but that the tag shouldn't in cases where it's not needed be included at all. I reworded it, hopefully it's clearer now: