[libcloudproviders: 1/3] build: Install init services



commit 06636a4923f0d5ccb8c126cd72472017318bd3a4
Author: Carlos Soriano <csoriano gnome org>
Date:   Sun Sep 3 21:44:44 2017 +0200

    build: Install init services
    
    These are necessary so the system runs cloudproviderd as a daemon on
    system startup.
    
    At the same time, make sure the daemon is installed in the correct
    place, that is libexec, not bin.

 src/libcloudproviders.service.in |  7 +++++++
 src/meson.build                  | 15 ++++++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)
---
diff --git a/src/libcloudproviders.service.in b/src/libcloudproviders.service.in
new file mode 100644
index 0000000..a3cf857
--- /dev/null
+++ b/src/libcloudproviders.service.in
@@ -0,0 +1,7 @@
+[Unit]
+Description=Cloud storage providers desktop integration daemon
+
+[Service]
+ExecStart=@libexecdir@/cloudprovidersd
+Type=dbus
+BusName=org.freedesktop.CloudProvidersd
diff --git a/src/meson.build b/src/meson.build
index 10273a6..ea7ce3b 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -45,10 +45,23 @@ pkg.generate(libraries : libcloudproviders,
              filebase: 'cloudproviders',
              description : 'Cloud providers DBus API library.')
 
+libdir = join_paths(get_option('prefix'),get_option('libdir'))
+libdir = get_option('libdir')
+libexecdir = get_option ('libexecdir')
+unitdir = 'lib/systemd/user'
+service_conf = configuration_data()
+service_conf.set('libexecdir', libexecdir)
+configure_file(input: 'libcloudproviders.service.in',
+               output: 'libcloudproviders.service',
+               configuration: service_conf,
+               install_dir: unitdir)
+
 
 cloudproviderd_deps = declare_dependency (link_with: libcloudproviders,
                                           include_directories: include_directories('.'),
                                           dependencies: libcloudproviders_deps)
 
 executable('cloudproviderd', 'cloudproviderd.c',
-           dependencies: cloudproviderd_deps, install: true)
+           dependencies: cloudproviderd_deps,
+           install: true,
+           install_dir: libexecdir)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]