Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
.gitignore | 3 ++-
Makefile.am | 2 +-
configure.ac | 2 ++
data/Makefile.am | 15 +++++++++++++++
data/session/org.libvirt.service.in | 3 +++
src/Makefile.am | 17 -----------------
src/org.libvirt.service.in | 3 ---
7 files changed, 23 insertions(+), 22 deletions(-)
create mode 100644 data/Makefile.am
create mode 100644 data/session/org.libvirt.service.in
delete mode 100644 src/org.libvirt.service.in
diff --git a/.gitignore b/.gitignore
index 72f3595..f223068 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,6 +22,7 @@ vgcore.*
/libvirt-dbus.spec
/stamp-h1
+/data/session/org.libvirt.service
+
/src/.deps/
/src/libvirt-dbus
-/src/org.libvirt.service
diff --git a/Makefile.am b/Makefile.am
index 8ba2137..065334f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
-SUBDIRS = src test
+SUBDIRS = data src test
EXTRA_DIST = \
$(PACKAGE).spec \
diff --git a/configure.ac b/configure.ac
index 8de0d35..158c5e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,7 @@ AC_SUBST([LIBVIRT_DBUS_VERSION_INFO])
AC_SUBST([LIBVIRT_DBUS_VERSION_NUMBER])
AC_PROG_CC
+AC_PROG_MKDIR_P
AM_PROG_CC_C_O
PKG_CHECK_MODULES(LIBVIRT, libvirt >= $LIBVIRT_REQUIRED)
@@ -45,6 +46,7 @@ fi
AC_SUBST(DBUS_SERVICES_DIR)
AC_OUTPUT(Makefile
+ data/Makefile
src/Makefile
test/Makefile
libvirt-dbus.spec)
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644
index 0000000..b0b30b9
--- /dev/null
+++ b/data/Makefile.am
@@ -0,0 +1,15 @@
+service_in_files = \
+ session/org.libvirt.service.in
+servicedir = $(DBUS_SERVICES_DIR)
+service_DATA = $(service_in_files:.service.in=.service)
+
+EXTRA_DIST = \
+ $(service_in_files)
+
+CLEANFILES = \
+ $(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 $@
diff --git a/data/session/org.libvirt.service.in b/data/session/org.libvirt.service.in
new file mode 100644
index 0000000..a8cb6a9
--- /dev/null
+++ b/data/session/org.libvirt.service.in
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.libvirt
+Exec=@bindir@/libvirt-dbus --session
diff --git a/src/Makefile.am b/src/Makefile.am
index 30e7a35..917c46d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -27,20 +27,3 @@ libvirt_dbus_LDFLAGS = \
libvirt_dbus_LDADD = \
$(SYSTEMD_LIBS) \
$(LIBVIRT_LIBS)
-
-service_in_files = \
- org.libvirt.service.in
-servicedir = $(DBUS_SERVICES_DIR)
-service_DATA = $(service_in_files:.service.in=.service)
-
-EXTRA_DIST += \
- $(service_in_files)
-
-CLEANFILES += \
- $(service_DATA)
-
-org.libvirt.service: org.libvirt.service.in
- $(AM_V_GEN)sed \
- -e 's|[@]bindir[@]|$(bindir)|g' \
- < $< > $@-t && \
- mv $@-t $@
diff --git a/src/org.libvirt.service.in b/src/org.libvirt.service.in
deleted file mode 100644
index a42539e..0000000
--- a/src/org.libvirt.service.in
+++ /dev/null
@@ -1,3 +0,0 @@
-[D-BUS Service]
-Name=org.libvirt
-Exec=@bindir@/libvirt-dbus
--
2.13.4