autodeps/linux.prov.in

This commit is contained in:
Дмитрий Левин 2003-05-25 21:58:45 +00:00
parent f23e5939c6
commit e398f2cbd4
2 changed files with 35 additions and 9 deletions

View File

@ -29,6 +29,9 @@ if [ -z "$(echo "$RPM_BUILD_ROOT" |tr -d ' /.')" ]; then
exit 1
fi
# Normalize buildroot.
RPM_BUILD_ROOT=$(readlink -fv "$RPM_BUILD_ROOT") || exit 1
FIND_LIBS=
FIND_PAM=
FIND_PERL=
@ -157,10 +160,12 @@ FindLibProvs()
{
[ -n "$FIND_LIBS" ] || return 0
local f dir found d
local f dir name found d
f="$1"
dir="${fname%/*}"
[ -n "$dir" ] || return 0
name="${fname##*/}"
[ -n "$name" ] || return 0
found=
for d in $(echo "$RPM_FINDPROV_LIB_PATH" |tr : ' '); do
@ -174,20 +179,35 @@ FindLibProvs()
local soname
soname="$(echo -E "$d" |awk '/SONAME/ {print $2}')" || return 1
if [ -n "$soname" ]; then
if [ ! -L "$f" ]; then
# name
while :; do
# For libraries with soname, ignore all but files named as soname.
[ "$soname" = "$name" ] || break
# Treat symlinks specially.
if [ -L "$f" ]; then
local real realpath
realpath=$(readlink -fv "$f") || break
real="${realpath#$RPM_BUILD_ROOT}"
# Ignore symlinks leading out of buildroot.
[ "$real" != "$realpath" ] || break
fi
# Output soname.
echo "$soname"
# version definitions
echo -E "$d" | awk "-vsoname=$soname" '
# Output version definitions.
echo -E "$d" | awk "-vsoname=$soname" '
BEGIN {START=0;}
/^Version definitions:$/ {START=1;}
/^[0-9]/ && (START==1) && ($4!="") && ($4!=soname) {printf("%s(%s)\n",soname,$4);}
/^$/ { START=0; }
' || return 1
fi
break
done
else
echo "${f##*/}"
# Ignore symlinks for libraries without soname.
[ -L "$f" ] || echo "${f##*/}"
fi
fi
}
@ -209,9 +229,11 @@ while IFS= read -r f; do
fi
done
fi
# Find out file type (dereference symlinks).
if t="$(file -bL "$f")"; then
if [ -z "${t##* text*}" ]; then
ListScriptProvs "$f" "$t"
# Ignore symlinks for scripts.
[ -L "$f" ] || ListScriptProvs "$f" "$t"
elif [ -z "${t##* shared object*}" ]; then
r="$(FindLibProvs "$f")"
[ -z "$FOUND_PROVS" ] && FOUND_PROVS="$r" || FOUND_PROVS="$FOUND_PROVS

View File

@ -6,7 +6,7 @@
Name: %rpm_name
Version: %rpm_version
Release: alt19
Release: alt20
%define ifdef() %if %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
%define get_dep() %(rpm -q --qf '%%{NAME} >= %%|SERIAL?{%%{SERIAL}:}|%%{VERSION}-%%{RELEASE}' %1 2>/dev/null || echo '%1 >= unknown')
@ -472,6 +472,10 @@ fi
%endif #with contrib
%changelog
* Mon May 26 2003 Dmitry V. Levin <ldv@altlinux.org> 4.0.4-alt20
- pam.req: implemented include control directive support.
- brp-cleanup: PAM configuration policy enforcement.
* Fri May 09 2003 Dmitry V. Levin <ldv@altlinux.org> 4.0.4-alt19
- Reduced amount of rpm subpackage dependencies.
- Moved update-alternatives to separate package.