[CentOS-devel] kmod packaging guideline

Sun Dec 21 00:51:25 UTC 2008
Ned Slider <ned at unixmail.co.uk>

Ned Slider wrote:
> 
> My next question would be if Requires: doesn't work in a kmod SPEC file, 
> will
> 
> BuildRequires:	redhat-rpm-config
> 
> work?
> 

Replying to my own thread after a quick investigation...

I added a fake BuildRequires (non-existent centos-rpm-config) to a kmod 
package spec file and tried to build it:

$ rpmbuild -ba --target=`uname -m` --define 'kversion 2.6.18-92.el5' 
--define 'kvariants ""' coretemp-kmod.spec
Building target platforms: x86_64
Building for target x86_64
error: Failed build dependencies:
         centos-rpm-config is needed by coretemp-1.1-3.el5.x86_64

and it fails to build as expected, so yes, BuildRequires does work.

But when I add the same fake Requires the package builds fine but 
there's no sign of the fake Requires:

# rpm -Uvh --test kmod-coretemp-1.1-3.el5.x86_64.rpm
Preparing...                ########################################### 
[100%]
# rpm -qp --requires kmod-coretemp-1.1-3.el5.x86_64.rpm
rpmlib(VersionedDependencies) <= 3.0.3-1
/sbin/depmod
/sbin/depmod
lm_sensors >= 2.10.2
/bin/sh
/bin/sh
/bin/sh
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1


It just gets ignored (but note the dependency for lm_sensors from the 
custom kmodtool script is there).

I have no idea why this is so.