From Fedora Project Wiki

< User:Tibbs

Revision as of 23:57, 14 September 2016 by Tibbs (talk | contribs) (Initial draft with formatting)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Libraries and Applications

Many language- or domain-specific guidelines refer to "libraries", "modules", "plug-ins" or other terms specific to the language or domain ("libraries"). This is specifically important to package naming. Some applications may include libraries, and some libraries may include applications, so the distinction is not always clear.

Library or Application?

  • If a package includes only files, libraries, or executables which are intended to be imported or loaded into other code, it is alibrary and MUST be packaged as such. (XXX Reference to application-specific naming.)
  • If a package includes only executables and libraries used internally by that those executables, it is an application and MUST be packaged as such. (XXX Need reference to naming guidelines for applications, which we don't specifically have.)
  • If the primary purpose of a package is to provide executables to be run by users, but also includes libraries which may be imported by other code, then it is considered a library and in general SHOULD be packaged as an application. However, see Mixed Use Packages below.
  • If the primary purpose of a package is to provide libraries intended to be imported or loaded into other code, it is considered a library and MUST be packaged as such. However, see Mixed Use Packages below.

It is left to the packager to determine the primary purpose of a package. Often times upstream will already have done this with their choice of naming and that choice SHOULD be followed by the Fedora packager.

Mixed Use Packages

Many packages, regardless of their primary purpose, include both applications and libraries. There are a few options:

  1. Simply package as an application or a library and just include the libraries or executables in that package.
  2. Do #1 but also add a Provides: for the name of an application or library according to the regular packaging guidelines.
  3. Split out into one or more subpackages the executables or libraries, following the relevant guidelines.

If the executables have significant dependencies which the libraries do not, then #3 MUST be followed. Otherwise #2 or #3 SHOULD be followed, but note that in some cases, RPM itself may automatically add the necessary Provides: and these MUST not be duplicated. (XXX This whole section is unwieldy.)