[libvirt] [PATCH 09/16] examples: Install nwfilters without shell scripting

Andrea Bolognani abologna at redhat.com
Wed May 22 17:53:00 UTC 2019


We're doing nothing more than copying files to a target
directory, so we don't need any custom shell commands and
can just use the standard autotools data installation
support instead.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 examples/Makefile.am | 23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/examples/Makefile.am b/examples/Makefile.am
index 8c7f4a3d64..67d959c6a3 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -90,38 +90,23 @@ admin_client_info_SOURCES = admin/client_info.c
 admin_client_close_SOURCES = admin/client_close.c
 admin_logging_SOURCES = admin/logging.c
 
-INSTALL_DATA_LOCAL =
-UNINSTALL_LOCAL =
-
 if WITH_NWFILTER
-NWFILTER_DIR = "$(DESTDIR)$(sysconfdir)/libvirt/nwfilter"
-
-install-nwfilter-local:
-	$(MKDIR_P) "$(NWFILTER_DIR)"
-	for f in $(FILTERS); do \
-		$(INSTALL_DATA) $$f "$(NWFILTER_DIR)"; \
-	done
 
-uninstall-nwfilter-local::
-	for f in $(FILTERS); do \
-		rm -f "$(NWFILTER_DIR)/`basename $$f`"; \
-	done
-	-test -z "$(shell ls $(NWFILTER_DIR))" || rmdir $(NWFILTER_DIR)
+nwfilterdir = $(sysconfdir)/libvirt/nwfilter
+nwfilter_DATA = $(FILTERS)
 
-INSTALL_DATA_LOCAL += install-nwfilter-local
-UNINSTALL_LOCAL += uninstall-nwfilter-local
 endif WITH_NWFILTER
 
 examplesdir = $(docdir)/examples
 
-install-data-local: $(INSTALL_DATA_LOCAL)
+install-data-local:
 	for p in $(EXAMPLES); do \
 		d=$$(dirname $$p); \
 		$(mkinstalldirs) $(DESTDIR)$(examplesdir)/$$d; \
 		$(INSTALL_DATA) $(srcdir)/$${p}.c $(DESTDIR)$(examplesdir)/$$d/; \
 	done
 
-uninstall-local: $(UNINSTALL_LOCAL)
+uninstall-local:
 	for p in $(EXAMPLES); do \
 		rm -f $(DESTDIR)$(examplesdir)/$${p}.c; \
 	done
-- 
2.21.0




More information about the libvir-list mailing list