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 Mar 8, 2024
1 parent 48f1d63 commit a7d18f7
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 @@ -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; \
Expand Down

0 comments on commit a7d18f7

Please sign in to comment.