From 5f998681dfe45ac421462b521a837b19df64a7be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 20 Feb 2018 14:28:00 +0000 Subject: [PATCH] src: simplify sysconfig file handling in make rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove lots of duplication in the sysconfig file handling, so we can add more conf files without modifying so many places. Signed-off-by: Daniel P. Berrangé --- src/Makefile.am | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index de2441dd6b..9fc4d876ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2683,23 +2683,32 @@ EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \ $(LOG_DAEMON_SOURCES) endif ! WITH_LIBVIRTD -EXTRA_DIST += \ +SYSCONF_FILES = \ locking/virtlockd.sysconf \ + logging/virtlogd.sysconf \ + $(NULL) + +EXTRA_DIST += \ locking/lockd.conf \ locking/libvirt_lockd.aug \ locking/test_libvirt_lockd.aug.in \ - logging/virtlogd.sysconf + $(SYSCONF_FILES) \ + $(NULL) install-sysconfig: $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig - $(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \ - $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd - $(INSTALL_DATA) $(srcdir)/logging/virtlogd.sysconf \ - $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd + for f in $(SYSCONF_FILES:%.sysconf=%) ; \ + do \ + tgt=`basename $$f`; \ + $(INSTALL_SCRIPT) $$f.sysconf $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \ + done uninstall-sysconfig: - rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd - rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd + for f in $(SYSCONF_FILES:%.sysconf=%) ; \ + do \ + tgt=`basename $$f`; \ + rm -f $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \ + done rmdir $(DESTDIR)$(sysconfdir)/sysconfig || : SYSVINIT_FILES_IN = \