diff options
author | Jon Ringle <jringle@gridpoint.com> | 2014-10-01 01:09:56 -0400 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2014-10-01 12:03:28 +0200 |
commit | 45c235d9d86b1b31bfe61e59c557235c2ffd415c (patch) | |
tree | a16937826384ff50e50a98eda8741aa20708cbd2 /scripts | |
parent | 75478999c3f7087fd9186534fbc11553b52bf51f (diff) | |
download | ptxdist-45c235d9d86b1b31bfe61e59c557235c2ffd415c.tar.gz ptxdist-45c235d9d86b1b31bfe61e59c557235c2ffd415c.tar.xz |
install_dir: Allow one to specify an alternate root dir
This is useful if you install a package to /opt and libs are in /opt/lib:
$(call install_lib, foo, 0, 0, 0644, libfoo, /opt)
Signed-off-by: Jon Ringle <jringle@gridpoint.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/ptxd_make_xpkg_pkg.sh | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh index 86196a2e3..5c5ce6759 100644 --- a/scripts/lib/ptxd_make_xpkg_pkg.sh +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh @@ -744,9 +744,18 @@ export -f ptxd_install_shared ptxd_install_lib() { local lib_dir=$(ptxd_get_lib_dir) local lib="$1" - shift + local root_dir="${2}" + shift 2 + + if [ -n "${root_dir}" ]; then + root_dir="${root_dir%/}" + + if [[ "${root_dir}" != /* ]]; then + ptxd_install_error "ptxd_lib_install: root_dir '${root_dir}' must be absolute" + fi + fi - local file="$(for dir in "${pkg_pkg_dir}/"{,usr/}${lib_dir}; do + local file="$(for dir in "${pkg_pkg_dir}"${root_dir}{/,/usr/}${lib_dir}; do find "${dir}" -type f -path "${dir}/${lib}.so*"; done 2>/dev/null)" if [ ! -f "${file}" ]; then |