[libvirt] [PATCH 1/n] spec: fix rpm build when lxc disabled

'make rpm' failed if ~/.rpmmacros contains '%_without_lxc 1', which simulates the case of not having lxc available. RPM build errors: File not found: /home/eblake/rpmbuild/BUILDROOT/libvirt-1.1.1-1.fc19.x86_64/etc/libvirt/virt-login-shell.conf File not found by glob: /home/eblake/rpmbuild/BUILDROOT/libvirt-1.1.1-1.fc19.x86_64/usr/share/man/man1/virt-login-shell.1* File not found: /home/eblake/rpmbuild/BUILDROOT/libvirt-1.1.1-1.fc19.x86_64/usr/bin/virt-login-shell make: *** [rpm] Error 1 Reported by Dan Berrange. * libvirt.spec.in: Mark virt-login-shell as conditional on lxc. Signed-off-by: Eric Blake <eblake@redhat.com> --- I'm working on a couple more that I spotted while in the area: we still unconditionally build vbox even though we recently moved it into libvirtd for licensing reasons, which means a client_only build will probably fall over on that; but while testing my hypothesis, I discoverd that a client_only build fails even earlier with: TEST: fdstreamtest 1) Stream read blocking ... OK 2) Stream read non-blocking ... Unexpected EOF block 0 want 128 FAILED 3) Stream write blocking ... OK 4) Stream write non-blocking ... Failed to finish stream: internal error: libvirt: error : cannot execute binary /home/eblake/rpmbuild/BUILD/libvirt-1.1.1/tests/../src/libvirt_iohelper: No such file or directory libvirt.spec.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index e94901a..affd2ec 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -2014,17 +2014,23 @@ fi %doc AUTHORS ChangeLog.gz NEWS README COPYING COPYING.LESSER TODO %config(noreplace) %{_sysconfdir}/libvirt/libvirt.conf +%if %{with_lxc} %config(noreplace) %{_sysconfdir}/libvirt/virt-login-shell.conf +%endif %{_mandir}/man1/virsh.1* %{_mandir}/man1/virt-xml-validate.1* %{_mandir}/man1/virt-pki-validate.1* %{_mandir}/man1/virt-host-validate.1* +%if %{with_lxc} %{_mandir}/man1/virt-login-shell.1* +%endif %{_bindir}/virsh %{_bindir}/virt-xml-validate %{_bindir}/virt-pki-validate %{_bindir}/virt-host-validate +%if %{with_lxc} %attr(4755, root, root) %{_bindir}/virt-login-shell +%endif %{_libdir}/lib*.so.* %if %{with_dtrace} -- 1.8.3.1

An rpm build with client_only set to 1 (for example, RHEL 5 on s390, or by modifying libvirt.spec.in) failed with TEST: fdstreamtest 1) Stream read blocking ... OK 2) Stream read non-blocking ... Unexpected EOF block 0 want 128 FAILED 3) Stream write blocking ... OK 4) Stream write non-blocking ... Failed to finish stream: internal error: libvirt: error : cannot execute binary /home/eblake/rpmbuild/BUILD/libvirt-1.1.1/tests/../src/libvirt_iohelper: No such file or directory Since the test depends on something that was only built for WITH_LIBVIRTD (see src/Makefile.am), we must do the same for the test. * tests/Makefile.am (test_programs): Make fdstreamtest conditional. Signed-off-by: Eric Blake <eblake@redhat.com> --- tests/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index c800179..f46ff56 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -128,10 +128,13 @@ test_programs = virshtest sockettest \ virportallocatortest \ sysinfotest \ virstoragetest \ - fdstreamtest \ fchosttest \ $(NULL) +if WITH_LIBVIRTD +test_programs += fdstreamtest +endif + if WITH_DBUS test_programs += virdbustest \ virsystemdtest -- 1.8.3.1

