From 475e5e014a2271d9db43bc3acf430a465b87f99e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 18 Jul 2016 18:09:45 +0200 Subject: Adding an systemd user session unit --- configure.ac | 2 ++ data/Makefile.am | 15 +++++++++++++++ data/indicator-bluetooth.override | 1 + data/indicator-bluetooth.service.in | 7 +++++++ debian/control | 1 + 5 files changed, 26 insertions(+) create mode 100644 data/indicator-bluetooth.override create mode 100644 data/indicator-bluetooth.service.in diff --git a/configure.ac b/configure.ac index 221ddc9..e744e3b 100644 --- a/configure.ac +++ b/configure.ac @@ -22,6 +22,8 @@ PKG_CHECK_MODULES(SERVICE_DEPS, [glib-2.0 >= $GLIB_REQUIRED_VERSION gio-unix-2.0 >= $GIO_REQUIRED_VERSION url-dispatcher-1 >= $URL_DISPATCHER_1_REQUIRED_VERSION]) +SYSTEMD_USERDIR=`$PKG_CONFIG --variable=systemduserunitdir systemd` +AC_SUBST(SYSTEMD_USERDIR) dnl ############################## dnl # Custom Junk diff --git a/data/Makefile.am b/data/Makefile.am index 81f4d5e..9dd100b 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -8,6 +8,21 @@ SUBDIRS = upstart indicatorsdir = $(datadir)/unity/indicators dist_indicators_DATA = com.canonical.indicator.bluetooth +# the systemd unit file +systemddir = $(SYSTEMD_USERDIR) +systemd_DATA = indicator-bluetooth.service +systemd_in = $(systemd_DATA:.service=.service.in) +$(systemd_DATA): $(systemd_in) + $(AM_V_GEN) $(SED) -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ +BUILT_SOURCES += $(systemd_DATA) +EXTRA_DIST += $(systemd_in) +CLEANFILES += $(systemd_DATA) + +# the systemd upstart override +upstart_overridedir = $(datadir)/upstart/systemd-session/upstart +upstart_override_DATA = indicator-bluetooth.override +EXTRA_DIST += $(upstart_override_DATA) + # the upstart job file upstart_jobsdir = $(datadir)/upstart/sessions upstart_jobs_DATA = indicator-bluetooth.conf diff --git a/data/indicator-bluetooth.override b/data/indicator-bluetooth.override new file mode 100644 index 0000000..2905494 --- /dev/null +++ b/data/indicator-bluetooth.override @@ -0,0 +1 @@ +manual diff --git a/data/indicator-bluetooth.service.in b/data/indicator-bluetooth.service.in new file mode 100644 index 0000000..4be9f20 --- /dev/null +++ b/data/indicator-bluetooth.service.in @@ -0,0 +1,7 @@ +[Unit] +Description=Indicator Bluetooth Backend +PartOf=graphical-session.target +After=indicators-pre.target + +[Service] +ExecStart=@pkglibexec@/indicator-bluetooth-service diff --git a/debian/control b/debian/control index eba86eb..078a9f6 100644 --- a/debian/control +++ b/debian/control @@ -8,6 +8,7 @@ Build-Depends: debhelper (>= 9.0), gnome-common, libglib2.0-dev, liburl-dispatcher1-dev, + systemd, valac (>=0.18), Standards-Version: 3.9.4 Homepage: https://launchpad.net/indicator-bluetooth -- cgit v1.2.3 From 7f2c3a6ed3531ce989dca21afc08e1735ddfa694 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 19 Jul 2016 09:35:00 +0200 Subject: Install dep on indicator-common --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index 078a9f6..1a4d509 100644 --- a/debian/control +++ b/debian/control @@ -25,6 +25,7 @@ Depends: ${misc:Depends}, bluez (>= 5), unity-control-center | gnome-control-center | ubuntu-system-settings, gnome-bluetooth | ubuntu-system-settings, + indicator-common, Replaces: gnome-bluetooth (<< 3.6.1-0ubuntu2) Breaks: gnome-bluetooth (<< 3.6.1-0ubuntu2) Description: System bluetooth indicator. -- cgit v1.2.3 From 8d1998093be0403f117f618c808b4711fda0396a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jul 2016 08:57:59 +0200 Subject: Adding a restart rule --- data/indicator-bluetooth.service.in | 1 + 1 file changed, 1 insertion(+) diff --git a/data/indicator-bluetooth.service.in b/data/indicator-bluetooth.service.in index 4be9f20..f3009d0 100644 --- a/data/indicator-bluetooth.service.in +++ b/data/indicator-bluetooth.service.in @@ -5,3 +5,4 @@ After=indicators-pre.target [Service] ExecStart=@pkglibexec@/indicator-bluetooth-service +Restart=on-failure -- cgit v1.2.3 From 2e85ab90f4acdcd548bbe40e3d13731f26f2e3d9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sat, 22 Oct 2016 11:06:54 +0200 Subject: Fix variable name --- data/indicator-bluetooth.service.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/indicator-bluetooth.service.in b/data/indicator-bluetooth.service.in index f3009d0..e99e610 100644 --- a/data/indicator-bluetooth.service.in +++ b/data/indicator-bluetooth.service.in @@ -4,5 +4,5 @@ PartOf=graphical-session.target After=indicators-pre.target [Service] -ExecStart=@pkglibexec@/indicator-bluetooth-service +ExecStart=@pkglibexecdir@/indicator-bluetooth-service Restart=on-failure -- cgit v1.2.3