Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx> --- .gitignore | 1 + configure.ac | 10 ++++++++++ data/Makefile.am | 16 ++++++++++++++-- data/system/org.libvirt.service.in | 4 ++++ libvirt-dbus.spec.in | 1 + 5 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 data/system/org.libvirt.service.in diff --git a/.gitignore b/.gitignore index f223068..1d41949 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ vgcore.* /stamp-h1 /data/session/org.libvirt.service +/data/system/org.libvirt.service /src/.deps/ /src/libvirt-dbus diff --git a/configure.ac b/configure.ac index 158c5e9..65071f9 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,16 @@ else fi AC_SUBST(DBUS_SERVICES_DIR) +AC_ARG_WITH(dbus-system-services, + [AC_HELP_STRING([--with-dbus-system-services=<dir>], + [where D-BUS system services directory is])]) +if ! test -z "$with_dbus_system_services" ; then + DBUS_SYSTEM_SERVICES_DIR="$with_dbus_system_services" +else + DBUS_SYSTEM_SERVICES_DIR="$datadir/dbus-1/system-services" +fi +AC_SUBST(DBUS_SYSTEM_SERVICES_DIR) + AC_OUTPUT(Makefile data/Makefile src/Makefile diff --git a/data/Makefile.am b/data/Makefile.am index b0b30b9..b8f1376 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -3,13 +3,25 @@ service_in_files = \ servicedir = $(DBUS_SERVICES_DIR) service_DATA = $(service_in_files:.service.in=.service) +system_service_in_files = \ + system/org.libvirt.service.in +system_servicedir = $(DBUS_SYSTEM_SERVICES_DIR) +system_service_DATA = $(system_service_in_files:.service.in=.service) + EXTRA_DIST = \ - $(service_in_files) + $(service_in_files) \ + $(system_service_in_files) CLEANFILES = \ - $(service_DATA) + $(service_DATA) \ + $(system_service_DATA) session/org.libvirt.service: session/org.libvirt.service.in $(AM_V_GEN)$(MKDIR_P) session && \ sed -e 's|[@]bindir[@]|$(bindir)|g' < $< > $@-t && \ mv $@-t $@ + +system/org.libvirt.service: system/org.libvirt.service.in + $(AM_V_GEN)$(MKDIR_P) system && \ + sed -e 's|[@]bindir[@]|$(bindir)|g' < $< > $@-t && \ + mv $@-t $@ diff --git a/data/system/org.libvirt.service.in b/data/system/org.libvirt.service.in new file mode 100644 index 0000000..08d32a2 --- /dev/null +++ b/data/system/org.libvirt.service.in @@ -0,0 +1,4 @@ +[D-BUS Service] +Name=org.libvirt +Exec=@bindir@/libvirt-dbus --system +User=root diff --git a/libvirt-dbus.spec.in b/libvirt-dbus.spec.in index c92b320..0f76de2 100644 --- a/libvirt-dbus.spec.in +++ b/libvirt-dbus.spec.in @@ -42,5 +42,6 @@ rm -rf $RPM_BUILD_ROOT %doc README COPYING AUTHORS NEWS %{_bindir}/libvirt-dbus %{_datadir}/dbus-1/services/org.libvirt.service +%{_datadir}/dbus-1/system-services/org.libvirt.service %changelog -- 2.13.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list