Sourcing one spec from another permissible?

Toshio Kuratomi a.badger at
Mon Oct 17 15:04:03 UTC 2011

On Mon, Oct 17, 2011 at 09:27:38AM -0500, Richard Shaw wrote:
> NOTE (just for Jon :): This is for RPM Fusion but the question is a
> technical one.
> I'm looking at packaging zfs for Fedora (via RPM Fusion) and it has a
> single source package but contains two spec files. One for the
> utilities (zfs{,-devel,-dracut,-test}) and one for the kernel module
> (zfs-modules). The one for the kernel module is a mess of macros and
> I'd rather not keep it inline with the main spec that I've gotten nice
> and clean/readable.
Combining them would probably be the best way.  I understand wanting to keep
the clean part clean and let the dirty part be dirty, but the upstream has
chosen to ship both parts together in one tarball so it's the best way to do

> The only other solution I know of is to create two SRPMS which use the
> same source, which I don't like.
This sounds like the next best solution.  We usually only do this when
upstream ships a single tarball but the sources inside it have two different
release schedules, though.  For instance, if we're packaging a game that has
source and data files together in one tarball.  The data files may only
change once every two years when the game has a major update while the game
engine code will change every month when a new bugfix is released.
Separating this into two SRPMS allows to build just an updated game engine
when the data stays the same so that the end-user doesn't have to download
the huge data files.

So the justification for doing things as two separate SRPMS does not exist
here but the technique does.  That's why this would not be my preferred
method but would be possible.

> They may not use any common files so
> I guess I could split the source archive but that's not a very clean
> method either.
I would not do this.  One of rpm's design goals is to have pristine source
from upstream.  We follow this unless there's a legal reason that keeps us
from doing so.  (For instance, having to strip out non-redistributable
source from a package that functions fine without it.)

> Is it technically possible to "source in" an spec from within a spec?
> If so, is it permissible?
rpm does provide a mechanism to source in external commands.  I would not
use it in this case, though.  One of rpm's design differences from dpkg is
that all the commands for building the package are in a single file.  When
you make heavy use of the include mechanism, you violate that principle.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : 

More information about the devel mailing list