Discussion:
SPEC File help, Requires not working as expected
Joshua M. Miller
2007-07-23 21:20:29 UTC
Permalink
Hello again,

I am working on defining dependencies for an RPM and having trouble
getting the Requires portion to work. I have the following line in my
SPEC file:

...
%define kernel 2.6.9-55.0.2.EL
...
Requires: kernel = %{kernel}

When I run rpm -qpR <rpm> on this package, it prints out the dependency
like I would expect:

[:***@host:] rpm -qpR <package>-0.2-1.i386.rpm
kernel = 2.6.9-55.0.2.EL
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1

...but I can then install the package without having the dependency met.
Have I mis-used this value or missed something here? My host is
running a kernel from an earlier version and does not have this kernel
installed, yet I am able to install this package without issues.

I have tried changing the kernel version to 2.8.9 and that works by
preventing the package install and enforcing the dependency so it looks
like the Requires does not force checking beyond the first few version
numbers. I have found nothing in the documentation that would suggest
this limitation.

TIA,
--
Joshua M. Miller - RHCE,VCP
Panu Matilainen
2007-07-25 07:14:52 UTC
Permalink
Post by Joshua M. Miller
Hello again,
I am working on defining dependencies for an RPM and having trouble getting
...
%define kernel 2.6.9-55.0.2.EL
...
Requires: kernel = %{kernel}
When I run rpm -qpR <rpm> on this package, it prints out the dependency like
kernel = 2.6.9-55.0.2.EL
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1
...but I can then install the package without having the dependency met.
Have I mis-used this value or missed something here? My host is running a
kernel from an earlier version and does not have this kernel installed, yet I
am able to install this package without issues.
I have tried changing the kernel version to 2.8.9 and that works by
preventing the package install and enforcing the dependency so it looks like
the Requires does not force checking beyond the first few version numbers. I
have found nothing in the documentation that would suggest this limitation.
If you look at 'rpm -q --provides kernel' you'll find "kernel = 2.6.9" in
there. Such a provide will satisfy any dependency where version is 2.6.9
regardless of the release, similarly to how "Provides: kernel" would
satisfy any version and release. The provide on kernel version without a
release is an old and rather unfortunate thing... at least it seems to be
gone from current Fedora.

Now for the good news: there is a way around that. The kernel packages
have plenty of files with the full version information, so instead of
trying to require a package, require a versioned file. Eg
Requires: /boot/vmlinuz-2.6.9-55.0.2.EL

- Panu -
Joshua M. Miller
2007-07-25 14:29:36 UTC
Permalink
Thanks, that worked great!

Joshua M. Miller - RHCE,VCP
Post by Panu Matilainen
Post by Joshua M. Miller
When I run rpm -qpR <rpm> on this package, it prints out the
kernel = 2.6.9-55.0.2.EL
Requires: /boot/vmlinuz-2.6.9-55.0.2.EL
Loading...