From Fedora Project Wiki
(Created page with "{{Anchor|HeaderOnlyLibraries}} == Packaging Header Only Libraries == Certain libraries, especially some C++ template libraries, are header only libraries. Since the code is g...")
 
 
Line 3: Line 3:
 
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.
 
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.
  
* We want to be able to track which packages are using header libraries (so we can find which packages need to be rebuilt if a security flaw in a header library is fixed, for instance).  Place all of the header files in the ''*-devel'' subpackage and then you must have a virtual Provide for the ''*-static'' package:
+
Place all of the header files in the ''*-devel'' subpackage and then you must have a virtual Provide for the ''*-static'' package:
 
<pre>%package devel
 
<pre>%package devel
 
Provides: foo-static = %{version}-%{release}</pre>
 
Provides: foo-static = %{version}-%{release}</pre>

Latest revision as of 20:54, 5 September 2013

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.