Hello list,
I have searched Google high and low, but I have not found an answer. I have a spec file that requires some perl modules, ie Net::IP, XML::Simple, etc. For all but one there is an RPM available for it. In the SPEC file I have them as Requires: perl(Net::IP) and the spec file builds fine(rpmbuild -ba -v) but when I go to install the RPM it complains about the missing perl modules. If I do a `yum install perl-xyz` and rebuild the SPEC file, it will not complain about the missing perl modules. How can I have the SPEC file download/install the perl modules/packages? If it is easier, I can also post the SPEC file itself.
Thanks, Conner
Conner Finlay wrote:
Hello list,
I have searched Google high and low, but I have not found an answer. I have a spec file that requires some perl modules, ie Net::IP, XML::Simple, etc. For all but one there is an RPM available for it. In the SPEC file I have them as Requires: perl(Net::IP) and the spec file builds fine(rpmbuild -ba -v) but when I go to install the RPM it complains about the missing perl modules. If I do a `yum install perl-xyz` and rebuild the SPEC file, it will not complain about the missing perl modules. How can I have the SPEC file download/install the perl modules/packages? If it is easier, I can also post the SPEC file itself.
If you use yum to install the rpm you've built, it will resolve the dependencies and install them too.
When you specify "Requires: foo", this means that your package needs "foo" on the system to run, but not necessarily to build, so rpm enforces this when you try to install the package. If you want "foo" available at build time (perhaps to run a test suite), you specify that as "BuildRequires: foo", and rpm-build will insist you have "foo" when you try to build the package.
Paul.
Paul,
Wouldn't BuildRequires: be pretty much the same thing as doing a manual yum install of the package, then building the spec file?
Thanks, Conner
On Wed, Mar 25, 2009 at 12:06 PM, Paul Howarth paul@city-fan.org wrote:
Conner Finlay wrote:
Hello list,
I have searched Google high and low, but I have not found an answer. I have a spec file that requires some perl modules, ie Net::IP, XML::Simple, etc. For all but one there is an RPM available for it. In the SPEC file I have them as Requires: perl(Net::IP) and the spec file builds fine(rpmbuild -ba -v) but when I go to install the RPM it complains about the missing perl modules. If I do a `yum install perl-xyz` and rebuild the SPEC file, it will not complain about the missing perl modules. How can I have the SPEC file download/install the perl modules/packages? If it is easier, I can also post the SPEC file itself.
If you use yum to install the rpm you've built, it will resolve the dependencies and install them too.
When you specify "Requires: foo", this means that your package needs "foo" on the system to run, but not necessarily to build, so rpm enforces this when you try to install the package. If you want "foo" available at build time (perhaps to run a test suite), you specify that as "BuildRequires: foo", and rpm-build will insist you have "foo" when you try to build the package.
Paul.
-- Fedora-packaging mailing list Fedora-packaging@redhat.com https://www.redhat.com/mailman/listinfo/fedora-packaging
Conner Finlay wrote:
Paul,
Wouldn't BuildRequires: be pretty much the same thing as doing a manual yum install of the package, then building the spec file?
Yes; that's the way dependencies are done. The spec file contains the dependency information and it's up to the user how to satisfy that dependency.
Given that packages should be built as non-root users for security reasons, nothing in the spec file that attempted to download and install dependencies on to the system (and in particular, into the rpm database) would work anyway due to permissions.
Paul.
packaging@lists.fedoraproject.org