Question

Suppose I have two independent packages A and B where A is dependent on B (A loads symbols from B). Is it possible with rpmbuild to build both packages "simultaneously" so that B's BUILDROOT will be visible to A, or is the best choice to do something like:

Build B Install B Build A

Was it helpful?

Solution

This is what sub-packages are for generally:

What Are Subpackages?

Very simply put, a subpackage is one of several package files created from a single spec file. RPM has the ability to create a main package, along with one or more subpackages. Subpackages may also be created without the main package. It's all up to the package builder.

Why Are They Needed?

If all the software in the world followed the usual "one source, one binary" structure, there would be no need for subpackages. After all, RPM handles the building and packaging of a program into a single package file just fine.

But software doesn't always conform to this simplistic structure. It's not unusual for software to support two or more different modes of operation. A client/server program, for example, comes in two flavors: a client, and a server.

And it can get more complicated than that. Sometimes software relies on another program so completely that the two cannot be built separately. The result is often several packages.

While it is certainly possible that some convoluted procedure could be devised to force these kinds of software into a single-package structure, it makes more sense to let RPM manage the creation of subpackages. Why? From the package builder's viewpoint, the main reason to use subpackages is to eliminate any duplication of effort.

By using subpackages, there's no need to maintain separate spec files and endure the resulting headaches when new versions of the software become available. By keeping everything in one spec file, new software versions can be quickly integrated, and every related subpackage rebuilt with a single command.

But that's enough of the preliminaries. Let's see how subpackages are created.

Though if the two projects are actually independent things then (as opposed to something that sub-packages makes sense for) then your sequencing suggestion is the right one.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top