Sourcing one spec from another permissible?

Richard Shaw hobbes1069 at
Mon Oct 17 16:24:09 UTC 2011

Ok, I've dug a little deeper and I think there needs to be two
separate packages. The reason for this is that the kernel module needs
to be rebuilt on every kernel install/update.

The current Makefile has a target to create a SRPM for the kernel
module. I think I can do something along these lines.

1. Build the tools with the main zfs package.

2. Assuming I can call rpmbuild from within rpmbuild: Build an SRPM of
the zfs kernel module and copy it out to preferably %{_srcrpmdir} but
it may not be included in the build results so I may have to copy it
out to %{_rpmdir}/noarch.

3. Use that SRPM as the basis of a new package (zfs-modules) that can
revise independently for kernel updates.

I accomplished #2 this way from within the main spec file:

# Build kernel module SRPM and move it so it gets included in the build results.
mkdir -p %{_rpmdir}/noarch
rpmbuild -bs \
         --define "build_src_rpm 1" \
         --define "_srcrpmdir %{_rpmdir}/noarch" \

where Source101 is the -modules spec file.

Yeah, it's a hack, but it works pretty well. Now the kernel module
SRPM will be available as part of the build results. Anyone have a
better idea?


More information about the devel mailing list