From 34a75942d5bfd53599c0d3cd2272263b41ecf19d Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 27 Feb 2024 23:55:34 -0800 Subject: [PATCH] Always install systemd service if `SYSTEMD_SYSTEM_DIR` is set This makes it easier to build inside a chroot jail, for example. --- Makefile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 98daf6e..d231355 100644 --- a/Makefile +++ b/Makefile @@ -53,13 +53,8 @@ man: scdoc < "$$f" | gzip > "$$target"; \ done install: - @if [ -e /run/systemd/system ] && [ -n '$(SYSTEMD_SYSTEM_DIR)' ]; then \ - mkdir -p '$(DESTDIR)$(SYSTEMD_SYSTEM_DIR)'; \ - install -Dm644 keyd.service '$(DESTDIR)$(SYSTEMD_SYSTEM_DIR)/keyd.service'; \ - elif [ -n '$(SYSTEMD_SYSTEM_DIR)' ]; then \ - echo "NOTE: systemd not found, you will need to manually add keyd to your system's init process."; \ - fi - + [ -z '$(SYSTEMD_SYSTEM_DIR)' ] || mkdir -p '$(DESTDIR)$(SYSTEMD_SYSTEM_DIR)' + [ -z '$(SYSTEMD_SYSTEM_DIR)' ] || install -Dm644 keyd.service '$(DESTDIR)$(SYSTEMD_SYSTEM_DIR)/keyd.service' @if [ "$(VKBD)" = "usb-gadget" ]; then \ { [ -z '$(SYSTEMD_SYSTEM_DIR)' ] || install -Dm644 src/vkbd/usb-gadget.service '$(DESTDIR)$(SYSTEMD_SYSTEM_DIR)/keyd-usb-gadget.service'; } && \ install -Dm755 src/vkbd/usb-gadget.sh $(DESTDIR)$(PREFIX)/bin/keyd-usb-gadget.sh; \