Bug 75933 - BuildRequires: not being honored
BuildRequires: not being honored
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Depends On:
  Show dependency treegraph
Reported: 2002-10-15 00:46 EDT by tanner
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-10-15 23:28:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description tanner 2002-10-15 00:46:53 EDT
$ rpm -q rpm

Custom .spec file which requires a specific kernel be installed, snippet below:

Release: 11.realtime
Distribution: Red Hat Linux 7.3 / i386
BuildRequires: kernel >= 2.4.18.realtime.8
Serial: 4
Requires: rte-firewall

The box I attempted to build this package on does -not- have
kernel-2.4.18.realtime.8 or greater installed as listed below:

[tanner@linux firewalls]$ rpm -qa | grep kerne

Yet, RPM merrily compiles the package:

[tanner@linux firewalls]$ rpm -bc freeswan.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.28146
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd /usr/src/redhat/BUILD
+ rm -rf freeswan-1.98b
+ /bin/gzip -dc /usr/src/redhat/SOURCES/freeswan-1.98b.tar.gz
+ tar -xf -

Make a small change to the .spec file, changing kernel to kernel-source, snippet

Release: 11.realtime
Distribution: Red Hat Linux 7.3 / i386
BuildRequires: kernel-source >= 2.4.18.realtime.8
Serial: 4
Requires: rte-firewall

[tanner@linux firewalls]$ rpm -bc freeswan.spec
error: failed build dependencies:
   kernel-source >= 2.4.18-realtime.8 is needed by freeswan-1.98b-11.realtime

It would appear the rpm-4.0.4-7x.18 does not honor the BuildRequires flag all
the time.
Comment 1 Jeff Johnson 2002-10-15 08:20:43 EDT
What does
	rpm -q --whatprovides kernel
Comment 2 tanner 2002-10-15 22:49:35 EDT
$ rpm -q --whatprovides kernel
Comment 3 Jeff Johnson 2002-10-15 23:13:00 EDT
OK, I was looking for a
	Provides: kernel
from a kernel-smp package, that would have explained.

So what does "rpmbuild -bc -vv ..." say? The
location where the dependency is satisfied looks like

D:  Requires: kernel                                        YES (db provides)

Comment 4 tanner 2002-10-15 23:27:06 EDT
$ rpm -bc -vv freeswan.spec
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: ========== +++ freeswan-1.98b-11.realtime
D: opening  db index       /var/lib/rpm/Depends create mode=0x0
D: opening  db index       /var/lib/rpm/Providename rdonly mode=0x0
D:  Requires: gmp-devel                                     YES (db provides)
D:  Requires: libcap                                        YES (db provides)
D:   YES    A kernel = 2.4.18   B kernel >= 2.4.18-8.realtime
D:  Requires: kernel >= 2.4.18-8.realtime                   YES (db provides)
D: opening  db index       /var/lib/rpm/Conflictname rdonly mode=0x0
D: closed   db index       /var/lib/rpm/Depends
D: closed   db index       /var/lib/rpm/Conflictname
D: closed   db index       /var/lib/rpm/Providename
D: closed   db index       /var/lib/rpm/Packages
Comment 5 Jeff Johnson 2002-10-16 10:17:13 EDT
OK, the problem has to do with a missing release. The
	Provides: kernel = 2.4.18
in the match provides all releases of the kernel, which matches
your BuildRequires:.

You'll need to write your dependency differently, say as
	BuildRequires: /lib/modules/2.4.18.realtime.8

Note You need to log in before you can comment on or make changes to this bug.