On 04.09.2013 00:48, Eric Blake wrote:
An rpm build with client_only set to 1 (for example, RHEL 5 on s390, or by modifying libvirt.spec.in) failed with
TEST: fdstreamtest 1) Stream read blocking ... OK 2) Stream read non-blocking ... Unexpected EOF block 0 want 128 FAILED 3) Stream write blocking ... OK 4) Stream write non-blocking ... Failed to finish stream: internal error: libvirt: error : cannot execute binary /home/eblake/rpmbuild/BUILD/libvirt-1.1.1/tests/../src/libvirt_iohelper: No such file or directory
Since the test depends on something that was only built for WITH_LIBVIRTD (see src/Makefile.am), we must do the same for the test.
* tests/Makefile.am (test_programs): Make fdstreamtest conditional.
Signed-off-by: Eric Blake <eblake@redhat.com> --- tests/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am index c800179..f46ff56 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -128,10 +128,13 @@ test_programs = virshtest sockettest \ virportallocatortest \ sysinfotest \ virstoragetest \ - fdstreamtest \ fchosttest \ $(NULL)
+if WITH_LIBVIRTD +test_programs += fdstreamtest +endif + if WITH_DBUS test_programs += virdbustest \ virsystemdtest
ACK Michal

On 09/04/2013 06:38 AM, Michal Privoznik wrote:
On 04.09.2013 00:48, Eric Blake wrote:
An rpm build with client_only set to 1 (for example, RHEL 5 on s390, or by modifying libvirt.spec.in) failed with
* tests/Makefile.am (test_programs): Make fdstreamtest conditional.
Signed-off-by: Eric Blake <eblake@redhat.com> --- tests/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
ACK
Pushed. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

'make rpm' with client_local set to 1 (by manual modification, or with RHEL 5 on s390) warns: RPM build errors: Installed (but unpackaged) file(s) found: /etc/libvirt/nwfilter/allow-arp.xml /etc/libvirt/nwfilter/allow-dhcp-server.xml /etc/libvirt/nwfilter/allow-dhcp.xml /etc/libvirt/nwfilter/allow-incoming-ipv4.xml /etc/libvirt/nwfilter/allow-ipv4.xml /etc/libvirt/nwfilter/clean-traffic.xml /etc/libvirt/nwfilter/no-arp-ip-spoofing.xml /etc/libvirt/nwfilter/no-arp-mac-spoofing.xml /etc/libvirt/nwfilter/no-arp-spoofing.xml /etc/libvirt/nwfilter/no-ip-multicast.xml /etc/libvirt/nwfilter/no-ip-spoofing.xml /etc/libvirt/nwfilter/no-mac-broadcast.xml /etc/libvirt/nwfilter/no-mac-spoofing.xml /etc/libvirt/nwfilter/no-other-l2-traffic.xml /etc/libvirt/nwfilter/no-other-rarp-traffic.xml /etc/libvirt/nwfilter/qemu-announce-self-rarp.xml /etc/libvirt/nwfilter/qemu-announce-self.xml /usr/share/polkit-1/actions/org.libvirt.api.policy The bulk of these are fixed with this patch. * examples/xml/nwfilter/Makefile.am (install-data-local) (uninstall-local): Make conditional. Signed-off-by: Eric Blake <eblake@redhat.com> --- This is one alternative; see 3b/n for the other alternative (that is, I'm not sure whether it's better to have the Makefiles match the spec file layout, or to have the spec file paper over unconditional Makefiles). Preferences? examples/xml/nwfilter/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/xml/nwfilter/Makefile.am b/examples/xml/nwfilter/Makefile.am index 6264428..ec1e7ee 100644 --- a/examples/xml/nwfilter/Makefile.am +++ b/examples/xml/nwfilter/Makefile.am @@ -39,6 +39,7 @@ confdir = $(sysconfdir)/libvirt NWFILTER_DIR = "$(DESTDIR)$(sysconfdir)/libvirt/nwfilter" +if WITH_NWFILTER install-data-local: $(MKDIR_P) "$(NWFILTER_DIR)" for f in $(FILTERS); do \ @@ -50,3 +51,4 @@ uninstall-local:: rm -f "$(NWFILTER_DIR)/$$f"; \ done -test -z $(shell ls $(NWFILTER_DIR)) || rmdir $(NWFILTER_DIR) +endif WITH_NWFILTER -- 1.8.3.1

