Re: [PATCH] specfile: fix make rpm when with_driver_modules is 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Laine Stump wrote:
> Commit ff76566 moved around things in the specfiles to put
> driver-specific files into their appropriate sub-packages (when
> with_driver_modules == 1), but accidentally changed things so that the
> deamon-driver-network and daemon-config-network files were only
> included in a package when with_driver_modules == 0. This broke "make
> rpm" on fedora (where with_driver_modules == 1).
>
> This patch follows the pattern (already used for the files in other
> sub-modules) of duplicating the files for the main package
> (!with_driver_modules) and the sub-package (with_driver_modules). I
> think this is asking for trouble, but the first priority is to fix the
> build, then worry about removing redundancy later.
> ---
>
> I would push this as a build breaker, but am unsure enough of my
> specfile knowledge to be certain that I'm not breaking something else
> (it does allow make rpm to complete successfully). Since I have to
> leave for the weekend *right now*, I would appreciate if someone else
> can push this for me if it's a proper fix.
>
> Thanks!
>
>  libvirt.spec.in | 20 ++++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/libvirt.spec.in b/libvirt.spec.in
> index f615c62..d7d0e7e 100644
> --- a/libvirt.spec.in
> +++ b/libvirt.spec.in
> @@ -1843,14 +1843,16 @@ exit 0
>  
>      %if ! %{with_driver_modules}
>          %if %{with_network}
> +# Files from the daemon-driver-network sub-package
>  %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
>  %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/
>  %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart
>  %dir %{_datadir}/libvirt/networks/
> -%{_datadir}/libvirt/networks/default.xml
>  %ghost %dir %{_localstatedir}/run/libvirt/network/
>  %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
>  %dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/
> +# File from the daemon-config-network sub-package
> +%{_datadir}/libvirt/networks/default.xml
>   

The daemon-config-network package is only conditional upon
with_libvirtd, so this should be moved out of the with_driver_modules logic.

>          %endif
>          %if %{with_storage_disk}
>  %attr(0755, root, root) %{_libexecdir}/libvirt_parthelper
> @@ -1894,11 +1896,6 @@ exit 0
>          %endif
>      %endif # ! %{with_driver_modules}
>  
> -    %if %{with_network}
> -%files daemon-config-network
> -%defattr(-, root, root)
> -    %endif
> -
>   

I think this hunk should stay and default.xml should be listed here.

>      %if %{with_nwfilter}
>  %files daemon-config-nwfilter
>  %defattr(-, root, root)
> @@ -1913,8 +1910,19 @@ exit 0
>          %endif
>  
>          %if %{with_network}
> +%files daemon-config-network
> +%defattr(-, root, root)
> +%{_datadir}/libvirt/networks/default.xml
> +
>   

This is in with_driver_modules. As above, daemon-config-network only
depends on with_libvirtd.

>  %files daemon-driver-network
>  %defattr(-, root, root)
> +%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
> +%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/
> +%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart
> +%dir %{_datadir}/libvirt/networks/
> +%ghost %dir %{_localstatedir}/run/libvirt/network/
> +%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
> +%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/
>   

This part looks correct, except I think '%dir
%{_datadir}/libvirt/networks/' can be moved to daemon-config-network.

I know you are gone for the weekend, but maybe someone else can test
'make rpm' with the attached patch in a similar environment. I am also
hesitant to push this without a review.

Regards,
Jim

>From d7dabfd3ef084d56f603e3bd20676354c3684540 Mon Sep 17 00:00:00 2001
From: Jim Fehlig <jfehlig@xxxxxxxx>
Date: Fri, 13 Dec 2013 22:09:33 -0700
Subject: [PATCH] spec: fix make rpm when with_driver_modules is 1

Reported by Laine Stump <laine@xxxxxxxxx>

Commit ff76566 moved around things in the specfiles to put
driver-specific files into their appropriate sub-packages (when
with_driver_modules == 1), but accidentally changed things so that the
deamon-driver-network and daemon-config-network files were only
included in a package when with_driver_modules == 0. This broke "make
rpm" on fedora (where with_driver_modules == 1).

Include all the network related files and directories in
daemon-driver-network when building with_driver_modules.
Move the network configuration related files and directories to
daemon-config-network, which is only conditional upon with_libvirtd.
---
 libvirt.spec.in |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libvirt.spec.in b/libvirt.spec.in
index 849ec80..e0c0746 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1846,8 +1846,6 @@ exit 0
 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/
 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart
-%dir %{_datadir}/libvirt/networks/
-%{_datadir}/libvirt/networks/default.xml
 %ghost %dir %{_localstatedir}/run/libvirt/network/
 %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
 %dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/
@@ -1897,6 +1895,8 @@ exit 0
     %if %{with_network}
 %files daemon-config-network
 %defattr(-, root, root)
+%dir %{_datadir}/libvirt/networks/
+%{_datadir}/libvirt/networks/default.xml
     %endif
 
     %if %{with_nwfilter}
@@ -1915,6 +1915,12 @@ exit 0
         %if %{with_network}
 %files daemon-driver-network
 %defattr(-, root, root)
+%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
+%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/
+%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart
+%ghost %dir %{_localstatedir}/run/libvirt/network/
+%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
+%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/
 %{_libdir}/%{name}/connection-driver/libvirt_driver_network.so
         %endif
 
-- 
1.7.9.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]