[Fedora-packaging] %doc removal behavior

Jussi Lehtola jussilehtola at fedoraproject.org
Wed Oct 14 09:38:47 UTC 2009


On Wed, 2009-10-14 at 05:01 -0400, Braden McDaniel wrote:
> The problem I'm running into is that in the course of packaging the docs
> for the main package, rpm does
> 
>         rm -rf %{_docdir}/%{name}-%{version}
> 
> So, when it subsequently tries to package the docs for the -doc
> subpackage, the "manual" subdirectory (that was put there by "make
> install") has been blown away.
> 
> What can I do here? Is it possible to suppress the "rm -rf" that %doc
> does?

Just use %doc to place the files in %{_docdir}, e.g.
 %doc doc/*

If the files that should be placed in %doc don't exist in the buildroot,
you can move them there in %install, e.g.

 make install DESTDIR=%{buildroot}
 # Move the documentation here
 mv %{buildroot}%{_docdir}/%{name}-%{version} installeddocs

 %files
 %doc installeddocs/*
-- 
Jussi Lehtola
Fedora Project Contributor
jussilehtola at fedoraproject.org




More information about the packaging mailing list