%define with_hyperv 0%{!?_without_hyperv:1}
# Then the secondary host drivers, which run inside libvirtd
-%define with_network 0%{!?_without_network:1}
%define with_storage_fs 0%{!?_without_storage_fs:1}
%define with_storage_lvm 0%{!?_without_storage_lvm:1}
%define with_storage_iscsi 0%{!?_without_storage_iscsi:1}
Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.gz
Requires: libvirt-daemon = %{version}-%{release}
-%if %{with_network}
Requires: libvirt-daemon-config-network = %{version}-%{release}
-%endif
%if %{with_nwfilter}
Requires: libvirt-daemon-config-nwfilter = %{version}-%{release}
%endif
%endif
BuildRequires: avahi-devel
BuildRequires: libselinux-devel
-%if %{with_network}
BuildRequires: dnsmasq >= 2.41
BuildRequires: iptables
- %if 0%{?rhel} && 0%{?rhel} < 7
+%if 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: iptables-ipv6
- %endif
-BuildRequires: radvd
%endif
+BuildRequires: radvd
%if %{with_nwfilter}
BuildRequires: ebtables
%endif
of recent versions of Linux. Requires a hypervisor specific sub-RPM
for specific drivers.
-%if %{with_network}
%package daemon-config-network
Summary: Default configuration files for the libvirtd daemon
Group: Development/Libraries
%description daemon-config-network
Default configuration files for setting up NAT based networking
-%endif
%if %{with_nwfilter}
%package daemon-config-nwfilter
Network filter configuration files for cleaning guest traffic
%endif
-%if %{with_network}
%package daemon-driver-network
Summary: Network driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: dnsmasq >= 2.41
Requires: radvd
Requires: iptables
- %if 0%{?rhel} && 0%{?rhel} < 7
+%if 0%{?rhel} && 0%{?rhel} < 7
Requires: iptables-ipv6
- %endif
+%endif
%description daemon-driver-network
The network driver plugin for the libvirtd daemon, providing
an implementation of the virtual network APIs using the Linux
bridge capabilities.
-%endif
%if %{with_nwfilter}
%define _without_uml --without-uml
%endif
-%if ! %{with_network}
- %define _without_network --without-network
-%endif
-
%if ! %{with_storage_fs}
%define _without_storage_fs --without-storage-fs
%endif
--without-vz \
--without-bhyve \
--with-interface \
- %{?_without_network} \
+ --with-network \
%{?_without_storage_fs} \
%{?_without_storage_lvm} \
%{?_without_storage_iscsi} \
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/virt-admin.1*
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/libvirt-admin.conf
-%if %{with_network}
install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/lib/libvirt/dnsmasq/
# We don't want to install /etc/libvirt/qemu/networks in the main %files list
# because if the admin wants to delete the default network completely, we don't
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
# Strip auto-generated UUID - we need it generated per-install
sed -i -e "/<uuid>/d" $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml
-%else
-rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml
-rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
-%endif
%if ! %{with_qemu}
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
%endif
fi
-%if %{with_network}
%post daemon-config-network
if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; then
# see if the network used by default network creates a conflict,
ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
# Make sure libvirt picks up the new network defininiton
- %if %{with_systemd}
+%if %{with_systemd}
/bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 ||:
- %else
+%else
/sbin/service libvirtd condrestart > /dev/null 2>&1 || :
- %endif
+%endif
fi
-%endif
%if %{with_systemd}
%triggerun -- libvirt < 0.9.4
%doc examples/polkit/*.rules
-%if %{with_network}
%files daemon-config-network
%defattr(-, root, root)
%dir %{_datadir}/libvirt/networks/
%{_datadir}/libvirt/networks/default.xml
-%endif
%if %{with_nwfilter}
%files daemon-config-nwfilter
%defattr(-, root, root)
%{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so
-%if %{with_network}
%files daemon-driver-network
%defattr(-, root, root)
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/