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 <jack@jackwearden.co.uk>
This commit is contained in:
Jack Wearden
2023-03-18 22:49:25 +00:00
parent 149f22942a
commit 3ef707def2

View File

@ -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) \