aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2020-08-11 09:42:12 +0200
committerRobert Tari <robert@tari.in>2020-08-11 09:42:12 +0200
commit7d7dc1140c38c22a629bc58238dff5cec17c30e5 (patch)
tree9ef5dae755c81723082d8cca4c2b089904c8832f
parentd9fced125c2a6e1cf44171370753df00c8d554ba (diff)
parentd75eb5fd87fb752220050258a7b1f11cac7f6691 (diff)
downloadayatana-indicator-notifications-7d7dc1140c38c22a629bc58238dff5cec17c30e5.tar.gz
ayatana-indicator-notifications-7d7dc1140c38c22a629bc58238dff5cec17c30e5.tar.bz2
ayatana-indicator-notifications-7d7dc1140c38c22a629bc58238dff5cec17c30e5.zip
Merge branch 'pr/sytemd-service-file' of https://github.com/sunweaver/ayatana-indicator-notifications into sunweaver-pr/sytemd-service-file
Attributes GH PR #5: https://github.com/AyatanaIndicators/ayatana-indicator-notifications/pull/5
-rw-r--r--configure.ac13
-rw-r--r--data/Makefile.am19
-rw-r--r--data/ayatana-indicator-notifications.service.in11
-rw-r--r--debian/ayatana-indicator-notifications.links3
-rw-r--r--debian/control2
-rwxr-xr-xdebian/rules2
6 files changed, 47 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index e9bc3bd..8b3b48b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,6 +65,19 @@ PKG_CHECK_MODULES(SETTINGS, gtk+-3.0 >= GTK3_REQUIRED_VERSION)
AC_SUBST(SETTINGS_CFLAGS)
AC_SUBST(SETTINGS_LIBS)
+#########################
+# 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
+
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
Makefile
diff --git a/data/Makefile.am b/data/Makefile.am
index 1960ad7..52f61a7 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,3 +1,5 @@
+NULL =
+
SUBDIRS = icons
gsettings_file = org.ayatana.indicator.notifications.gschema.xml
@@ -12,10 +14,23 @@ $(gsettings_file).in: $(gsettings_file).in.in
@GSETTINGS_RULES@
+#if defined(HAVE_SYSTEMD)
+systemdservice_file = ayatana-indicator-notifications.service
+$(systemdservice_file): $(systemdservice_file).in
+ $(AM_V_GEN) sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@
+
+systemddir = $(SYSTEMD_USERDIR)
+systemd_DATA = $(systemdservice_file)
+#endif
+
EXTRA_DIST = \
- $(gsettings_file).in.in
+ $(gsettings_file).in.in \
+ $(systemdservice_file).in \
+ $(NULL)
CLEANFILES = \
$(gsettings_file) \
$(gsettings_file).in \
- *.gschema.valid
+ *.gschema.valid \
+ $(systemdservice_file) \
+ $(NULL)
diff --git a/data/ayatana-indicator-notifications.service.in b/data/ayatana-indicator-notifications.service.in
new file mode 100644
index 0000000..d356f01
--- /dev/null
+++ b/data/ayatana-indicator-notifications.service.in
@@ -0,0 +1,11 @@
+[Unit]
+Description=Ayatana Indicator Notifications Service
+PartOf=graphical-session.target
+After=ayatana-indicators.target
+
+[Service]
+ExecStart=@pkglibexecdir@/ayatana-indicator-notifications-service
+Restart=on-failure
+
+[Install]
+WantedBy=ayatana-indicators.target
diff --git a/debian/ayatana-indicator-notifications.links b/debian/ayatana-indicator-notifications.links
new file mode 100644
index 0000000..ccf4549
--- /dev/null
+++ b/debian/ayatana-indicator-notifications.links
@@ -0,0 +1,3 @@
+# Because dh-systemd does not support user units for compat levels below 12, we manually make the WantedBy link
+# FIXME: drop this once we bump DH compat level to 12 or higher
+/usr/lib/systemd/user/ayatana-indicator-notifications.service /usr/lib/systemd/user/ayatana-indicators.target.wants/ayatana-indicator-notifications.service \ No newline at end of file
diff --git a/debian/control b/debian/control
index 4433862..f5db253 100644
--- a/debian/control
+++ b/debian/control
@@ -6,6 +6,7 @@ Uploaders:
Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Build-Depends: debhelper (>= 9),
dh-autoreconf | debhelper (>= 9.20160403~),
+ dh-systemd | debhelper (>= 10.2~),
intltool,
libayatana-indicator-dev (>= 0.3.93),
libayatana-indicator3-dev (>= 0.3.93),
@@ -14,6 +15,7 @@ Build-Depends: debhelper (>= 9),
libgtk-3-dev (>= 3.1),
mate-common,
pkg-config,
+ systemd [linux-any],
Standards-Version: 4.1.3
Homepage: https://github.com/AyatanaIndicators/ayatana-indicator-notifications
Vcs-Git: https://github.com/AyatanaIndicators/ayatana-indicator-notifications
diff --git a/debian/rules b/debian/rules
index 5341372..7382e4d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,7 +7,7 @@ DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
%:
- dh $@ --with autoreconf
+ dh $@ --with autoreconf,systemd
override_dh_autoreconf:
if [ ! -e po/ayatana-indicator-notifications.pot.bak ]; then \