summaryrefslogtreecommitdiff
path: root/monitor/afc
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2017-11-06 19:40:59 +0100
committerIñigo Martínez <inigomartinez@gmail.com>2017-11-07 13:19:35 +0100
commit327f1eee192a742a92e57345d25eda85cce630e6 (patch)
tree059667ec36f338bb0e00e058526ee50d01648802 /monitor/afc
parentd1189c1bede6a6cd2b6e89dfe50d66fead49a47e (diff)
downloadgvfs-327f1eee192a742a92e57345d25eda85cce630e6.tar.gz
build: Make SystemdService entry conditional
When systemd user units installation is disabled, SystemdService entry should also not be present on D-Bus service files. This patch adds a common D-Bus service file template allowing, an homogeneus D-Bus service file generation and also a SystemService entry conditioned to the systemd user units installation option. https://bugzilla.gnome.org/show_bug.cgi?id=786149
Diffstat (limited to 'monitor/afc')
-rw-r--r--monitor/afc/meson.build29
1 files changed, 19 insertions, 10 deletions
diff --git a/monitor/afc/meson.build b/monitor/afc/meson.build
index 830f8ccd..b4735fe9 100644
--- a/monitor/afc/meson.build
+++ b/monitor/afc/meson.build
@@ -5,18 +5,12 @@ install_data(
install_dir: gvfs_remote_volume_monitors_dir
)
-service = gvfs_namespace + '.AfcVolumeMonitor.service'
-
-afc_service = configure_file(
- input: service + '.in',
- output: service,
- install: true,
- install_dir: dbus_service_dir,
- configuration: service_conf
-)
+dbus_service = gvfs_namespace + '.AfcVolumeMonitor'
+dbus_exec = 'gvfs-afc-volume-monitor'
+dbus_systemd_service = ''
if install_systemd_user_unit_dir
- service = 'gvfs-afc-volume-monitor.service'
+ service = dbus_exec + '.service'
configure_file(
input: service + '.in',
@@ -25,8 +19,23 @@ if install_systemd_user_unit_dir
install_dir: systemd_user_unit_dir,
configuration: service_conf
)
+
+ dbus_systemd_service = 'SystemdService=' + service
endif
+dbus_service_conf = configuration_data()
+dbus_service_conf.set('service', dbus_service)
+dbus_service_conf.set('exec', join_paths(gvfs_libexecdir, dbus_exec))
+dbus_service_conf.set('systemd_service', dbus_systemd_service)
+
+afc_service = configure_file(
+ input: dbus_service_in,
+ output: dbus_service + '.service',
+ install: true,
+ install_dir: dbus_service_dir,
+ configuration: dbus_service_conf
+)
+
sources = files(
'afcvolumemonitordaemon.c',
'afcvolume.c',