On 04.09.2013 04:52, Eric Blake wrote:
'make rpm' with client_local set to 1 (by manual modification, or with RHEL 5 on s390) warns:
RPM build errors: Installed (but unpackaged) file(s) found: /etc/libvirt/nwfilter/allow-arp.xml /etc/libvirt/nwfilter/allow-dhcp-server.xml /etc/libvirt/nwfilter/allow-dhcp.xml /etc/libvirt/nwfilter/allow-incoming-ipv4.xml /etc/libvirt/nwfilter/allow-ipv4.xml /etc/libvirt/nwfilter/clean-traffic.xml /etc/libvirt/nwfilter/no-arp-ip-spoofing.xml /etc/libvirt/nwfilter/no-arp-mac-spoofing.xml /etc/libvirt/nwfilter/no-arp-spoofing.xml /etc/libvirt/nwfilter/no-ip-multicast.xml /etc/libvirt/nwfilter/no-ip-spoofing.xml /etc/libvirt/nwfilter/no-mac-broadcast.xml /etc/libvirt/nwfilter/no-mac-spoofing.xml /etc/libvirt/nwfilter/no-other-l2-traffic.xml /etc/libvirt/nwfilter/no-other-rarp-traffic.xml /etc/libvirt/nwfilter/qemu-announce-self-rarp.xml /etc/libvirt/nwfilter/qemu-announce-self.xml /usr/share/polkit-1/actions/org.libvirt.api.policy
The bulk of these are fixed with this patch.
* examples/xml/nwfilter/Makefile.am (install-data-local) (uninstall-local): Make conditional.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
This is one alternative; see 3b/n for the other alternative (that is, I'm not sure whether it's better to have the Makefiles match the spec file layout, or to have the spec file paper over unconditional Makefiles). Preferences?
examples/xml/nwfilter/Makefile.am | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/examples/xml/nwfilter/Makefile.am b/examples/xml/nwfilter/Makefile.am index 6264428..ec1e7ee 100644 --- a/examples/xml/nwfilter/Makefile.am +++ b/examples/xml/nwfilter/Makefile.am @@ -39,6 +39,7 @@ confdir = $(sysconfdir)/libvirt
NWFILTER_DIR = "$(DESTDIR)$(sysconfdir)/libvirt/nwfilter"
+if WITH_NWFILTER install-data-local: $(MKDIR_P) "$(NWFILTER_DIR)" for f in $(FILTERS); do \ @@ -50,3 +51,4 @@ uninstall-local:: rm -f "$(NWFILTER_DIR)/$$f"; \ done -test -z $(shell ls $(NWFILTER_DIR)) || rmdir $(NWFILTER_DIR) +endif WITH_NWFILTER
I like this approach more, since it fixes Makefile too. We shouldn't be installing files we weren't requested. ACK to this version. Michal

On 09/04/2013 07:22 AM, Michal Privoznik wrote:
On 04.09.2013 04:52, Eric Blake wrote:
'make rpm' with client_local set to 1 (by manual modification, or with RHEL 5 on s390) warns:
The bulk of these are fixed with this patch.
* examples/xml/nwfilter/Makefile.am (install-data-local) (uninstall-local): Make conditional.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
This is one alternative; see 3b/n for the other alternative (that is, I'm not sure whether it's better to have the Makefiles match the spec file layout, or to have the spec file paper over unconditional Makefiles). Preferences?
I like this approach more, since it fixes Makefile too. We shouldn't be installing files we weren't requested.
ACK to this version.
Yay - that was my personal favorite, too. Looks like I have some followup patches to write, for the other instances of 'rm' in the spec file due to installing unnecessary stuff depending on options chosen. Pushed. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

'make rpm' when client_only is requested reports that nwfilter files were installed but not packaged. * libvirt.spec.in (%install): Remove nwfilter files if not used. Signed-off-by: Eric Blake <eblake@redhat.com> --- See my question in 3a/n about whether the change should be done here or in the makefile. If in the makefile, then there's probably a few more of these 'rm' calls in the spec file that are working around the makefile being unconditional, which we should also consider as bugs worth fixing in separate patches. libvirt.spec.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index e4b8329..78fe6e7 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1465,6 +1465,10 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirt_sanlock.aug rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug %endif +%if ! %{with_nwfilter} +rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml +%endif + %if ! %{with_lxc} rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_lxc.aug rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug -- 1.8.3.1

