Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
daemon/Makefile.am | 87 ++-------------------
src/Makefile.am | 92 ++++++++++++++++++++++-
{daemon => src/remote}/libvirtd.policy.in | 0
daemon/libvirt.rules => src/remote/libvirtd.rules | 0
{daemon => src/remote}/libvirtd.sasl | 0
{daemon => src/remote}/libvirtd.sysctl | 0
6 files changed, 94 insertions(+), 85 deletions(-)
rename {daemon => src/remote}/libvirtd.policy.in (100%)
rename daemon/libvirt.rules => src/remote/libvirtd.rules (100%)
rename {daemon => src/remote}/libvirtd.sasl (100%)
rename {daemon => src/remote}/libvirtd.sysctl (100%)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 8bac9a550b..ab7faf3e66 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -20,10 +20,6 @@ CLEANFILES =
DISTCLEANFILES =
EXTRA_DIST = \
- libvirtd.policy.in \
- libvirt.rules \
- libvirtd.sasl \
- libvirtd.sysctl \
libvirtd.logrotate.in \
libvirtd.qemu.logrotate.in \
libvirtd.lxc.logrotate.in \
@@ -36,59 +32,18 @@ BUILT_SOURCES =
if WITH_LIBVIRTD
-if WITH_POLKIT
-if WITH_POLKIT0
-policydir = $(datadir)/PolicyKit/policy
-policyauth = auth_admin_keep_session
-else ! WITH_POLKIT0
-policydir = $(datadir)/polkit-1/actions
-policyauth = auth_admin_keep
-rulesdir = $(datadir)/polkit-1/rules.d
-rulesfile = libvirt.rules
-endif ! WITH_POLKIT0
-endif WITH_POLKIT
-
-libvirtd.policy: libvirtd.policy.in $(top_builddir)/config.status
- $(AM_V_GEN) sed \
- -e 's|[@]authaction[@]|$(policyauth)|g' \
- < $< > $@-t && \
- mv $@-t $@
-BUILT_SOURCES += libvirtd.policy
-install-data-local: install-data-sasl install-data-polkit \
- install-logrotate install-sysctl
+
+install-data-local: install-logrotate
$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt \
$(DESTDIR)$(localstatedir)/run/libvirt \
$(DESTDIR)$(localstatedir)/lib/libvirt
-uninstall-local:: uninstall-data-sasl uninstall-data-polkit \
- uninstall-logrotate uninstall-sysctl
+uninstall-local:: uninstall-logrotate
rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
-if WITH_POLKIT
-install-data-polkit::
- $(MKDIR_P) $(DESTDIR)$(policydir)
- $(INSTALL_DATA) libvirtd.policy $(DESTDIR)$(policydir)/org.libvirt.unix.policy
-if ! WITH_POLKIT0
- $(MKDIR_P) $(DESTDIR)$(rulesdir)
- $(INSTALL_DATA) $(srcdir)/$(rulesfile) $(DESTDIR)$(rulesdir)/50-libvirt.rules
-endif ! WITH_POLKIT0
-
-uninstall-data-polkit::
- rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
- rmdir $(DESTDIR)$(policydir) || :
-if ! WITH_POLKIT0
- rm -f $(DESTDIR)$(rulesdir)/50-libvirt.rules
- rmdir $(DESTDIR)$(rulesdir) || :
-endif ! WITH_POLKIT0
-
-else ! WITH_POLKIT
-install-data-polkit::
-uninstall-data-polkit::
-endif ! WITH_POLKIT
-
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
libvirtd.libxl.logrotate libvirtd.uml.logrotate \
libvirtd.logrotate
@@ -152,43 +107,11 @@ uninstall-logrotate:
rmdir $(DESTDIR)$(localstatedir)/log/libvirt/uml || :
rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || :
-if WITH_SYSCTL
-# Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on
-# /usr/lib/sysctl.d/ even when libdir is /usr/lib64
-install-sysctl:
- $(MKDIR_P) $(DESTDIR)$(prefix)/lib/sysctl.d
- $(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
- $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf
-
-uninstall-sysctl:
- rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf
- rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || :
-else ! WITH_SYSCTL
-install-sysctl:
-uninstall-sysctl:
-endif ! WITH_SYSCTL
-
else ! WITH_LIBVIRTD
-install-data-local: install-data-sasl
-uninstall-local:: uninstall-data-sasl
+install-data-local:
+uninstall-local::
endif ! WITH_LIBVIRTD
-# This is needed for clients too, so can't wrap in
-# the WITH_LIBVIRTD conditional
-if WITH_SASL
-install-data-sasl:
- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sasl2/
- $(INSTALL_DATA) $(srcdir)/libvirtd.sasl \
- $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
-
-uninstall-data-sasl:
- rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
- rmdir $(DESTDIR)$(sysconfdir)/sasl2/ || :
-else ! WITH_SASL
-install-data-sasl:
-uninstall-data-sasl:
-endif ! WITH_SASL
-
CLEANFILES += $(BUILT_SOURCES)
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
diff --git a/src/Makefile.am b/src/Makefile.am
index e777fcce09..e1a883fa84 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1378,6 +1378,24 @@ conf_DATA += remote/libvirtd.conf
CLEANFILES += tets_libvirtd.aug
+if WITH_POLKIT
+if WITH_POLKIT0
+policydir = $(datadir)/PolicyKit/policy
+policyauth = auth_admin_keep_session
+else ! WITH_POLKIT0
+policydir = $(datadir)/polkit-1/actions
+policyauth = auth_admin_keep
+endif ! WITH_POLKIT0
+endif WITH_POLKIT
+
+BUILT_SOURCES += libvirtd.policy
+
+libvirtd.policy: remote/libvirtd.policy.in $(top_builddir)/config.status
+ $(AM_V_GEN) sed \
+ -e 's|[@]authaction[@]|$(policyauth)|g' \
+ < $< > $@-t && \
+ mv $@-t $@
+
libvirtd_SOURCES = $(LIBVIRTD_SOURCES)
libvirtd_CFLAGS = \
@@ -1419,7 +1437,15 @@ libvirtd_LDADD += \
$(NULL)
endif WITH_LIBVIRTD
-EXTRA_DIST += remote/test_libvirtd.aug.in remote/libvirtd.aug remote/libvirtd.conf
+EXTRA_DIST += \
+ remote/test_libvirtd.aug.in \
+ remote/libvirtd.aug \
+ remote/libvirtd.conf \
+ remote/libvirtd.policy.in \
+ remote/libvirtd.rules \
+ remote/libvirtd.sasl \
+ remote/libvirtd.sysctl \
+ $(NULL)
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
@@ -2826,6 +2852,45 @@ SYSVINIT_FILES = $(notdir $(SYSVINIT_FILES_IN:%.in=%))
EXTRA_DIST += $(SYSVINIT_FILES_IN)
if WITH_LIBVIRTD
+
+if WITH_SYSCTL
+# Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on
+# /usr/lib/sysctl.d/ even when libdir is /usr/lib64
+install-sysctl:
+ $(MKDIR_P) $(DESTDIR)$(prefix)/lib/sysctl.d
+ $(INSTALL_DATA) $(srcdir)/remote/libvirtd.sysctl \
+ $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf
+
+uninstall-sysctl:
+ rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf
+ rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || :
+else ! WITH_SYSCTL
+install-sysctl:
+uninstall-sysctl:
+endif ! WITH_SYSCTL
+
+if WITH_POLKIT
+install-polkit::
+ $(MKDIR_P) $(DESTDIR)$(policydir)
+ $(INSTALL_DATA) libvirtd.policy $(DESTDIR)$(policydir)/org.libvirt.unix.policy
+if ! WITH_POLKIT0
+ $(MKDIR_P) $(DESTDIR)$(datadir)/polkit-1/rules.d
+ $(INSTALL_DATA) $(srcdir)/remote/libvirtd.rules
$(DESTDIR)$(datadir)/polkit-1/rules.d/50-libvirt.rules
+endif ! WITH_POLKIT0
+
+uninstall-polkit::
+ rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
+ rmdir $(DESTDIR)$(policydir) || :
+if ! WITH_POLKIT0
+ rm -f $(DESTDIR)$(datadir)/polkit-1/rules.d/50-libvirt.rules
+ rmdir $(DESTDIR)$(datadir)/polkit-1/rules.d || :
+endif ! WITH_POLKIT0
+
+else ! WITH_POLKIT
+install-polkit::
+uninstall-polkit::
+endif ! WITH_POLKIT
+
if LIBVIRT_INIT_SCRIPT_RED_HAT
install-init:: $(SYSVINIT_FILES) install-sysconfig
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
@@ -2845,10 +2910,31 @@ install-init::
uninstall-init::
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
+install-polkit::
+uninstall-polkit::
+install-sysctl::
+uninstall-sysctl::
install-init::
uninstall-init::
endif ! WITH_LIBVIRTD
+# This is needed for clients too, so can't wrap in
+# the WITH_LIBVIRTD conditional
+if WITH_SASL
+install-sasl:
+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sasl2/
+ $(INSTALL_DATA) $(srcdir)/remote/libvirtd.sasl \
+ $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
+
+uninstall-sasl:
+ rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
+ rmdir $(DESTDIR)$(sysconfdir)/sasl2/ || :
+else ! WITH_SASL
+install-sasl:
+uninstall-sasl:
+endif ! WITH_SASL
+
+
libvirtd.init: remote/libvirtd.init.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
@@ -3440,7 +3526,7 @@ libvirt_nss_la_LIBADD = \
endif WITH_NSS
-install-data-local: install-init install-systemd install-upstart
+install-data-local: install-init install-systemd install-upstart install-sysctl
install-polkit install-sasl
if WITH_LIBVIRTD
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
@@ -3495,7 +3581,7 @@ if WITH_NETWORK
$(LN_S) ../default.xml default.xml )
endif WITH_NETWORK
-uninstall-local:: uninstall-init uninstall-systemd uninstall-upstart
+uninstall-local:: uninstall-init uninstall-systemd uninstall-upstart uninstall-sysctl
uninstall-polkit uninstall-sasl
if WITH_LIBVIRTD
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
diff --git a/daemon/libvirtd.policy.in b/src/remote/libvirtd.policy.in
similarity index 100%
rename from daemon/libvirtd.policy.in
rename to src/remote/libvirtd.policy.in
diff --git a/daemon/libvirt.rules b/src/remote/libvirtd.rules
similarity index 100%
rename from daemon/libvirt.rules
rename to src/remote/libvirtd.rules
diff --git a/daemon/libvirtd.sasl b/src/remote/libvirtd.sasl
similarity index 100%
rename from daemon/libvirtd.sasl
rename to src/remote/libvirtd.sasl
diff --git a/daemon/libvirtd.sysctl b/src/remote/libvirtd.sysctl
similarity index 100%
rename from daemon/libvirtd.sysctl
rename to src/remote/libvirtd.sysctl
--
2.14.3