summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2016-01-28 15:22:18 +0100
committerSimon McVittie <smcv@debian.org>2016-01-28 23:45:47 +0100
commit9efe31e8d46d544edcbdfe10c6dadd0ea4fb4d5e (patch)
tree0b805fb3291bd28eeec3679392de99a8b33282fa
parent2f38ec6521d6dacabd14a3f031f8c4d0e20a216a (diff)
downloadxdg-app-9efe31e8d46d544edcbdfe10c6dadd0ea4fb4d5e.tar.gz
Add systemd user units corresponding to the D-Bus session services
Signed-off-by: Simon McVittie <smcv@debian.org>
-rw-r--r--Makefile.am12
-rw-r--r--configure.ac8
-rw-r--r--document-portal/Makefile.am.inc6
-rw-r--r--document-portal/org.freedesktop.portal.Documents.service.in1
-rw-r--r--document-portal/xdg-document-portal.service.in7
-rw-r--r--session-helper/Makefile.am.inc6
-rw-r--r--session-helper/xdg-app-session-helper.service.in7
7 files changed, 40 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am
index 83e5774..103b347 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,9 +14,12 @@ endif
%.service: %.service.in config.log
$(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
-servicedir = $(DBUS_SERVICE_DIR)
+dbus_servicedir = $(DBUS_SERVICE_DIR)
service_in_files = $(NULL)
-service_DATA = $(NULL)
+dbus_service_DATA = $(NULL)
+systemduserunit_DATA = $(NULL)
+CLEANFILES += $(dbus_service_DATA)
+CLEANFILES += $(systemduserunit_DATA)
AM_CPPFLAGS = \
-DXDG_APP_BINDIR=\"$(bindir)\" \
@@ -64,7 +67,10 @@ EXTRA_DIST += $(completion_DATA)
profiledir = $(sysconfdir)/profile.d
profile_DATA = xdg-app.sh
-EXTRA_DIST += profile/xdg-app.sh.in $(service_in_files)
+EXTRA_DIST += \
+ $(dbus_service_in_files) \
+ profile/xdg-app.sh.in \
+ $(NULL)
DISTCLEANFILES += xdg-app.sh
xdg-app.sh: profile/xdg-app.sh.in
diff --git a/configure.ac b/configure.ac
index 854fa96..c1cfcfe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,6 +60,14 @@ AC_ARG_WITH(dbus_service_dir,
DBUS_SERVICE_DIR=$with_dbus_service_dir
AC_SUBST(DBUS_SERVICE_DIR)
+AC_ARG_WITH([systemduserunitdir],
+ [AS_HELP_STRING([--with-systemduserunitdir=DIR],
+ [Directory for systemd user service files (default=PREFIX/lib/systemd/user)])],
+ [],
+ dnl This is deliberately not ${libdir}: systemd units always go in
+ dnl .../lib, never .../lib64 or .../lib/x86_64-linux-gnu
+ [with_systemduserunitdir='${prefix}/lib/systemd/user'])
+AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])
AC_ARG_WITH(system_fonts_dir,
AS_HELP_STRING([--with-system-fonts-dir=PATH],[Directory where system fonts are, [default=/usr/share/fonts]]),
diff --git a/document-portal/Makefile.am.inc b/document-portal/Makefile.am.inc
index 3b1607f..5568bc5 100644
--- a/document-portal/Makefile.am.inc
+++ b/document-portal/Makefile.am.inc
@@ -23,9 +23,11 @@ document-portal/xdp-resources.c: document-portal/xdg-document-portal.gresource.x
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< \
--target=$@ --sourcedir=$(srcdir) --c-name _xdg_document --generate-source
+service_in_files += document-portal/xdg-document-portal.service.in
+systemduserunit_DATA += document-portal/xdg-document-portal.service
+
service_in_files += document-portal/org.freedesktop.portal.Documents.service.in
-service_DATA += document-portal/org.freedesktop.portal.Documents.service
-DISTCLEANFILES += document-portal/org.freedesktop.portal.Documents.service
+dbus_service_DATA += document-portal/org.freedesktop.portal.Documents.service
EXTRA_DIST += document-portal/xdg-document-portal.gresource.xml
diff --git a/document-portal/org.freedesktop.portal.Documents.service.in b/document-portal/org.freedesktop.portal.Documents.service.in
index 7517274..cf0c1ef 100644
--- a/document-portal/org.freedesktop.portal.Documents.service.in
+++ b/document-portal/org.freedesktop.portal.Documents.service.in
@@ -1,3 +1,4 @@
[D-BUS Service]
Name=org.freedesktop.portal.Documents
Exec=@libexecdir@/xdg-document-portal
+SystemdService=xdg-document-portal.service
diff --git a/document-portal/xdg-document-portal.service.in b/document-portal/xdg-document-portal.service.in
new file mode 100644
index 0000000..ac7769b
--- /dev/null
+++ b/document-portal/xdg-document-portal.service.in
@@ -0,0 +1,7 @@
+[Unit]
+Description=xdg-app document portal service
+
+[Service]
+BusName=org.freedesktop.portal.Documents
+ExecStart=@libexecdir@/xdg-document-portal
+Type=dbus
diff --git a/session-helper/Makefile.am.inc b/session-helper/Makefile.am.inc
index 867cc04..2b08db9 100644
--- a/session-helper/Makefile.am.inc
+++ b/session-helper/Makefile.am.inc
@@ -12,9 +12,11 @@ session-helper/xdg-app-resources.c: session-helper/xdg-app.gresource.xml $(resou
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< \
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-source
+service_in_files += session-helper/xdg-app-session-helper.service.in
+systemduserunit_DATA += session-helper/xdg-app-session-helper.service
+
service_in_files += session-helper/org.freedesktop.XdgApp.service.in
-service_DATA += session-helper/org.freedesktop.XdgApp.service
-DISTCLEANFILES += session-helper/org.freedesktop.XdgApp.service
+dbus_service_DATA += session-helper/org.freedesktop.XdgApp.service
EXTRA_DIST += session-helper/xdg-app.gresource.xml
diff --git a/session-helper/xdg-app-session-helper.service.in b/session-helper/xdg-app-session-helper.service.in
new file mode 100644
index 0000000..7279a3a
--- /dev/null
+++ b/session-helper/xdg-app-session-helper.service.in
@@ -0,0 +1,7 @@
+[Unit]
+Description=xdg-app session helper
+
+[Service]
+BusName=org.freedesktop.XdgApp
+ExecStart=@libexecdir@/xdg-app-session-helper
+Type=dbus