Commit ba5f3c7 moved virtualBox support into libvirtd, but the spec file was still unconditionally requesting it even when not building the server side. This leads to the weird result of building libvirt-client and libvirt-daemon-lxc rpms when client_only is requested (via manual edit, or via RHEL 5 on s390). * libvirt.spec.in (with_vbox): Hoist to server conditionals. Signed-off-by: Eric Blake <eblake@redhat.com> --- I'm still chasing down other oddities (at least a 5/n is needed to fix a file leftover during 'make rpm', as mentioned in the log of 3a/n), before I can actually verify my claim that the wrong rpms are built from a client-only build; but wanted to post this at least for a logical review. libvirt.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index affd2ec..e4b8329 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -50,6 +50,7 @@ %define with_lxc 0%{!?_without_lxc:%{server_drivers}} %define with_uml 0%{!?_without_uml:%{server_drivers}} %define with_libxl 0%{!?_without_libxl:%{server_drivers}} +%define with_vbox 0%{!?_without_vbox:%{server_drivers}} %define with_qemu_tcg %{with_qemu} # Change if we ever provide qemu-kvm binaries on non-x86 hosts @@ -71,7 +72,6 @@ # Then the hypervisor drivers that run outside libvirtd, in libvirt.so %define with_openvz 0%{!?_without_openvz:1} -%define with_vbox 0%{!?_without_vbox:1} %define with_vmware 0%{!?_without_vmware:1} %define with_phyp 0%{!?_without_phyp:1} %define with_esx 0%{!?_without_esx:1} -- 1.8.3.1

On 04.09.2013 04:56, Eric Blake wrote:
Commit ba5f3c7 moved virtualBox support into libvirtd, but the spec file was still unconditionally requesting it even when not building the server side. This leads to the weird result of building libvirt-client and libvirt-daemon-lxc rpms when client_only is requested (via manual edit, or via RHEL 5 on s390).
* libvirt.spec.in (with_vbox): Hoist to server conditionals.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
I'm still chasing down other oddities (at least a 5/n is needed to fix a file leftover during 'make rpm', as mentioned in the log of 3a/n), before I can actually verify my claim that the wrong rpms are built from a client-only build; but wanted to post this at least for a logical review.
libvirt.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index affd2ec..e4b8329 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -50,6 +50,7 @@ %define with_lxc 0%{!?_without_lxc:%{server_drivers}} %define with_uml 0%{!?_without_uml:%{server_drivers}} %define with_libxl 0%{!?_without_libxl:%{server_drivers}} +%define with_vbox 0%{!?_without_vbox:%{server_drivers}}
%define with_qemu_tcg %{with_qemu} # Change if we ever provide qemu-kvm binaries on non-x86 hosts @@ -71,7 +72,6 @@
# Then the hypervisor drivers that run outside libvirtd, in libvirt.so %define with_openvz 0%{!?_without_openvz:1} -%define with_vbox 0%{!?_without_vbox:1} %define with_vmware 0%{!?_without_vmware:1} %define with_phyp 0%{!?_without_phyp:1} %define with_esx 0%{!?_without_esx:1}
ACK Michal

On 09/04/2013 07:22 AM, Michal Privoznik wrote:
On 04.09.2013 04:56, Eric Blake wrote:
Commit ba5f3c7 moved virtualBox support into libvirtd, but the spec file was still unconditionally requesting it even when not building the server side. This leads to the weird result of building libvirt-client and libvirt-daemon-lxc rpms when client_only is requested (via manual edit, or via RHEL 5 on s390).
Further testing proved my hypothesis wrong - all of the libvirt-daemon-vbox conditionals were already protected by the master with_libvirt conditional, so having with_vbox set to 1 on a client-only build didn't have any negative impact. But this patch doesn't hurt, and still makes sense from a cleanliness point of view, so...
* libvirt.spec.in (with_vbox): Hoist to server conditionals.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
ACK
I've gone ahead and pushed it with an updated commit message. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Untested for now (it's late for me), but seems right... daemon/Makefile.am installs a .policy file if WITH_POLKIT is set (which is supposedly the union between WITH_POLKIT0 and WITH_POLKIT1). src/Makefile.am, on the other hand, installs a .policy file if WITH_POLKIT1 is set. When running 'make rpm' with client_only manually set, on a Fedora 19 box, it appears that WITH_POLKIT1 is true (the polkit 1 library exists) but WITH_POLKIT is false (the spec file requests that configure explicitly use --without-polkit), which leads to this failure: RPM build errors: Installed (but unpackaged) file(s) found: /usr/share/polkit-1/actions/org.libvirt.api.policy Fix it by adding another conditional. Signed-off-by: Eric Blake <eblake@redhat.com> --- I'll test this before pushing (and amend the commit message to drop the first paragraph), even if it gets a positive review in the meantime. This patch was much easier to finally figure out once I first wrote this other patch (still pending review): https://www.redhat.com/archives/libvir-list/2013-September/msg00195.html src/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index 9b336fd..37beb6c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1497,7 +1497,9 @@ if WITH_POLKIT1 libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES) polkitactiondir = $(datadir)/polkit-1/actions +if WITH_POLKIT polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY) +endif WITH_POLKIT $(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \ $(srcdir)/access/genpolkit.pl Makefile.am -- 1.8.3.1

