Skip to content

Commit

Permalink
Always install systemd service if SYSTEMD_SYSTEM_DIR is set
Browse files Browse the repository at this point in the history
This makes it easier to build inside a chroot jail, for example.
  • Loading branch information
rhansen committed Jul 10, 2024
1 parent 447a153 commit 420e07e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand Down

0 comments on commit 420e07e

Please sign in to comment.