[Fedora-packaging] Is this allowed? Files and libs duplicated in subpackages

Michael Schwendt mschwendt at gmail.com
Sat Sep 7 16:44:37 UTC 2013


On Sat, 7 Sep 2013 17:55:46 +0200, Till Maas wrote:

> On Wed, Sep 04, 2013 at 07:47:55AM -0700, Toshio Kuratomi wrote:
> 
> > https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#DuplicateFiles
> > 
> > So that would also be a packaging mistake.  It's been many years since this
> > was last touched though.  IIRC, mschwendt raised the last issue with it so
> > he may be best able to recall the justifications for this rule and whether
> > the FPC should consider relaxing it.
> 
> The python guidelines contain an example where %doc is used to include
> the same doc files both in the python2 and python3 package:
> 
> https://fedoraproject.org/wiki/Packaging:Python#Example_spec_file
> 
> It sounds like it should be mentioned as an exception in the duplicate
> files guidelines.

Or drop that section from the Packaging and Review Guidelines and replace
it with something else. Exceptions soften the guidelines to a degree they
become useless. It's a subsection of "File and Directory Ownership":

| In most cases, it should not be necessary for multiple packages to
| contain identical copies of the same file. However, if it is necessary,

... that's the backdoor already ... ;)

| multiple packages may contain identical copies of the same file, as long
| as the following requirements are met:
|
| * The packages sharing ownership of the identical files are built from
|   a single SRPM. 
|
| OR
|
| * The packages sharing ownership of the identical files are not in a
|   dependency chain

... sometimes we _create_ package inter-dependencies when we split off
-common packages, for example - or a meta-package that depends on
multiple packages ...

|   (e.g. if package A requires package B, they should
|   not both contain identical files, either A or B must own the common
|   files, but not both.) 

The ReviewGuidelines refer to it in a second place:

| MUST: Packages must not own files or directories already owned by other
| packages. The rule of thumb here is that the first package to be installed
| should own the files or directories that other packages may rely
| upon. This means, for example, that no package in Fedora should ever share
| ownership with any of the files or directories owned by the filesystem or
| man package. If you feel that you have a good reason to own a file or
| directory that another package owns, then please present that at package
| review time.

That links the same "File and Directory Ownership" section and covers
subpackages, too, of course.

We need to ask ourselves, do we want to create tiny subpackages for
every single file that may be shared by several subpackages? Apparently
not according to above section and the exceptions for license/%doc files.
And we already have exceptions for directory ownership, too.

A proposal only for the Review Guidelines:

  MUST: The spec %files lists must be crafted carefully to ensure that no
  files or directories get included in the wrong packages.

  MUST: Don't duplicate files in more than one subpackage, unless there is
  a specific requirement to do so. If there is, give the rationale in a
  comment in the spec file. If it's many files, splitting of a shared package
  would be preferred. 

Known cases here are: the subpackage licensing guidelines, multiple alternative
packages that may want to include the same files and/or a few key %doc files.


More information about the packaging mailing list