make: Fix CONFIG_SUBDIR
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m50s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m17s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m49s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m7s
CI / Packaging test (push) Successful in 0s

The existence of CONFIG_SUBDIR hijacks INSTALL_CFGDIR to a subdirectory (by
default /etc/opt/<package>/$(CONFIG_SUBDIR)). Then std_install_rules apply,
and (the bent) INSTALL_CFGDIR is installed, but its parent directory, the
original $(INSTALL_CFGDIR), is not a prerequisite of install anylonger, and
has no rule anymore, hence log-install is never run for it. Instead it's
implicitly created by log-install -D $(INSTALL_CFGDIR).

This commit gives /etc/opt/<package> std-install rule and variables back as
CFGTOPDIR variants, and inserts it early into the install target's
prerequisite list.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-09-07 05:33:33 +02:00
commit f33f47c2b3
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
4 changed files with 22 additions and 4 deletions

View file

@ -316,6 +316,7 @@ BUILD_CFGDIR = $(TOPDIR)/conf
ifeq ($(CONFIG_SUBDIR),)
INSTALL_CFGDIR ?= $(CONFIG_DIR)
else
INSTALL_CFGTOPDIR ?= $(CONFIG_DIR)
INSTALL_CFGDIR ?= $(CONFIG_DIR)/$(CONFIG_SUBDIR)
endif
LOCAL_CFG ?= $(filter-out %.site.conf, $(filter-out rsyslog-%, $(wildcard *.conf *.xml *.bprof *.jw-tmpl *.ini *.yaml *.toml))) $(LOCAL_EXTRA_CFG)