From Fedora Project Wiki

Unversioned Docdirs

Summary

Install package specific documentation to an unversioned subdir in /usr/share/doc.

Owner

Current status

Detailed Description

Change the per package documentation directory in /usr/share/doc to unversioned, just containing the package's name (previously it contained both the package's name and its version). rpmbuild already has support for this, by setting the %_docdir_fmt macro to %{name} we cover most of the cases. Other cases can be grepped through from package specfiles/patches -- grepping for _docdir, _defaultdocdir, usr/share/doc and _datadir.*doc should catch almost everything. Packages for which multiple versions are intended to be installed need to be changed to install their docs into appropriately versioned subdirs, for example explicitly using the previous NAME-VERSION scheme. Some of these cases, if unaddressed, will also manifest themselves as build failures due to files not found at expected locations.

A helper macro, %{_pkgdocdir} has been added to F20 and F19's redhat-rpm-config. It points to the main package's documentation directory. It can be used also with earlier distro versions for example by conditionally redefining it like:

   %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}

Packages referring to their doc dir only once may want to do it for example like (for a hypothetical --docdir option):

   --docdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}

Benefit to Fedora

By having the documentation directories unversioned, they and the files in them become inherently easier/stabler to bookmark, cross-reference from other docs, Systemd unit Documentation= etc. Doing so also makes Fedora more consistent with other major distributions that already do this (at least Debian, Mandriva, openSUSE, and Ubuntu at time of writing).

Scope

  • Proposal owners: take care of having the %_docdir_fmt macro set to %{name} in rpm or redhat-rpm-config, grep through package specfiles and patches identifying cases needing special attention.
  • Other developers: see if their package explicitly refers to a NAME-VERSION subdir in /usr/share/doc, and change those to NAME.
  • Release engineering: mass rebuild is required after the %_docdir_fmt macro change.
  • Policies and guidelines: all documentation referring to NAME-VERSION subdirs in /usr/share/doc needs to be changed to NAME instead.

Upgrade/compatibility impact

No technical upgrade impact, just documentation.

How To Test

Installed packages apart from ones for which multiple versions are intended to be installed in parallel should have their documentation installed into an unversioned /usr/share/doc/NAME (not NAME-VERSION) directory.

User Experience

Better documentation bookmarkability and cross-referenceability (links are less likely to break between package upgrades), familiarity to users accustomed to other major distributions.

Dependencies

rpm configuration in the rpm package itself, or redhat-rpm-config.

Contingency Plan

  • Contingency mechanism: revert the %_docdir_fmt change and NAME-VERSION -> NAME changes
  • Contingency deadline: beta release
  • Blocks release? No

Documentation

N/A

Release Notes

Per package documentation is now installed into unversioned /usr/share/doc/NAME directories. Previously the directory contained the package's version in addition to its name.