]> git.hungrycats.org Git - bees/commitdiff
Add configurable bindir for distros without sbin
authorKyle Gospodnetich <me@kylegospodneti.ch>
Fri, 18 Apr 2025 00:52:33 +0000 (17:52 -0700)
committerZygo Blaxell <bees@furryterror.org>
Fri, 4 Jul 2025 23:44:35 +0000 (19:44 -0400)
Adds a `BINDIR` Make variable, defaulting to `sbin`, allowing packagers
to override the install location of `beesd` for systems that do not use
`/sbin`.  This affects the install path and systemd unit template.

Defines.mk
Makefile
scripts/beesd@.service.in

index e5394ba96fa1eee959736687e6407cd273e9dfe8..695ffafdd69de95647f674b8cd884aecef4b1d5c 100644 (file)
@@ -4,6 +4,7 @@ define TEMPLATE_COMPILER =
 sed $< >$@ \
                -e's#@DESTDIR@#$(DESTDIR)#' \
                -e's#@PREFIX@#$(PREFIX)#' \
+               -e's#@BINDIR@#$(BINDIR)#' \
                -e's#@ETC_PREFIX@#$(ETC_PREFIX)#' \
                -e's#@LIBEXEC_PREFIX@#$(LIBEXEC_PREFIX)#'
 endef
index 191837216fc9010fca628b045c8a60b5e64f8d9b..5a04858e3c9a236e346859ed7c980ce8130cbb5b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
 PREFIX ?= /usr
 ETC_PREFIX ?= /etc
 LIBDIR ?= lib
+BINDIR ?= sbin
 
 LIB_PREFIX ?= $(PREFIX)/$(LIBDIR)
 LIBEXEC_PREFIX ?= $(LIB_PREFIX)/bees
@@ -55,7 +56,7 @@ install_bees: src $(RUN_INSTALL_TESTS)
 
 install_scripts: ## Install scipts
 install_scripts: scripts
-       install -Dm755 scripts/beesd $(DESTDIR)$(PREFIX)/sbin/beesd
+       install -Dm755 scripts/beesd $(DESTDIR)$(PREFIX)/$(BINDIR)/beesd
        install -Dm644 scripts/beesd.conf.sample $(DESTDIR)$(ETC_PREFIX)/bees/beesd.conf.sample
 ifneq ($(SYSTEMD_SYSTEM_UNIT_DIR),)
        install -Dm644 scripts/beesd@.service $(DESTDIR)$(SYSTEMD_SYSTEM_UNIT_DIR)/beesd@.service
index 32a6f85756d211a7f3a74fa5095332df9c63b360..f26511d40e79f135e54eaaebd26808c1cee0fbab 100644 (file)
@@ -5,7 +5,7 @@ After=sysinit.target
 
 [Service]
 Type=simple
-ExecStart=@PREFIX@/sbin/beesd --no-timestamps %i
+ExecStart=@PREFIX@/@BINDIR@/beesd --no-timestamps %i
 CPUAccounting=true
 CPUSchedulingPolicy=batch
 CPUWeight=12