make: Own the top-level project directories in packages #88

Merged
Jan Lindemann merged 2 commits from jan/fix/20260907-make-own-the-top-level-project-directories-in-packages into master 2026-09-07 09:37:34 +02:00 AGit

This PR makes the install machinery install and log the top-level project directories, so the built packages own /opt/ and /etc/opt/ and uninstalling a subpackage no longer leaves empty directories behind:

make: Support INSTALL_PREFIXDIR

During "make install", the packaging machinery should run "$(LOG_INSTALL) -D /opt/" but runs "mkdir -p /opt/" instead. As a consequence, the created directory is not owned by any of the created packages. This commit fixes that by introducing INSTALL_PREFIXDIR and installing it like all other directories.

make: Fix CONFIG_SUBDIR

The existence of CONFIG_SUBDIR hijacks INSTALL_CFGDIR to a subdirectory (by default /etc/opt//$(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/ std-install rule and variables back as CFGTOPDIR variants, and inserts it early into the install target's prerequisite list.

This PR makes the install machinery install and log the top-level project directories, so the built packages own /opt/<pkg> and /etc/opt/<pkg> and uninstalling a subpackage no longer leaves empty directories behind: #### make: Support INSTALL_PREFIXDIR During "make install", the packaging machinery should run "$(LOG_INSTALL) -D /opt/<pkg>" but runs "mkdir -p /opt/<pkg>" instead. As a consequence, the created directory is not owned by any of the created packages. This commit fixes that by introducing INSTALL_PREFIXDIR and installing it like all other directories. #### make: Fix CONFIG_SUBDIR 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.
During "make install", the packaging machinery should run "$(LOG_INSTALL)
-D /opt/<pkg>" but runs "mkdir -p /opt/<pkg>" instead. As a consequence,
the created directory is not owned by any of the created packages. This
commit fixes that by introducing INSTALL_PREFIXDIR and installing it like
all other directories.

Signed-off-by: Jan Lindemann <jan@janware.com>
make: Fix CONFIG_SUBDIR
Some checks failed
CI / Packaging - Kali Linux (pull_request) Successful in 4m20s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Failing after 2m12s
CI / Packaging test (pull_request) Failing after 0s
fe2ae06367
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>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-09-07 06:27:30 +02:00
Jan Lindemann force-pushed jan/fix/20260907-make-own-the-top-level-project-directories-in-packages from fe2ae06367
Some checks failed
CI / Packaging - Kali Linux (pull_request) Successful in 4m20s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Failing after 2m12s
CI / Packaging test (pull_request) Failing after 0s
to f33f47c2b3
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
2026-09-07 09:24:43 +02:00
Compare
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!88
No description provided.