I'm trying to move some API docs to a -doc subpackage. I'd like to install these docs to /usr/share/doc/%{name}-%{version} (which corresponds to where "make install" puts them); so I do
%files doc %doc %{_docdir}/%{name}-%{version}/manual
instead of
%files doc %doc doc/manual
However, I'd like to leave README and similar in the main package, where I have
%files %doc README NEWS COPYING.LESSER
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?
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/*
On 10/14/09 5:38 AM, Jussi Lehtola wrote:
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/*
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.
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
%files %defattr(-,root,root,-) %doc A
%files doc %defattr(-,root,root,-) %doc %{_docdir}/%{name}-%{version}/B
does not work (fails with file B not found), but
%files %defattr(-,root,root,-) %doc %{_docdir}/%{name}-%{version}/A
%files doc %defattr(-,root,root,-) %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.
On Thu, 2009-10-15 at 00:07 +0300, Jussi Lehtola wrote:
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.
Ah, lovely. Thanks.
PS. This list is actually off-topic for this kind of discussion, next time mail fedora-devel-list instead.
I'm sorry. I wasn't sure if this was exclusively for policy discussion; and a look at previous traffic here didn't make it obvious. But I'll direct future queries of this sort to fedora-devel-list.
packaging@lists.fedoraproject.org