summaryrefslogtreecommitdiff
blob: da6263e3cd33bf7b7409019ed2cdfde0b0cb6042 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
Installed files
===============

.. index::
   single: installed files; small files
   single: USE flags; small files

Installation of small files
---------------------------
:PG: 0301
:Source: QA
:Reported: no

Ebuilds must not introduce USE flags to control installing files that
are small in size, require no additional dependencies and not cause any
negative consequences to the program behavior by being installed.  Such
files must be installed unconditionally.  Examples include shell
completion files, systemd service units, localization files.

Users wishing to strip unnecessary files of this category should use
INSTALL_MASK to do so.

*Rationale*: the goal of this policy is to avoid unnecessary rebuilds
of packages when the cost of installing additional files is much smaller
than the cost of rebuild.  It has been specifically brought in context
of bash completions in LibreOffice -- a user who did not notice that he
did not enable the flag should not be required to spend hours rebuilding
such a huge package in order to install one tiny file.

.. Note::

   While technically e.g. ``app-shells/bash-completion`` could be
   considered a dependency of installed bash completions, it is not
   applicable here since this package needs to be installed by the user
   if he wishes to use completions in the first place, and if it is not
   installed, completion files are not used at all.


.. index::
   pair: installed files; static library

Installation of static libraries
--------------------------------
:PG: 0302
:Source: QA
:Reported: no

Packages must not install static libraries unless they are explicitly
required, either by themselves or their reverse dependencies.  If both
shared and static libraries are supported, shared libraries must be
installed by default and ``USE=static-libs`` may be added for static
libraries if they are necessary.

*Rationale*: static linking is strongly discouraged as it makes security
support for packages practically impossible.  It may be used whenever
really necessary (e.g. for recovery tools) but otherwise proliferating
it is considered harmful.  There is no point in installing static
libraries if they are never going to be used.


.. index::
   pair: installed files; libtool file

Installation of libtool (.la) files
-----------------------------------
:PG: 0303
:Source: QA
:Reported: no

Packages must not install libtool .la files unless they are explicitly
required.  Generally, they might be required if:

a. the package is using a plugin loader that requires .la files in order
   to locate plugins and does not have .so fallback (very uncommon),

b. the package is installing static libraries that have additional
   dependencies and no pkg-config files or other tools that provide
   the list of dependencies to build systems.

It is recommended to use the following one-liner to remove .la files::

    find "${ED}" -name '*.la' -delete || die

*Rationale*: libtool files were historically introduced as an attempt
to supplement static library archives with dependent library list.
However, they were only supported by libtool-based (autotools) projects
and caused many issues, in particular due to hardcoding full paths.
Today they are practically replaced by more portable pkg-config files,
and while libtool keeps generating them, they are considered
unnecessary and potentially harmful.


.. index::
   pair: installed files; virtuals

Virtuals
--------
:PG: 0304
:Source: QA
:Reported: no

Packages in the ``virtual`` category must not install any files.

*Rationale*:  The ``virtual`` category is reserved for packages with
an empty installation image.  Package managers rely on this for some
optimizations.  Also QA tools make certain assumptions about virtuals,
e.g., that they must not assign the ``LICENSE`` variable (which would
be impossible if they installed any files).