aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.am
diff options
context:
space:
mode:
authorHenry de Valence <hdevalence@hdevalence.ca>2014-03-07 02:16:06 -0500
committerJon Lund Steffensen <jonlst@gmail.com>2014-03-20 17:27:00 +0100
commita6f07cbb0e5f20d1033502e3e5b86fe0213e7a5a (patch)
tree5f8a90908400999b35a11a96eed2e33ce36132b6 /Makefile.am
parentOutcomment .gitignore line that erroneously blocks the src/redshift-gtk dir (diff)
downloadredshift-ng-a6f07cbb0e5f20d1033502e3e5b86fe0213e7a5a.tar.gz
redshift-ng-a6f07cbb0e5f20d1033502e3e5b86fe0213e7a5a.tar.bz2
redshift-ng-a6f07cbb0e5f20d1033502e3e5b86fe0213e7a5a.tar.xz
Add systemd .service file for redshift
Add a systemd user .service file to allow users to run redshift as a daemon using systemd. Also adds a new configure option, `--with-systemduserunitdir`, which gives the install path. If set to `no`, systemd support is disabled. If not set, we use `pkg-config` to find the path.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am26
1 files changed, 25 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index f3109ed..f703c28 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,6 +2,10 @@
SUBDIRS = src po
ACLOCAL_AMFLAGS = -I m4
+# Install systemd user unit files locally for distcheck
+DISTCHECK_CONFIGURE_FLAGS = \
+ --with-systemduserunitdir=$$dc_install_base/$(systemduserunitdir)
+
UPDATE_ICON_CACHE = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor || :
EXTRA_ROOTDOC_FILES = \
@@ -25,6 +29,9 @@ _UBUNTU_MONO_LIGHT_FILES = \
_DESKTOP_FILES = \
data/applications/redshift-gtk.desktop
+SYSTEMD_USER_UNIT_IN_FILES = \
+ data/systemd/redshift.service.in
+
# Icons
if ENABLE_GUI
@@ -55,15 +62,32 @@ uninstall-hook:
$(UPDATE_ICON_CACHE);
endif
+
# man page
dist_man1_MANS = redshift.1
+
+# Systemd service files
+if ENABLE_SYSTEMD
+systemduserunit_DATA = $(SYSTEMD_USER_UNIT_IN_FILES:.service.in=.service)
+endif
+
+$(systemduserunit_DATA): $(SYSTEMD_USER_UNIT_IN_FILES) Makefile
+ $(AM_V_GEN)$(MKDIR_P) $(@D) && \
+ sed -e "s|\@bindir\@|$(bindir)|g" $< > $@
+
+
+
EXTRA_DIST = \
$(EXTRA_ROOTDOC_FILES) \
$(_HICOLOR_FILES) \
$(_UBUNTU_MONO_DARK_FILES) \
$(_UBUNTU_MONO_LIGHT_FILES) \
- $(_DESKTOP_FILES)
+ $(_DESKTOP_FILES) \
+ $(SYSTEMD_USER_UNIT_IN_FILES)
+
+CLEANFILES = $(systemduserunit_DATA)
+
# Update PO translations
.PHONY: update-po