aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-12-08 15:39:52 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-12-08 15:39:52 +0100
commitee09fe7c39c1762c6d55273b538b7619748c1083 (patch)
treec32ef6675f204dd6ed1864b203841b32a4aab7b6 /data
parent699c381a62d2b0b632bd47f3c49fa9d5f4726eb2 (diff)
downloadayatana-indicator-datetime-ee09fe7c39c1762c6d55273b538b7619748c1083.tar.gz
ayatana-indicator-datetime-ee09fe7c39c1762c6d55273b538b7619748c1083.tar.bz2
ayatana-indicator-datetime-ee09fe7c39c1762c6d55273b538b7619748c1083.zip
systemd integration: Add systemd user service file and upstart override.
Diffstat (limited to 'data')
-rw-r--r--data/CMakeLists.txt34
-rw-r--r--data/ayatana-indicator-datetime.override1
-rw-r--r--data/ayatana-indicator-datetime.service.in8
3 files changed, 43 insertions, 0 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index ce463a0..bd03e9d 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -7,6 +7,40 @@ find_package (GSettings)
add_schema ("org.ayatana.indicator.datetime.gschema.xml")
##
+## Systemd Unit File
+##
+
+pkg_check_modules(SYSTEMD systemd)
+if (${SYSTEMD_FOUND})
+
+ pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)
+ message (STATUS "${SYSTEMD_USER_DIR} is the systemd user unit file install dir")
+
+ set (SYSTEMD_USER_NAME "${CMAKE_PROJECT_NAME}.service")
+ set (SYSTEMD_USER_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SYSTEMD_USER_NAME}")
+ set (SYSTEMD_USER_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SYSTEMD_USER_NAME}.in")
+
+ # build it
+ set (pkglibexecdir "${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}")
+ configure_file ("${SYSTEMD_USER_FILE_IN}" "${SYSTEMD_USER_FILE}")
+
+ # install it
+ install (FILES "${SYSTEMD_USER_FILE}"
+ DESTINATION "${SYSTEMD_USER_DIR}")
+
+ ##
+ ## Upstart systemd override Job File
+ ##
+
+ set (UPSTART_SYSTEMD_OVERRIDE_DIR "${CMAKE_INSTALL_FULL_DATADIR}/upstart/systemd-session/upstart")
+ message (STATUS "${UPSTART_SYSTEMD_OVERRIDE_DIR} is the Upstart override Job File for systemd dir")
+
+ install (FILES "${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.override"
+ DESTINATION "${UPSTART_SYSTEMD_OVERRIDE_DIR}")
+
+endif()
+
+##
## Upstart Job File
##
diff --git a/data/ayatana-indicator-datetime.override b/data/ayatana-indicator-datetime.override
new file mode 100644
index 0000000..2905494
--- /dev/null
+++ b/data/ayatana-indicator-datetime.override
@@ -0,0 +1 @@
+manual
diff --git a/data/ayatana-indicator-datetime.service.in b/data/ayatana-indicator-datetime.service.in
new file mode 100644
index 0000000..6ec2776
--- /dev/null
+++ b/data/ayatana-indicator-datetime.service.in
@@ -0,0 +1,8 @@
+[Unit]
+Description=Ayatana Indicator Session Service
+PartOf=graphical-session.target
+After=ayatana-indicators-pre.target
+
+[Service]
+ExecStart=@pkglibexecdir@/ayatana-indicator-session-service
+Restart=on-failure