src: simplify sysconfig file handling in make rules

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é <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2018-02-20 14:28:00 +00:00
parent cd191ba0bb
commit 5f998681df

View File

@ -2683,23 +2683,32 @@ EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
$(LOG_DAEMON_SOURCES) $(LOG_DAEMON_SOURCES)
endif ! WITH_LIBVIRTD endif ! WITH_LIBVIRTD
EXTRA_DIST += \ SYSCONF_FILES = \
locking/virtlockd.sysconf \ locking/virtlockd.sysconf \
logging/virtlogd.sysconf \
$(NULL)
EXTRA_DIST += \
locking/lockd.conf \ locking/lockd.conf \
locking/libvirt_lockd.aug \ locking/libvirt_lockd.aug \
locking/test_libvirt_lockd.aug.in \ locking/test_libvirt_lockd.aug.in \
logging/virtlogd.sysconf $(SYSCONF_FILES) \
$(NULL)
install-sysconfig: install-sysconfig:
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \ for f in $(SYSCONF_FILES:%.sysconf=%) ; \
$(DESTDIR)$(sysconfdir)/sysconfig/virtlockd do \
$(INSTALL_DATA) $(srcdir)/logging/virtlogd.sysconf \ tgt=`basename $$f`; \
$(DESTDIR)$(sysconfdir)/sysconfig/virtlogd $(INSTALL_SCRIPT) $$f.sysconf $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
done
uninstall-sysconfig: uninstall-sysconfig:
rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd for f in $(SYSCONF_FILES:%.sysconf=%) ; \
rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd do \
tgt=`basename $$f`; \
rm -f $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
done
rmdir $(DESTDIR)$(sysconfdir)/sysconfig || : rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
SYSVINIT_FILES_IN = \ SYSVINIT_FILES_IN = \