Commit aaca9b8f authored by Marek Vavrusa's avatar Marek Vavrusa

Merge branch 'prefix-sbindir-changes' into 'master'

Daemons should be in sbin, make destination variables overridable

According to FHS the 'Non-essential system binaries, e.g., daemons for various network-services.' should be installed in /usr/sbin

Also changed `:=` to `?=` to allow variable override without patching `config.mk`.

See merge request !32
parents 3648e3e2 7c423689
......@@ -45,7 +45,7 @@ cache:
- ${HOME}/.local
- ${HOME}/.cache/pip
before_cache:
- rm -f ${HOME}/.local/bin/kresd
- rm -f ${HOME}/.local/sbin/kresd
- rm -f ${HOME}/.local/lib/libkres.a
- rm -rf ${HOME}/.local/include/libkres
- rm -rf ${HOME}/.local/lib/kdns_modules
......@@ -77,6 +77,7 @@ info:
$(info PREFIX: $(PREFIX))
$(info DESTDIR: $(DESTDIR))
$(info BINDIR: $(BINDIR))
$(info SBINDIR: $(SBINDIR))
$(info LIBDIR: $(LIBDIR))
$(info ETCDIR: $(ETCDIR))
$(info INCLUDEDIR: $(INCLUDEDIR))
......
......@@ -7,12 +7,13 @@ BUILDMODE := dynamic
HARDENING := yes
# Paths
PREFIX := /usr/local
BINDIR := $(PREFIX)/bin
LIBDIR := $(PREFIX)/lib
INCLUDEDIR := $(PREFIX)/include
MODULEDIR := $(LIBDIR)/kdns_modules
ETCDIR := $(PREFIX)/etc/kresd
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
SBINDIR ?= $(PREFIX)/sbin
LIBDIR ?= $(PREFIX)/lib
INCLUDEDIR ?= $(PREFIX)/include
MODULEDIR ?= $(LIBDIR)/kdns_modules
ETCDIR ?= $(PREFIX)/etc/kresd
# Tools
CC ?= cc
......
......@@ -35,7 +35,7 @@ endif
# Make binary
ifeq ($(HAS_lua)|$(HAS_libuv), yes|yes)
$(eval $(call make_bin,kresd,daemon,yes))
$(eval $(call make_sbin,kresd,daemon,yes))
endif
# Targets
......
......@@ -152,7 +152,7 @@ All paths are prefixed with ``PREFIX`` variable by default if not specified othe
:header: "Component", "Variable", "Default", "Notes"
"library", "``LIBDIR``", "``$(PREFIX)/lib``", "pkg-config is auto-generated [#]_"
"daemon", "``BINDIR``", "``$(PREFIX)/bin``", ""
"daemon", "``SBINDIR``", "``$(PREFIX)/sbin``", ""
"configuration", "``ETCDIR``", "``$(PREFIX)/etc/kresd``", "Configuration file, templates."
"modules", "``MODULEDIR``", "``$(LIBDIR)/kdns_modules``", "[#]_"
"work directory", "", "``$(PREFIX)/var/run/kresd``", "Run directory for daemon."
......
......@@ -120,6 +120,7 @@ endef
# Make targets (name,path,amalgable yes|no,abiver)
make_bin = $(call make_target,$(1),$(2),$(BINEXT),$(BINFLAGS),$(BINDIR),$(3))
make_sbin = $(call make_target,$(1),$(2),$(BINEXT),$(BINFLAGS),$(SBINDIR),$(3))
make_lib = $(call make_target,$(1),$(2),$(LIBEXT),-$(LIBTYPE),$(LIBDIR),$(3),$(4))
make_module = $(call make_target,$(1),$(2),$(LIBEXT),-$(LIBTYPE),$(MODULEDIR),$(3))
make_shared = $(call make_target,$(1),$(2),$(MODEXT),-$(MODTYPE),$(LIBDIR),$(3))
......
......@@ -14,7 +14,7 @@ EXPOSE 53
# Select entrypoint
WORKDIR /data
CMD ["/usr/local/bin/kresd"]
CMD ["/usr/local/sbin/kresd"]
# Install dependencies and sources
RUN \
......
#include <tunables/global>
/usr/bin/kresd {
/usr/sbin/kresd {
#include <abstractions/base>
#include <abstractions/p11-kit>
#include <abstractions/nameservice>
......@@ -28,6 +28,6 @@
/usr/lib{,64}/kdns_modules/tinyweb/* r,
/var/lib/GeoIP/* r,
# Site-specific additions and overrides. See local/README for details.
#include <local/usr.bin.kresd>
#include <local/usr.sbin.kresd>
}
......@@ -5,7 +5,7 @@ After=network.target
[Service]
Type=simple
EnvironmentFile=-/etc/sysconfig/kresd
ExecStart=/usr/bin/kresd -c /etc/kresd/config -f $KRESD_WORKERS $KRESD_OPTIONS /var/lib/kresd/
ExecStart=/usr/sbin/kresd -c /etc/kresd/config -f $KRESD_WORKERS $KRESD_OPTIONS /var/lib/kresd/
Restart=on-abort
[Install]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment