[libvirt-dbus PATCH 9/9] spec: Pick documentation from installation directory

Andrea Bolognani posted 9 patches 5 years, 9 months ago
[libvirt-dbus PATCH 9/9] spec: Pick documentation from installation directory
Posted by Andrea Bolognani 5 years, 9 months ago
Now that the documentation is installed just like other files,
we can also pick it from the installation directory instead of
the source directory.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 libvirt-dbus.spec.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libvirt-dbus.spec.in b/libvirt-dbus.spec.in
index 84172fa..2230ffc 100644
--- a/libvirt-dbus.spec.in
+++ b/libvirt-dbus.spec.in
@@ -50,8 +50,9 @@ getent passwd %{system_user} >/dev/null || \
 exit 0
 
 %files
-%doc AUTHORS.rst NEWS.rst
-%license COPYING
+%doc %{_docdir}/%{name}/AUTHORS.rst
+%doc %{_docdir}/%{name}/NEWS.rst
+%license %{_docdir}/%{name}/COPYING
 %{_sbindir}/libvirt-dbus
 %{_datadir}/dbus-1/services/org.libvirt.service
 %{_datadir}/dbus-1/system-services/org.libvirt.service
-- 
2.25.3

Re: [libvirt-dbus PATCH 9/9] spec: Pick documentation from installation directory
Posted by Pavel Hrdina 5 years, 9 months ago
On Sat, Apr 25, 2020 at 10:59:46PM +0200, Andrea Bolognani wrote:
> Now that the documentation is installed just like other files,
> we can also pick it from the installation directory instead of
> the source directory.
> 
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  libvirt-dbus.spec.in | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/libvirt-dbus.spec.in b/libvirt-dbus.spec.in
> index 84172fa..2230ffc 100644
> --- a/libvirt-dbus.spec.in
> +++ b/libvirt-dbus.spec.in
> @@ -50,8 +50,9 @@ getent passwd %{system_user} >/dev/null || \
>  exit 0
>  
>  %files
> -%doc AUTHORS.rst NEWS.rst
> -%license COPYING
> +%doc %{_docdir}/%{name}/AUTHORS.rst
> +%doc %{_docdir}/%{name}/NEWS.rst
> +%license %{_docdir}/%{name}/COPYING
>  %{_sbindir}/libvirt-dbus
>  %{_datadir}/dbus-1/services/org.libvirt.service
>  %{_datadir}/dbus-1/system-services/org.libvirt.service

This patch will change the location of COPYING file from

    /usr/share/licenses/libvirt-dbus/COPYING

to

    /usr/share/doc/libvirt-dbus/COPYING

Which is probably OK but the preferred location is the licenses
directory.  I would like to keep this behavior for RPM packages
which means move the file in the %install phase or using this:

%exclude %{_docdir}/%{name}/COPYING
%license COPYING

Pavel
Re: [libvirt-dbus PATCH 9/9] spec: Pick documentation from installation directory
Posted by Andrea Bolognani 5 years, 9 months ago
On Mon, 2020-04-27 at 14:39 +0200, Pavel Hrdina wrote:
> On Sat, Apr 25, 2020 at 10:59:46PM +0200, Andrea Bolognani wrote:
> >  %files
> > -%doc AUTHORS.rst NEWS.rst
> > -%license COPYING
> > +%doc %{_docdir}/%{name}/AUTHORS.rst
> > +%doc %{_docdir}/%{name}/NEWS.rst
> > +%license %{_docdir}/%{name}/COPYING
> 
> This patch will change the location of COPYING file from
> 
>     /usr/share/licenses/libvirt-dbus/COPYING
> 
> to
> 
>     /usr/share/doc/libvirt-dbus/COPYING
> 
> Which is probably OK but the preferred location is the licenses
> directory.  I would like to keep this behavior for RPM packages
> which means move the file in the %install phase or using this:
> 
> %exclude %{_docdir}/%{name}/COPYING
> %license COPYING

That's a nuance of RPM packaging that I completely missed.

I'll squash in the %exclude trick you suggest and verify that the
file actually ends up in the expected location before pushing.

Thanks for the speedy review! :)

-- 
Andrea Bolognani / Red Hat / Virtualization