7.3. Package declarations

One or more package declaration section follow the build header. Each package declaration begins with a "%package" line. "%package", by itself, declares the main package. Subpackages are declared by giving the name of the subpackage: "%package doc" declares a subpackage named "doc".

Each package declaration begins with an optional "Header: value" list, where possible values of "Header:" described below. A blank line follows the last header, then the human-readable description of the package.

The package description is, by convention, HTML text. Note that blank lines do not introduce a paragraph breaks. Paragraph breaks must be introduced by an explicit "<p>" HTML tag.

The "Header: value" lines in the package declaration section complement the ones in the build header section, except that they only apply to the package, or the subpackage. Different subpackages may have different "Header: value" lines. All following "Header: value" lines are optional, and a blank line is still required even if no "Header: value" lines are present. See Section 13.2 for a description of the following resources:

Requires: list

Add list to the list of resources required by this package (see "Required resources"). LPMtool automatically determines most resources required by a package, such as shared libraries and Perl modules. An explicit list is needed only when it is necessary to explicitly add resources to the automatically-generated required resource list.

Provides: list

Add list to the list of resources provided by this package (see "Provided resources"). LPMtool automatically determines most resources provided by a package, such as shared libraries and Perl modules. An explicit list is needed only when it is necessary to explicitly add resources to the automatically-generated provided resource list.

Conflicts: list

list is a list of resources this package conflicts with (see "Conflicting resources"). This is in addition to the automatically generated resource conflict list.

Supercedes: list

list is a list of resources superceded by this package (see "Superceded resources"). LPMtool automatically adds the "name(arch)<version-release" resource by default, unless disabled by the "NoAutoSupercedes:" (see below).

Obsoletes: list

list is a list of resources obsoleted by this package (see "Obsoleted resources").

Updates: list

list is a list of resources updated by this package (see "Updated resources"). LPMtool automatically adds the "name(arch)<version-release" resource by default, unless disabled by the "NoAutoUpdates:" (see below).

NoAutoRelease: 1

The presence of this line prevents the automatic inclusion of the following resources in each package "name":

Provides: release-name(arch)=label
Updates: release-name(arch)!=label
Supercedes: release-name(arch)!=label

"label" is a fixed identifier for the distribution system's platform.

NoAutoReq: 1

The presence of this line turns off the automatically-generated default list of required resources. All required resources (if any) must appear in "Requires:".

NoAutoProv: 1

The presence of this line turns off the automatically-generated default list of provided resources. All required provided (if any) must appear in "Provides:".

NoAutoReqPython: 1

Turn off automatic generation of required Python modules. See "Section 7.3.1" for more information.

NOTE:

This is implied, when "NoAutoReq: 1" is present. It is not necessary to specify this when "NoAutoReq: 1" is also specified.

NoAutoProvPython: 1

Turn off automatic generation of provided Python modules. See "Section 7.3.1" for more information.

NOTE:

This is implied, when "NoAutoProv: 1" is present. It is not necessary to specify this when "NoAutoProv: 1" is also specified.

NoAutoSupercedes: 1

The presence of this line turns off the automatic addition of "name(arch)<version-release" to the list of resources superceded by this package.

NoAutoUpdates: 1

The presence of this line turns off the automatic addition of "name(arch)<version-release" to the list of resources updated by this package.

NOTE:

Each file installed by the package results in an implicit "filename=checksum" provided resource, and a "filename!=checksum" conflicting resource. These resources will always be present. The "NoAutoProv: 1" and "NoAutoReq: 1" headers cannot suppress these resources (but it does suppress the automatically-generated provided resources based on the names of shared libraries and Perl modules installed by the package).

Furthermore, the required resources "/etc/passwd" and "/etc/group" cannot be suppressed either (if they are required). See Section 13.2.1 for more information on these resources.

7.3.1. Python dependency tracking

In nearly all situations LPMtool will automatically compute a package's dependencies: which resources the package requires, and which resources the package provides, which might be required by other packages. The usual kinds of resources are shared libraries and Perl modules. LPMtool analyzes which shared libraries are loaded by each binary program in a package, and specifies the names of those shared libraries as required resources. If a package installs its own shared libraries, their names get recorded as provided resource.

LPMtool uses similar logic with Perl modules. Perl's syntax is receptive to easy parsing, and it's usually trivial to determine the name of Perl packages contained in a Perl script, and names of other packages a Perl script uses.

LPMtool tries to do the same with Python scripts. Python's syntax, however, is more complex and this not as exact of a science as it is with Perl.

It is not always possible to accurately reverse-engineer the full hierarchical name of a Python module, based on its filename alone. Furthermore, there are a number of ways a Python module can import other modules. To complicate matters even further, any shared library is a potential Python module. What really happens is that LPMtool checks the symbol table of shared libraries installed by the package, and tries to figure out if a shared library is a Python extension based on its symbols.

Then, when LPMtool needs to determine what other modules a particular Python module requires, LPMtool takes the bull by the horn, starts a Python intepreter, and tries to import the module, and looks at what other baggage got imported by that action. The presence of the "NoAutoProvPython: 1" and "NoAutoReqPython: 1" headers turns this off. "NoAutoReqPython: 1" should be used when importing a package's Python module (or a Python extension) during the packaging process might have unwanted consequences. "NoAutoProvPython: 1" should be used when LPMtool's algorithm for computing a module name does not work for a particular package. If necessary any "python(name)" required and provided resources can always be manually added to the package's header.

Specifying "NoAutoProvPython: 1" and "NoAutoReqPython: 1" turns off only automatic generation of Python dependencies. Automatic generation of other kinds of dependencies (regular shared libraries, Perl modules) is not affected.

7.3.2. The "debuginfo" subpackage

The default lpm configuration always creates a subpackage called "debuginfo". Do not declare this package explicitly, it will be created by default. lpm automatically removes debugging data from all binary programs and libraries before creating a package. The debugging data is not needed when running the programs, and removing the debugging data reduces the amount of disk space required by a package.

The "debuginfo" subpackage contains all binaries and programs installed by the main package and all other subpackages, but with the debugging data preserved, and intact. The "debuginfo" subpackage is useful for debugging core dumps, and other diagnostic purposes.

The creation of the "debuginfo" subpackage may be suppressed by setting the __create_debugpackage macro to "0", either by passing the option "--define __create_debugpackage=0" to lpbuild, or by setting this macro in the specfile. This macro must be set in the build header portion of the specfile, before all other package declaration.