From 3ef707def2b5ba37394904d5f8f3618f8e98678b Mon Sep 17 00:00:00 2001 From: Jack Wearden Date: Sat, 18 Mar 2023 22:49:25 +0000 Subject: [PATCH] Makefile: allow specifying /lib dir location On some platforms, /lib is not actually a directory, it is a symlink to /usr/lib: $ ls -l /lib lrwxrwxrwx 1 root root 7 Dec 4 17:11 /lib -> usr/lib When this is the case, "make install" will be operating under a false assumption when it generates any relative symlinks to files under a different root-level directory. If linking to /libexec/... from /lib/... for example, the generated relative symlink will be 1 parent directory pointer (../) too short. This PR allows the builder to specify LIBDIR=/usr/lib, explicitly installing files to the target of the symlink. This results in symlinks being generated with the correct depth. Signed-off-by: Jack Wearden --- Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 7bb75a6747..9ed4e023e1 100644 --- a/Makefile +++ b/Makefile @@ -39,13 +39,14 @@ LIBEXECPODMAN ?= ${LIBEXECDIR}/podman MANDIR ?= ${PREFIX}/share/man SHAREDIR_CONTAINERS ?= ${PREFIX}/share/containers ETCDIR ?= ${PREFIX}/etc -TMPFILESDIR ?= ${PREFIX}/lib/tmpfiles.d +LIBDIR ?= ${PREFIX}/lib +TMPFILESDIR ?= ${LIBDIR}/tmpfiles.d USERTMPFILESDIR ?= ${PREFIX}/share/user-tmpfiles.d -MODULESLOADDIR ?= ${PREFIX}/lib/modules-load.d -SYSTEMDDIR ?= ${PREFIX}/lib/systemd/system -USERSYSTEMDDIR ?= ${PREFIX}/lib/systemd/user -SYSTEMDGENERATORSDIR ?= ${PREFIX}/lib/systemd/system-generators -USERSYSTEMDGENERATORSDIR ?= ${PREFIX}/lib/systemd/user-generators +MODULESLOADDIR ?= ${LIBDIR}/modules-load.d +SYSTEMDDIR ?= ${LIBDIR}/systemd/system +USERSYSTEMDDIR ?= ${LIBDIR}/systemd/user +SYSTEMDGENERATORSDIR ?= ${LIBDIR}/systemd/system-generators +USERSYSTEMDGENERATORSDIR ?= ${LIBDIR}/systemd/user-generators REMOTETAGS ?= remote exclude_graphdriver_btrfs btrfs_noversion exclude_graphdriver_devicemapper containers_image_openpgp BUILDTAGS ?= \ $(shell hack/apparmor_tag.sh) \