spec: fix libvirt-docs subpackage on RHEL-6

RHEL-6's rpmbuild wipes the docdir for a (sub-)package if any %doc
directives are present, prior to copying in the marked documentation.
This means we can't prepopulate this directory with the HTML
documentation during the %install phase.

Instead, move the HTML documentation to a temporary directory during
%install and mark the contents of this temporary directory with %doc.

This fixes a build regression introduced in

  commit e23216da9a
  Author: Cole Robinson <crobinso@redhat.com>
  Date:   Wed Sep 25 13:20:40 2013 -0400

    spec: Clean up distribution of ChangeLog (and others)

where the libvirt-docs sub-RPM gained a %doc directive, thus
triggering the RPM bug.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
This commit is contained in:
Michael Chapman 2013-11-20 12:58:24 +00:00 committed by Daniel P. Berrange
parent a18fa05a8f
commit caaeb691a3

View File

@ -1491,8 +1491,8 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml
%endif
mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} \
$RPM_BUILD_ROOT%{_datadir}/doc/libvirt-docs-%{version}
# Copied into libvirt-docs subpackage eventually
mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} libvirt-docs
%if %{with_dtrace}
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
@ -1732,12 +1732,7 @@ fi
%files docs
%defattr(-, root, root)
%doc AUTHORS ChangeLog.gz NEWS README TODO
# Website
%dir %{_datadir}/doc/libvirt-docs-%{version}
%dir %{_datadir}/doc/libvirt-docs-%{version}/html
%{_datadir}/doc/libvirt-docs-%{version}/html/*
%doc AUTHORS ChangeLog.gz NEWS README TODO libvirt-docs/*
# API docs
%dir %{_datadir}/gtk-doc/html/libvirt/