libvirt/478a4d07-systemd-build-fix.patch

82 lines
2.7 KiB
Diff

commit 478a4d07ac489e9a52defe65290f1aeedc92393a
Author: Daniel P. Berrange <berrange@redhat.com>
Date: Thu Dec 8 13:30:24 2011 +0000
Fix installation of libvirt-guests.service
The installation rules for the libvirt-guests.service were
totally broken
- Installing in the wrong location
- The location was not overridable
- The install-systemd rule was not invoked anywhere
- The install-systemd rule was not invoking install-initscript
which it depends on
- The installed service file lacked a .service extension
* tools/Makefile.am: Fix install of libvirt-guests.service
Index: libvirt-0.9.8/tools/Makefile.am
===================================================================
--- libvirt-0.9.8.orig/tools/Makefile.am
+++ libvirt-0.9.8/tools/Makefile.am
@@ -148,9 +148,9 @@ endif
virsh.1: virsh.pod
$(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@
-install-data-local: install-init
+install-data-local: install-init install-systemd
-uninstall-local: uninstall-init
+uninstall-local: uninstall-init uninstall-systemd
install-sysconfig:
mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
@@ -162,17 +162,20 @@ uninstall-sysconfig:
EXTRA_DIST += libvirt-guests.init.sh
-if LIBVIRT_INIT_SCRIPT_RED_HAT
-install-init: libvirt-guests.init install-sysconfig
+install-initscript: libvirt-guests.init
mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
$(INSTALL_SCRIPT) libvirt-guests.init \
$(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests
-uninstall-init: install-sysconfig
+uninstall-initscript:
rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests
-BUILT_SOURCES += libvirt-guests.init
+
+if LIBVIRT_INIT_SCRIPT_RED_HAT
+BUILT_SOURCES += libvirt-guests.init
+install-init: install-sysconfig install-initscript
+uninstall-init: uninstall-sysconfig uninstall-initscript
else
install-init:
uninstall-init:
@@ -194,14 +197,16 @@ libvirt-guests.init: libvirt-guests.init
EXTRA_DIST += libvirt-guests.service.in
+SYSTEMD_UNIT_DIR = /lib/systemd/system
+
if LIBVIRT_INIT_SCRIPT_SYSTEMD
-install-systemd: libvirt-guests.service install-sysconfig
- mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/systemd.d
+install-systemd: libvirt-guests.service install-initscript install-sysconfig
+ mkdir -p $(DESTDIR)$(SYSTEMD_UNIT_DIR)
$(INSTALL_SCRIPT) libvirt-guests.service \
- $(DESTDIR)$(sysconfdir)/rc.d/systemd.d/libvirt-guests
+ $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
-uninstall-systemd: install-sysconfig
- rm -f $(DESTDIR)$(sysconfdir)/rc.d/systemd.d/libvirt-guests
+uninstall-systemd: uninstall-initscript uninstall-sysconfig
+ rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
BUILT_SOURCES += libvirt-guests.service