From b4552c1b1d3d04c1738dea50147914a6e924f475 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 f4820cf..e9bce48 100644 --- a/Makefile +++ b/Makefile @@ -52,13 +52,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; \