[Fedora-packaging] %doc removal behavior

Jussi Lehtola jussilehtola at fedoraproject.org
Wed Oct 14 21:07:04 UTC 2009

On Wed, 2009-10-14 at 15:36 -0400, Braden McDaniel wrote:
> On 10/14/09 5:38 AM, Jussi Lehtola wrote:
> > Just use %doc to place the files in %{_docdir}, e.g.
> >   %doc doc/*
> The problem with that is that it does *not* put the files in %{_docdir} 
> when it is used for a subpackage.  Instead, the files are put in 
> /usr/share/doc/subpackagename-%{version}.  I don't want that.

Sorry, I must have misread your question.

If you only use %docs with absolute paths, then rpm doesn't seem to
remove %{_docdir}. If you use paths relative to the builddir, then rm
-rf is run. For example

 %doc A

 %files doc
 %doc %{_docdir}/%{name}-%{version}/B

does not work (fails with file B not found), but

 %doc %{_docdir}/%{name}-%{version}/A
 %files doc
 %doc %{_docdir}/%{name}-%{version}/B

works just fine.

PS. This list is actually off-topic for this kind of discussion, next
time mail fedora-devel-list instead.
Jussi Lehtola
Fedora Project Contributor
jussilehtola at fedoraproject.org

More information about the Fedora-packaging mailing list