[Fedora-packaging] Doc packaging questions

T.C. Hollingsworth tchollingsworth at gmail.com
Tue Jul 23 20:00:03 UTC 2013


On Tue, Jul 23, 2013 at 12:33 PM, Ville Skyttä <ville.skytta at iki.fi> wrote:
> Related to the unversioned docdirs F-20 feature [1], here's a couple of
> questions:
>
> 1) Should specfiles be using %{_docdir} or %{_defaultdocdir} when
> referring to the /usr/share/doc dir? Both seem to work, both are being
> used. To me %{_docdir} sounds better for some reason.

Only the latter one seems to work?

% rpm -E '%{_docdir}'
%{_docdir}

% rpm -E '%{_defaultdocdir}'
/usr/share/doc

> 2) Packages that want to refer to the doc dir created by the special
> %doc form need to take %{_docdir_fmt} into account. I didn't find a nice
> way to do it, but here's one uglyish way to define a variable in
> specfiles that should point to the correct location before and after the
> %{_docdir_fmt} change (everything on one row):
>
> %global pkgdocdir %{_docdir}/%{?_docdir_fmt:%{expand:%(echo
> '%{_docdir_fmt}' | tr A-Z a-z)}}%{!?_docdir_fmt:%{name}-%{version}}

Why not just define %{pkgdocdir} in redhat-rpm-config instead of
making everyone do this in spec files?

> Do we want to encourage using this in specfiles that need to refer to
> the dir created by %doc, or does someone have a better solution?
>
> Packages can obviously conditionalize stuff on 0%{?fedora} >= 20 but
> that doesn't sound too nice to me.

IMHO it would be a lot simpler if we just define %{pkgdocdir} in
redhat-rpm-config, make sure it does the right thing regardless of
Fedora version, and backport to current Fedora releases.  (We
backported the systemd macros to earlier Fedora releases for similar
reasons so there's precedent for this.)  Then specs can be ported
without need for conditionals.

-T.C.

P.S. Thanks for the Unversioned Docdirs proposal.  It's an awesome
improvement!  :-)


More information about the packaging mailing list