On 04.09.2013 05:07, Eric Blake wrote:
Untested for now (it's late for me), but seems right...
daemon/Makefile.am installs a .policy file if WITH_POLKIT is set (which is supposedly the union between WITH_POLKIT0 and WITH_POLKIT1). src/Makefile.am, on the other hand, installs a .policy file if WITH_POLKIT1 is set. When running 'make rpm' with client_only manually set, on a Fedora 19 box, it appears that WITH_POLKIT1 is true (the polkit 1 library exists) but WITH_POLKIT is false (the spec file requests that configure explicitly use --without-polkit), which leads to this failure:
RPM build errors: Installed (but unpackaged) file(s) found: /usr/share/polkit-1/actions/org.libvirt.api.policy
Fix it by adding another conditional.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
I'll test this before pushing (and amend the commit message to drop the first paragraph), even if it gets a positive review in the meantime.
This patch was much easier to finally figure out once I first wrote this other patch (still pending review): https://www.redhat.com/archives/libvir-list/2013-September/msg00195.html
src/Makefile.am | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/src/Makefile.am b/src/Makefile.am index 9b336fd..37beb6c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1497,7 +1497,9 @@ if WITH_POLKIT1 libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)
polkitactiondir = $(datadir)/polkit-1/actions +if WITH_POLKIT polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY) +endif WITH_POLKIT
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \ $(srcdir)/access/genpolkit.pl Makefile.am
ACK Michal

On 09/04/2013 07:22 AM, Michal Privoznik wrote:
On 04.09.2013 05:07, Eric Blake wrote:
Untested for now (it's late for me), but seems right...
daemon/Makefile.am installs a .policy file if WITH_POLKIT is set (which is supposedly the union between WITH_POLKIT0 and WITH_POLKIT1). src/Makefile.am, on the other hand, installs a .policy file if WITH_POLKIT1 is set. When running 'make rpm' with client_only manually set, on a Fedora 19 box, it appears that WITH_POLKIT1 is true (the polkit 1 library exists) but WITH_POLKIT is false (the spec file requests that configure explicitly use --without-polkit), which leads to this failure:
RPM build errors: Installed (but unpackaged) file(s) found: /usr/share/polkit-1/actions/org.libvirt.api.policy
Fix it by adding another conditional.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
I'll test this before pushing (and amend the commit message to drop the first paragraph), even if it gets a positive review in the meantime.
Glad I tested; the magic conditional was WITH_LIBVIRTD, rather than WITH_POLKIT. (Again, it's a shame that automake doesn't allow indented 'if/endif' to show how deeply nested things are, as the WITH_LIBVIRTD conditional in daemon/Makefile.am is much further away from the installation of a .policy file).
polkitactiondir = $(datadir)/polkit-1/actions +if WITH_POLKIT polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY) +endif WITH_POLKIT
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \ $(srcdir)/access/genpolkit.pl Makefile.am
ACK
I pushed the fixed version that actually passed testing. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 03.09.2013 23:27, Eric Blake wrote:
'make rpm' failed if ~/.rpmmacros contains '%_without_lxc 1', which simulates the case of not having lxc available.
RPM build errors: File not found: /home/eblake/rpmbuild/BUILDROOT/libvirt-1.1.1-1.fc19.x86_64/etc/libvirt/virt-login-shell.conf File not found by glob: /home/eblake/rpmbuild/BUILDROOT/libvirt-1.1.1-1.fc19.x86_64/usr/share/man/man1/virt-login-shell.1* File not found: /home/eblake/rpmbuild/BUILDROOT/libvirt-1.1.1-1.fc19.x86_64/usr/bin/virt-login-shell make: *** [rpm] Error 1
Reported by Dan Berrange.
* libvirt.spec.in: Mark virt-login-shell as conditional on lxc.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
I'm working on a couple more that I spotted while in the area: we still unconditionally build vbox even though we recently moved it into libvirtd for licensing reasons, which means a client_only build will probably fall over on that; but while testing my hypothesis, I discoverd that a client_only build fails even earlier with:
TEST: fdstreamtest 1) Stream read blocking ... OK 2) Stream read non-blocking ... Unexpected EOF block 0 want 128 FAILED 3) Stream write blocking ... OK 4) Stream write non-blocking ... Failed to finish stream: internal error: libvirt: error : cannot execute binary /home/eblake/rpmbuild/BUILD/libvirt-1.1.1/tests/../src/libvirt_iohelper: No such file or directory
libvirt.spec.in | 6 ++++++ 1 file changed, 6 insertions(+)
ACK Michal

