[libvirt] [PATCH] build: only install examples when nwfilter is defined

Only install nwfilter example XML files when WITH_NWFILTER is defined. --- examples/xml/nwfilter/Makefile.am | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/xml/nwfilter/Makefile.am b/examples/xml/nwfilter/Makefile.am index 6264428..0344ce9 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,7 @@ uninstall-local:: rm -f "$(NWFILTER_DIR)/$$f"; \ done -test -z $(shell ls $(NWFILTER_DIR)) || rmdir $(NWFILTER_DIR) +else +install-data-local: +uninstall-local:: +endif -- 1.8.0.1

On 06/04/2013 08:43 AM, Jim Fehlig wrote:
Only install nwfilter example XML files when WITH_NWFILTER is defined.
Does this require any corresponding libvirt.spec.in file changes?
--- examples/xml/nwfilter/Makefile.am | 5 +++++ 1 file changed, 5 insertions(+)
Looks reasonable, but I'd like an answer to the spec file question before this gets pushed.
diff --git a/examples/xml/nwfilter/Makefile.am b/examples/xml/nwfilter/Makefile.am index 6264428..0344ce9 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,7 @@ uninstall-local:: rm -f "$(NWFILTER_DIR)/$$f"; \ done -test -z $(shell ls $(NWFILTER_DIR)) || rmdir $(NWFILTER_DIR) +else +install-data-local: +uninstall-local:: +endif
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Eric Blake wrote:
On 06/04/2013 08:43 AM, Jim Fehlig wrote:
Only install nwfilter example XML files when WITH_NWFILTER is defined.
Does this require any corresponding libvirt.spec.in file changes?
I don't think so. I stumbled across this issue doing a client-only package build, where WITH_NWFILTER is not defined yet the XML examples get installed. Regards, Jim
--- examples/xml/nwfilter/Makefile.am | 5 +++++ 1 file changed, 5 insertions(+)
Looks reasonable, but I'd like an answer to the spec file question before this gets pushed.
diff --git a/examples/xml/nwfilter/Makefile.am b/examples/xml/nwfilter/Makefile.am index 6264428..0344ce9 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,7 @@ uninstall-local:: rm -f "$(NWFILTER_DIR)/$$f"; \ done -test -z $(shell ls $(NWFILTER_DIR)) || rmdir $(NWFILTER_DIR) +else +install-data-local: +uninstall-local:: +endif

On 06/04/2013 11:32 AM, Jim Fehlig wrote:
Eric Blake wrote:
On 06/04/2013 08:43 AM, Jim Fehlig wrote:
Only install nwfilter example XML files when WITH_NWFILTER is defined.
Does this require any corresponding libvirt.spec.in file changes?
I don't think so. I stumbled across this issue doing a client-only package build, where WITH_NWFILTER is not defined yet the XML examples get installed.
I'm looking at examples like this in the spec file: %if ! %{with_python} rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-python-%{version} %else rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-python-%{version}/examples %endif but note that those files are also conditionally called out later under %files python. My initial concern was whether we need a corresponding %if ! %{with_nwfilter} clause which removes the nwfilter example files when building an rpm without nwfilter. But looking for where those files get installed, I only found the recursive: %doc examples/xml which merely copies into the rpm all doc files that got installed; and your change is to the Makefile to not install them in the first place. Different from the python examples, the examples/xml files are all installed into a single sub-package. So it looks like creating an rpm of just the client libraries should still succeed, as it's not referencing any file name that didn't exist, nor stranding any files behind. I ran out of time to actually test a 'make rpm' of just a client build, but have convinced myself that: a) your change seems like it is clean, and b) we have time to fix it before 1.0.7 if further testing turns up anything. On the other hand; WITH_NWFILTER controlls what libvirtd provides, not what the client can do. Technically, even on a machine where the client was built without nwfilter support, that client can still talk to a libvirtd with nwfilter enabled, at which point the examples are still usable. I'm still reluctant to give ack, but now for a different reason. I'm not convinced that compiling client-only has any bearing on whether the nwfilter xml examples are useful, because it is not the client that talks to nwfilter in the first place, but libvirtd, and you can't know what capabilities the libvirtd will have that the client will be talking to. Does anyone else have an opinion? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 06/04/2013 07:02 PM, Eric Blake wrote:
On the other hand; WITH_NWFILTER controlls what libvirtd provides, not what the client can do. Technically, even on a machine where the client was built without nwfilter support, that client can still talk to a libvirtd with nwfilter enabled, at which point the examples are still usable.
This makes sense to me. What do we do for other similar functionality?

On 06/05/2013 05:38 AM, Laine Stump wrote:
On 06/04/2013 07:02 PM, Eric Blake wrote:
On the other hand; WITH_NWFILTER controlls what libvirtd provides, not what the client can do. Technically, even on a machine where the client was built without nwfilter support, that client can still talk to a libvirtd with nwfilter enabled, at which point the examples are still usable.
This makes sense to me. What do we do for other similar functionality?
Weird. examples/xml/nwfilter is the only subdirectory of examples/xml that installs anything in the first place. All other examples/xml/*/*.xml files that get installed are done via the top-level Makefile.am using a generic XML_EXAMPLES wildcard. Maybe we just need to remove examples/xml/nwfilter/Makefile.am and consolidate it into the top-level alongside the other examples. Meanwhile, I was looking whether examples/xml/storage/pool-netfs.xml might be a case of something that is conditional on build flags (not all libvirtd support netfs), and since that appears to be installed unconditionally, that is another argument for making nwfilter examples unconditional. I also wonder if our current installation of examples/xml/** under the libvirt-devel subpackage, instead of under the libvirt-docs subpackage, makes sense. Ultimately, it looks like this report has opened a can of worms. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Eric Blake wrote:
On 06/05/2013 05:38 AM, Laine Stump wrote:
On 06/04/2013 07:02 PM, Eric Blake wrote:
On the other hand; WITH_NWFILTER controlls what libvirtd provides, not what the client can do. Technically, even on a machine where the client was built without nwfilter support, that client can still talk to a libvirtd with nwfilter enabled, at which point the examples are still usable.
This makes sense to me. What do we do for other similar functionality?
Weird. examples/xml/nwfilter is the only subdirectory of examples/xml that installs anything in the first place. All other examples/xml/*/*.xml files that get installed are done via the top-level Makefile.am using a generic XML_EXAMPLES wildcard. Maybe we just need to remove examples/xml/nwfilter/Makefile.am and consolidate it into the top-level alongside the other examples.
This sounds reasonable to me...
Meanwhile, I was looking whether examples/xml/storage/pool-netfs.xml might be a case of something that is conditional on build flags (not all libvirtd support netfs), and since that appears to be installed unconditionally, that is another argument for making nwfilter examples unconditional.
particularly if we just want to install the nwfilter examples unconditionally. Should I pursue a patch along these lines?
I also wonder if our current installation of examples/xml/** under the libvirt-devel subpackage, instead of under the libvirt-docs subpackage, makes sense.
Good question. The libvirt-devel subpackage already requires libvirt-docs subpackage, so seems the examples should be stuffed in the docs subpackage. Regards, Jim
participants (3)
-
Eric Blake
-
Jim Fehlig
-
Laine Stump