mirror of
https://github.com/Zygo/bees.git
synced 2025-05-18 05:45:45 +02:00
Allow custom libexec location
To install for different distributions, LIBEXEC_PREFIX can now be set. It defaults to $(PREFIX)/usr/lib/bees as used in most common distributions. Local overrides are possible by setting variables in a "localconf" file which will be included by the Makefile if it exists. For some distributions you may want to set it to /usr/libexec or /usr/libexec/bees.
This commit is contained in:
parent
0455827989
commit
893595190f
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,3 +10,4 @@ html/
|
|||||||
latex/
|
latex/
|
||||||
make.log
|
make.log
|
||||||
make.log.new
|
make.log.new
|
||||||
|
localconf
|
||||||
|
10
Makefile
10
Makefile
@ -1,8 +1,12 @@
|
|||||||
PREFIX ?= /
|
PREFIX ?= /
|
||||||
|
LIBEXEC_PREFIX ?= $(PREFIX)/usr/lib
|
||||||
|
|
||||||
MARKDOWN := $(shell which markdown markdown2 markdown_py 2>/dev/null)
|
MARKDOWN := $(shell which markdown markdown2 markdown_py 2>/dev/null)
|
||||||
MARKDOWN ?= markdown
|
MARKDOWN ?= markdown
|
||||||
|
|
||||||
|
# allow local configuration to override above variables
|
||||||
|
-include localconf
|
||||||
|
|
||||||
default all: lib src test README.html
|
default all: lib src test README.html
|
||||||
|
|
||||||
clean: ## Cleanup
|
clean: ## Cleanup
|
||||||
@ -21,6 +25,9 @@ test: ## Run tests
|
|||||||
test: lib src
|
test: lib src
|
||||||
$(MAKE) -C test
|
$(MAKE) -C test
|
||||||
|
|
||||||
|
scripts/beesd: scripts/beesd.in
|
||||||
|
sed -e's#@LIBEXEC_PREFIX@#$(LIBEXEC_PREFIX)#' -e's#@PREFIX@#$(PREFIX)#' "$<" >"$@"
|
||||||
|
|
||||||
README.html: README.md
|
README.html: README.md
|
||||||
$(MARKDOWN) README.md > README.html.new
|
$(MARKDOWN) README.md > README.html.new
|
||||||
mv -f README.html.new README.html
|
mv -f README.html.new README.html
|
||||||
@ -28,9 +35,10 @@ README.html: README.md
|
|||||||
install: ## Install bees + libs
|
install: ## Install bees + libs
|
||||||
install: lib src test
|
install: lib src test
|
||||||
install -Dm644 lib/libcrucible.so $(PREFIX)/usr/lib/libcrucible.so
|
install -Dm644 lib/libcrucible.so $(PREFIX)/usr/lib/libcrucible.so
|
||||||
install -Dm755 bin/bees $(PREFIX)/usr/libexec/bees
|
install -Dm755 bin/bees $(LIBEXEC_PREFIX)/bees/bees
|
||||||
|
|
||||||
install_scripts: ## Install scipts
|
install_scripts: ## Install scipts
|
||||||
|
install_scripts: scripts/beesd
|
||||||
install -Dm755 scripts/beesd $(PREFIX)/usr/sbin/beesd
|
install -Dm755 scripts/beesd $(PREFIX)/usr/sbin/beesd
|
||||||
install -Dm644 scripts/beesd.conf.sample $(PREFIX)/etc/bees/beesd.conf.sample
|
install -Dm644 scripts/beesd.conf.sample $(PREFIX)/etc/bees/beesd.conf.sample
|
||||||
install -Dm644 scripts/beesd@.service $(PREFIX)/lib/systemd/system/beesd@.service
|
install -Dm644 scripts/beesd@.service $(PREFIX)/lib/systemd/system/beesd@.service
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# /usr/bin/beesd
|
|
||||||
|
|
||||||
## Helpful functions
|
## Helpful functions
|
||||||
INFO(){ echo "INFO:" "$@"; }
|
INFO(){ echo "INFO:" "$@"; }
|
||||||
@ -13,7 +12,7 @@ export CONFIG_FILE
|
|||||||
export UUID AL16M
|
export UUID AL16M
|
||||||
|
|
||||||
readonly AL16M="$((16*1024*1024))"
|
readonly AL16M="$((16*1024*1024))"
|
||||||
readonly CONFIG_DIR=/etc/bees/
|
readonly CONFIG_DIR=@PREFIX@/etc/bees/
|
||||||
|
|
||||||
## Pre checks
|
## Pre checks
|
||||||
{
|
{
|
||||||
@ -21,7 +20,7 @@ readonly CONFIG_DIR=/etc/bees/
|
|||||||
[ "$UID" == "0" ] || ERRO "Must be run as root"
|
[ "$UID" == "0" ] || ERRO "Must be run as root"
|
||||||
}
|
}
|
||||||
|
|
||||||
command -v /usr/libexec/bees &> /dev/null || ERRO "Missing 'bees' agent"
|
command -v @LIBEXEC_PREFIX@/bees &> /dev/null || ERRO "Missing 'bees' agent"
|
||||||
|
|
||||||
## Parse args
|
## Parse args
|
||||||
UUID="$1"
|
UUID="$1"
|
||||||
@ -123,6 +122,6 @@ filter_path(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
/usr/libexec/bees "$MNT_DIR" 3>&1 2>&1 | filter_time | filter_path
|
@LIBEXEC_PREFIX@/bees "$MNT_DIR" 3>&1 2>&1 | filter_time | filter_path
|
||||||
|
|
||||||
exit 0
|
exit 0
|
Loading…
x
Reference in New Issue
Block a user