diff options
-rw-r--r-- | configure.ac | 13 | ||||
-rw-r--r-- | data/Makefile.am | 17 | ||||
-rw-r--r-- | data/ayatana-indicator-messages.service.in | 11 |
3 files changed, 40 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index f446f43..573979c 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,19 @@ AC_ARG_WITH([indicator-dir], [with_indicator_dir=$datadir/ayatana/indicators]) AC_SUBST([INDICATOR_DIR], [$with_indicator_dir]) +######################### +# Check for systemd +######################### +PKG_CHECK_MODULES(SYSTEMD, systemd, + [has_systemd=yes], + [] +) +if test "x$has_systemd" = "xyes"; then + SYSTEMD_USERDIR=`$PKG_CONFIG --variable=systemduserunitdir systemd` + AC_SUBST(SYSTEMD_USERDIR) + AC_DEFINE(HAVE_SYSTEMD, 1, [create ayatana-indicator-application.service for systemd]) +fi + ########################### # gcov coverage reporting ########################### diff --git a/data/Makefile.am b/data/Makefile.am index ff45ba2..b88aee5 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,3 +1,5 @@ +NULL = + SUBDIRS = icons xdg_autostartdir = /etc/xdg/autostart @@ -9,12 +11,25 @@ xdg_autostart_DATA = ayatana-indicator-messages.desktop gsettings_SCHEMAS = org.ayatana.indicator.messages.gschema.xml @GSETTINGS_RULES@ +#if defined(HAVE_SYSTEMD) +systemdservice_file = ayatana-indicator-messages.service +$(systemdservice_file): $(systemdservice_file).in + $(AM_V_GEN) sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ + +systemddir = $(SYSTEMD_USERDIR) +systemd_DATA = $(systemdservice_file) +#endif + indicatordir = $(INDICATOR_DIR) dist_indicator_DATA = org.ayatana.indicator.messages EXTRA_DIST = \ ayatana-indicator-messages.desktop.in \ - $(gsettings_SCHEMAS) + $(gsettings_SCHEMAS) \ + $(systemdservice_file).in \ + $(NULL) CLEANFILES = \ $(xdg_autostart_DATA) \ + $(systemdservice_file) \ + $(NULL) diff --git a/data/ayatana-indicator-messages.service.in b/data/ayatana-indicator-messages.service.in new file mode 100644 index 0000000..a0a3ba0 --- /dev/null +++ b/data/ayatana-indicator-messages.service.in @@ -0,0 +1,11 @@ +[Unit] +Description=Ayatana Indicator Messages Service +PartOf=graphical-session.target +PartOf=ayatana-indicators.target + +[Service] +ExecStart=@pkglibexecdir@/ayatana-indicator-messages-service +Restart=on-failure + +[Install] +WantedBy=ayatana-indicators.target |