As we mentioned above, RPM supports multi-platform package building through a set of tags, rpmrc file entries, and conditionals. None of these tools are difficult to use. In fact, the hardest part of multi-platform package building is figuring out how the software needs to be changed to support different platforms.
Let's take a look at each multi-platform tool RPM provides.
The first thing necessary for easy multi-platform package building is to identify which platform the package is to be built for. Except in the fairly esoteric case of cross-compilation, the build platform is the platform on which the package is built. RPM does this for you automatically, although it can be overridden at build-time.
The other important platform in package building is the platform on which the package is to be installed. Here again, RPM does this for you, though it's possible to override this when the package is installed.
But there is more to multi-platform package building than simply being able to determine the platform during package building and installation. The next component in multi-platform package building is a set of platform-dependent tags.
RPM uses a number of tags that control which platforms can build a package. These tags make it easier for the package builder to build multiple packages automatically, since the tags will keep RPM from attempting to build packages that are incompatible with the build platform.
While the platform-dependent tags provide a crude level of multi-platform control (i.e., the package will be built or not, depending on the tags and the build platform), RPM's platform-dependent conditionals provide a much finer level of control. By using these conditionals, it's possible to excise those parts of the spec file that are specific to another platform and replace them with one or more lines that are compatible with the build platform.
Now that we have a basic idea of RPM's multi-platform support features, let's take a more in-depth look at each one.