Product SiteDocumentation Site

18.2.5.3. Compatibility and Glue Packages

Not all Linux distributions are the same. Macros alone won’t provide work-arounds for all the differences. You can, though, get a lot of mileage from compatibility and glue packages.
A compatibility package provides a legacy API on newer systems that no longer support the legacy API. By convention, compatibility packages are named with a leading compat- to signify their purpose.
For example:
$ rpm -q --qf "%{description}" compat-libstdc++
The compat-libstdc++ package contains compatibility Standard C++
Using a compatibility package allows you to create programs that use a least-common-denominator approach, programming to the oldest but most common APIs. As some Linux distributions eliminate the old APIs, compatibility packages can provide the missing APIs.
Similarly, a glue package provides a dependency that exists on some Linux distributions but not others. It glues together your package with the Linux distribution that is missing an essential capability.
Note
A key point in both of these approaches is to separate the compatibility and glue packages from your main application packages. The application packages should be as clean of vendor issues as possible. Instruct your users to install the compatibility or glue packages as needed (based on their Linux distribution) along with the main application package or packages.
With all this discussion of RPM and Linux differences, you might think that Linux is one big mess. That’s not true. Linux maintains a high degree of compatibility among Linux distributions as well as among processor architectures. Most programs originally created for Linux on Intel-based architectures compile cleanly on Linux versions running on other processor architectures such as MIPS, SPARC, and ARM.
The main differences lie in how Linux vendors split up the huge number of files associated with Linux into RPM packages as well as which versions of tools like C compilers the vendors ship.