[PATCH] install: fix virtlockd installation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The virtlockd daemon scripts were lousy, when compared to their
counterparts in daemon/Makefile.am.  In particular, when init
scripts were selected, this resulted in 'make distcheck' failing
due to failure to clean up src/virtlockd.init.

* src/Makefile.am (install-systemd): Fix dependencies.  Use MKDIR_P.
(uninstall-systemd): Remove empty directory.  Use fewer processes.
(install-init, install-sysconfig): Use MKDIR_P.
(uninstall-init): Remove correct file, and also empty directory.
(uninstall-sysconfig): Remove empty directory.
(CLEANFILES): Clean up built sources.
---
 src/Makefile.am | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 25b6e3f..dd7e219 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1628,24 +1628,26 @@ EXTRA_DIST += locking/virtlockd.sysconf \
 	locking/test_libvirt_lockd.aug.in

 install-sysconfig:
-	mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
+	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
 	$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
 	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd

 uninstall-sysconfig:
 	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
+	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :

 EXTRA_DIST += locking/virtlockd.init.in

 if WITH_LIBVIRTD
 if LIBVIRT_INIT_SCRIPT_RED_HAT
 install-init:: virtlockd.init install-sysconfig
-	mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
+	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
 	$(INSTALL_SCRIPT) virtlockd.init \
 	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd

 uninstall-init:: uninstall-sysconfig
-	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
+	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
+	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :

 BUILT_SOURCES += virtlockd.init
 else
@@ -1677,16 +1679,17 @@ SYSTEMD_UNIT_DIR = /lib/systemd/system

 BUILT_SOURCES += virtlockd.service virtlockd.socket

-install-systemd: virtlockd.init install-sysconfig
-	mkdir -p $(DESTDIR)$(SYSTEMD_UNIT_DIR)
+install-systemd: virtlockd.service virtlockd.socket install-sysconfig
+	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
 	$(INSTALL_SCRIPT) virtlockd.service \
 	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
 	$(INSTALL_SCRIPT) virtlockd.socket \
 	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/

 uninstall-systemd: uninstall-sysconfig
-	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service
-	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
+	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service \
+	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
+	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
 else
 install-systemd:
 uninstall-systemd:
@@ -2050,5 +2053,6 @@ endif
 	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:

 CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
+CLEANFILES += $(BUILT_SOURCES)
 DISTCLEANFILES += $(GENERATED_SYM_FILES)
 MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)
-- 
1.8.0.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]