1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-17 21:35:45 +02:00

Installation: Remove USR_PREFIX from Makefile

This commit removes USR_PREFIX and introduces ETC_PREFIX instead. The
purpose of PREFIX is the installation prefix in the system, not the
installation destination. The latter one is what DESTDIR is used for.

This should clear up the confusion. PREFIX was already mis-used as
installation destination. But that doesn't mix well with how the make
targets are designed.

CC: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kai Krakow <kai@kaishome.de>
This commit is contained in:
Kai Krakow 2018-01-21 01:40:19 +01:00
parent 9069201036
commit 17e1171464
4 changed files with 18 additions and 14 deletions

View File

@ -1,8 +1,10 @@
PREFIX ?= /
PREFIX ?= /usr
ETC_PREFIX ?= /etc
LIBDIR ?= lib
USR_PREFIX ?= $(PREFIX)/usr
USRLIB_PREFIX ?= $(USR_PREFIX)/$(LIBDIR)
LIBEXEC_PREFIX ?= $(USRLIB_PREFIX)/bees
LIB_PREFIX ?= $(PREFIX)/$(LIBDIR)
LIBEXEC_PREFIX ?= $(LIB_PREFIX)/bees
SYSTEMD_SYSTEM_UNIT_DIR ?= $(shell pkg-config systemd --variable=systemdsystemunitdir)
MARKDOWN := $(firstword $(shell which markdown markdown2 markdown_py 2>/dev/null || echo markdown))
@ -38,7 +40,10 @@ test: lib src
$(MAKE) -C test
scripts/%: scripts/%.in
sed -e's#@LIBEXEC_PREFIX@#$(LIBEXEC_PREFIX)#' -e's#@PREFIX@#$(PREFIX)#' $< >$@
sed $< >$@ \
-e's#@PREFIX@#$(PREFIX)#' \
-e's#@ETC_PREFIX@#$(ETC_PREFIX)#' \
-e's#@LIBEXEC_PREFIX@#$(LIBEXEC_PREFIX)#'
scripts: scripts/beesd scripts/beesd@.service
@ -47,12 +52,12 @@ README.html: README.md
mv -f README.html.new README.html
install_libs: lib
install -Dm644 lib/libcrucible.so $(DESTDIR)$(USRLIB_PREFIX)/libcrucible.so
install -Dm644 lib/libcrucible.so $(DESTDIR)$(LIB_PREFIX)/libcrucible.so
install_tools: ## Install support tools + libs
install_tools: install_libs src
install -Dm755 bin/fiemap $(DESTDIR)$(USR_PREFIX)/bin/fiemap
install -Dm755 bin/fiewalk $(DESTDIR)$(USR_PREFIX)/sbin/fiewalk
install -Dm755 bin/fiemap $(DESTDIR)$(PREFIX)/bin/fiemap
install -Dm755 bin/fiewalk $(DESTDIR)$(PREFIX)/sbin/fiewalk
install_bees: ## Install bees + libs
install_bees: install_libs src $(RUN_INSTALL_TESTS)
@ -60,8 +65,8 @@ install_bees: install_libs src $(RUN_INSTALL_TESTS)
install_scripts: ## Install scipts
install_scripts: scripts
install -Dm755 scripts/beesd $(DESTDIR)$(USR_PREFIX)/sbin/beesd
install -Dm644 scripts/beesd.conf.sample $(DESTDIR)$(PREFIX)/etc/bees/beesd.conf.sample
install -Dm755 scripts/beesd $(DESTDIR)$(PREFIX)/sbin/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
endif

View File

@ -3,8 +3,7 @@ new file mode 100644
index 0000000..7705cbb
--- /dev/null
+++ b/localconf
@@ -0,0 +1,2 @@
+PREFIX=/
@@ -0,0 +1,1 @@
+LIBEXEC_PREFIX=/usr/libexec
diff --git a/makeflags b/makeflags
index f5983cb..0348623 100644

View File

@ -12,7 +12,7 @@ export CONFIG_FILE
export UUID AL16M
readonly AL16M="$((16*1024*1024))"
readonly CONFIG_DIR=@PREFIX@/etc/bees/
readonly CONFIG_DIR=@ETC_PREFIX@/bees/
## Pre checks
{

View File

@ -5,7 +5,7 @@ After=sysinit.target
[Service]
Type=simple
ExecStart=@PREFIX@/usr/sbin/beesd %i
ExecStart=@PREFIX@/sbin/beesd %i
Nice=19
KillMode=control-group
KillSignal=SIGTERM