From Fedora Project Wiki

< OrionPoplawski

Revision as of 20:54, 5 September 2013 by Orion (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Packaging Header Only Libraries

Certain libraries, especially some C++ template libraries, are header only libraries. Since the code is generated during compile time, they act just like static libraries and need to be treated as such.

Place all of the header files in the *-devel subpackage and then you must have a virtual Provide for the *-static package:

%package devel
Provides: foo-static = %{version}-%{release}

Packages which use the header library must BuildRequire: foo-static, so that the usage can be tracked.

noarch

It may be tempting to make the header library package noarch, since the header files themselves are simply text. However, a library should have tests which should be run on all architectures. Also, the install process may modify the installed headers depending on the build architecture. If the packager is sure that the headers are installed identically on all architectures the *-devel sub-package may be made noarch.