 +Requires: numactl-devel
 +
  
- %description daemon
- Server side daemon required to manage the virtualization capabilities
-@@ -1200,6 +1203,7 @@ rm -f po/stamp-po
-            %{?arg_loader_nvram} \
-            %{?enable_werror} \
-            --enable-expensive-tests \
+ # All build-time requirements
+ %if 0%{?enable_autotools}
+@@ -952,6 +955,7 @@ autoreconf -if
+            %{?_with_firewalld} \
+            %{with_packager} \
+            %{with_packager_version} \
 +           --enable-test-coverage \
-            %{arg_init_script}
- make %{?_smp_mflags}
- gzip -9 ChangeLog
-@@ -1285,6 +1289,11 @@ mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \
-    $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes-64.stp
+            --with-qemu-user=%{qemu_user} \
+            --with-qemu-group=%{qemu_group} \
+            %{init_scripts}
+@@ -1035,6 +1039,11 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
+ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml
  %endif
  
-+mkdir libvirt-docs/gcno
++mkdir docs/gcno
 +rsync -avm --include='*.gcno' --include='*.c' --include='*.h' \
-+    --include='*.generated.*' -f 'hide,! */' . libvirt-docs/gcno
-+chmod a+rw -R libvirt-docs/gcno
++    --include='*.generated.*' -f 'hide,! */' . docs/gcno
++chmod a+rw -R docs/gcno
 +
  %clean
  rm -fr %{buildroot}
  
-@@ -1342,6 +1351,9 @@ fi
- /sbin/chkconfig --add virtlogd
- /sbin/chkconfig --add virtlockd
+@@ -1067,6 +1076,9 @@ if ! getent passwd qemu >/dev/null; then
+ fi
+ exit 0
  %endif
 +if [ -d "/usr/coverage/BUILD/libvirt-%{version}" ]; then
 +    mv -f /usr/coverage/BUILD/libvirt-%{version} /usr/coverage/BUILD/libvirt-%{version}-bk
 +fi
  
- %preun daemon
- %if %{with_systemd}
-@@ -1785,6 +1797,7 @@ exit 0
+ %post
+ 
+@@ -1384,6 +1396,7 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
  %{_mandir}/man1/virt-host-validate.1*
  %{_bindir}/virsh
  %{_bindir}/virt-xml-validate
 +%{_bindir}/virtcov
  %{_bindir}/virt-pki-validate
  %{_bindir}/virt-host-validate
- 
+ %{_libdir}/lib*.so.*
+@@ -1438,6 +1451,7 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
+ 
+ %doc docs/*.html docs/html docs/*.gif
+ %doc docs/libvirt-api.xml
++%doc docs/gcno/*
+ %doc examples/hellolibvirt
+ %doc examples/domain-events/events-c
+ %doc examples/dominfo
 diff --git a/tools/Makefile.am b/tools/Makefile.am
-index 319abb2..e52b1ac 100644
+index 9391696..2e37236 100644
 --- a/tools/Makefile.am
 +++ b/tools/Makefile.am
-@@ -64,6 +64,7 @@ EXTRA_DIST = \
- 	libvirt-guests.sysconf				\
- 	virt-login-shell.conf				\
- 	virsh-edit.c					\
-+	virtcov.in					\
- 	$(PODFILES)					\
- 	$(MANINFILES)					\
- 	$(NULL)
-@@ -76,7 +77,7 @@ MAINTAINERCLEANFILES =
- confdir = $(sysconfdir)/libvirt
- conf_DATA =
- 
--bin_SCRIPTS = virt-xml-validate virt-pki-validate
-+bin_SCRIPTS = virt-xml-validate virt-pki-validate virtcov
- bin_PROGRAMS = virsh virt-admin
- libexec_SCRIPTS = libvirt-guests.sh
- man1_MANS = \
-@@ -107,6 +108,10 @@ virt-xml-validate: virt-xml-validate.in Makefile
- 		       -e 's|[@]VERSION@|$(VERSION)|g' \
- 	  < $< > $@ || (rm $@ && exit 1) && chmod +x $@
- 
+@@ -92,6 +92,12 @@ virt_host_validate_SOURCES = \
+ 		virt-host-validate-lxc.c virt-host-validate-lxc.h \
+ 		$(NULL)
+ 
++EXTRA_DIST += virtcov.in
++bin_SCRIPTS += virtcov
 +virtcov: virtcov.in Makefile
 +	$(AM_V_GEN)sed -e 's|[@]VERSION@|$(VERSION)|g' \
 +		< $< > $@ || (rm $@ && exit 1) && chmod +x $@
 +
- virt-pki-validate: virt-pki-validate.in Makefile
- 	$(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|g' \
- 		       -e 's|[@]VERSION@|$(VERSION)|g' \
+ virt_host_validate_LDFLAGS = \
+ 		$(AM_LDFLAGS) \
+ 		$(PIE_LDFLAGS) \
 diff --git a/tools/virtcov.in b/tools/virtcov.in
 new file mode 100644
-index 0000000..3b2818e
+index 0000000..099a58f
 --- /dev/null
 +++ b/tools/virtcov.in
 @@ -0,0 +1,208 @@

 License: LGPLv2+
 Group: Development/Libraries
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@@ -474,6 +474,9 @@ Requires: numad
 Requires: dbus
 # For uid creation during pre
 Requires(pre): shadow-utils

+# <http://www.gnu.org/licenses/>.
+
+version="@VERSION@"
+COVPATH="/usr/share/doc/libvirt-devel-${version}/gcno/"
+WORKPATH="/usr/coverage/BUILD/libvirt-${version}/"
+COVERAGE_POOL="127.0.0.1:8000"
+
