Product: Fedora https://bugzilla.redhat.com/show_bug.cgi?id=903824 --- Comment #7 from Petr Šabata <psabata@xxxxxxxxxx> --- (In reply to comment #6) > Could you help me to fully understand how Requires and BuildRequires are > used in Fedora? > > 1) If I enter put requirement in Requires, it will be automatically used > also as BuildRequire. Do I understand this correctly? No, those two are unrelated. > 2) In bug 904328 you mentioned that Some requirements are not needed in > Requires field because rpmbuild automatically detects those requirements. > How can I detect what rpmbuild detects? The easiest and most reliable way is to build the package and check the resulting binary (not SRPM) for dependencies, e.g. rpm -q --requires -p your-package-1.2-3.fc19.noarch.rpm Currently, in case of perl packages, rpmbuild parses the packaged modules and tries to guess the perl() style dependencies. It works rather well for most cases and therefore you don't need to manually specify them in your spec file (usually). > 3) In bug 903826 you asked me to add build time dependency perl(base), > perl(constant) which actually is Perl pragma not module. When should I add > Perl pragmas like perl(warnings) and perl(strict) to Requires, when > shouldn't? Surprise, they're modules! :) https://metacpan.org/module/base https://metacpan.org/module/constant And requiring true pragmas wouldn't hurt (rpmbuild actually does that too) either since they are listed among the 'perl' package provides -- $ rpm -q --provides perl|grep -E '^perl\((strict|warnings)\)' perl(strict) = 1.07 perl(warnings) = 1.13 -- but given that they are and most likely always be parts of perl, I don't find it necessary. Some people build-require them explicitly, though. > 4) Shouldn't it be more correct to put all module requirements to Requires > field and all testing requirements to BuildRequires filed (if 1st is true)? See 1). The reason why I urge you to add runtime dependencies as buildrequires is that they are actually used during the test phase -- in most cases the module is loaded, e.g. via use_ok() or other means. Of course you always have to see the actual test code. Generally, for buildtime deps ("BuildRequires"): 1. Check the Makefile.PL or Build.PL, whatever the project uses, and add the file's dependencies to your BRs. 2. If you're running the test suite, check and add the direct test file dependencies. 3. If you're running the test suite, check and add the dependencies of modules tested by the test suite too. For runtime deps ("Requires"): 1. Build the package and see the resulting binary RPM's "requires" and compare it with what's actually written in the packaged code. If something is missing, add it explicitly. -- You are receiving this mail because: You are on the CC list for the bug. Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=erXrHhYuWe&a=cc_unsubscribe _______________________________________________ package-review mailing list package-review@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/package-review