On 09/04/2013 06:38 AM, Michal Privoznik wrote:
On 03.09.2013 23:27, Eric Blake wrote:
'make rpm' failed if ~/.rpmmacros contains '%_without_lxc 1', which simulates the case of not having lxc available.
RPM build errors: File not found: /home/eblake/rpmbuild/BUILDROOT/libvirt-1.1.1-1.fc19.x86_64/etc/libvirt/virt-login-shell.conf File not found by glob: /home/eblake/rpmbuild/BUILDROOT/libvirt-1.1.1-1.fc19.x86_64/usr/share/man/man1/virt-login-shell.1* File not found: /home/eblake/rpmbuild/BUILDROOT/libvirt-1.1.1-1.fc19.x86_64/usr/bin/virt-login-shell make: *** [rpm] Error 1
Reported by Dan Berrange.
* libvirt.spec.in: Mark virt-login-shell as conditional on lxc.
ACK
Thanks; pushed. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Several recent patches cleaned up 'make rpm' for the situation when client_only is true; these were done by manual spec file editing (since it's relatively hard to come by a RHEL 5 s390 box). Make it easier to do in the future via a simpler command line override. * libvirt.spec.in (client_only): Allow for override. Signed-off-by: Eric Blake <eblake@redhat.com> --- libvirt.spec.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index e4b8329..a55e87c 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -13,12 +13,13 @@ # touch configure.ac or Makefile.am. %{!?enable_autotools:%define enable_autotools 0} # A client only build will create a libvirt.so only containing # the generic RPC driver, and test driver and no libvirtd -# Default to a full server + client build -%define client_only 0 +# Default to a full server + client build, but with the possibility +# of a command-line or ~/.rpmmacros override for client-only. +%{!?client_only:%define client_only 0} # Now turn off server build in certain cases # RHEL-5 builds are client-only for s390, ppc %if 0%{?rhel} == 5 -- 1.8.3.1

On 04.09.2013 23:08, Eric Blake wrote:
Several recent patches cleaned up 'make rpm' for the situation when client_only is true; these were done by manual spec file editing (since it's relatively hard to come by a RHEL 5 s390 box). Make it easier to do in the future via a simpler command line override.
* libvirt.spec.in (client_only): Allow for override.
Signed-off-by: Eric Blake <eblake@redhat.com> --- libvirt.spec.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index e4b8329..a55e87c 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -13,12 +13,13 @@ # touch configure.ac or Makefile.am. %{!?enable_autotools:%define enable_autotools 0}
# A client only build will create a libvirt.so only containing # the generic RPC driver, and test driver and no libvirtd -# Default to a full server + client build -%define client_only 0 +# Default to a full server + client build, but with the possibility +# of a command-line or ~/.rpmmacros override for client-only. +%{!?client_only:%define client_only 0}
# Now turn off server build in certain cases
# RHEL-5 builds are client-only for s390, ppc %if 0%{?rhel} == 5
ACK Michal

On 09/05/2013 01:51 AM, Michal Privoznik wrote:
On 04.09.2013 23:08, Eric Blake wrote:
Several recent patches cleaned up 'make rpm' for the situation when client_only is true; these were done by manual spec file editing (since it's relatively hard to come by a RHEL 5 s390 box). Make it easier to do in the future via a simpler command line override.
* libvirt.spec.in (client_only): Allow for override.
Signed-off-by: Eric Blake <eblake@redhat.com> --- libvirt.spec.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
ACK
Thanks; pushed. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Michal Privoznik