From e3f0ce021e184afa91d70e75d3269d7e60ed7392 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Tue, 6 Oct 2015 20:15:44 +0200 Subject: [PATCH] pre-pkg/06-shlib-provides.sh: revamp soname registration. We now register all versioned sonames, and unversioned sonames only when in libdir. (E.g. libdb and tcl use version numbers in the library name, and have unversioned sonames.) Closes #2699. --- common/hooks/pre-pkg/06-shlib-provides.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/hooks/pre-pkg/06-shlib-provides.sh b/common/hooks/pre-pkg/06-shlib-provides.sh index 401bc7ab8a..785a7f3905 100644 --- a/common/hooks/pre-pkg/06-shlib-provides.sh +++ b/common/hooks/pre-pkg/06-shlib-provides.sh @@ -3,7 +3,8 @@ collect_sonames() { local _destdir="$1" f _soname _fname _pattern - local _pattern="^[[:alnum:]]+(.*)+\.so(\.[0-9]+)+$" + local _pattern="^[[:alnum:]]+(.*)+\.so(\.[0-9]+)*$" + local _versioned_pattern="^[[:alnum:]]+(.*)+\.so(\.[0-9]+)+$" local _tmpfile="$(mktemp)" if [ ! -d ${_destdir} ]; then @@ -18,7 +19,12 @@ collect_sonames() { application/x-sharedlib*) # shared library _soname=$(${OBJDUMP} -p "$f"|grep SONAME|awk '{print $2}') - if [[ ${_soname} =~ ${_pattern} ]]; then + # Register all versioned sonames, and + # unversioned sonames only when in libdir. + if [[ ${_soname} =~ ${_versioned_pattern} ]] || + [[ ${_soname} =~ ${_pattern} && + ( -e ${_destdir}/usr/lib/${_fname} || + -e ${_destdir}/usr/lib32/${_fname} ) ]]; then echo "${_soname}" >> ${_tmpfile} echo " SONAME ${_soname} from ${f##${_destdir}}" fi