I present ldd2rpm, a little script to find which rpms are needed to satisfy all the dynamic-linking requirements of listed binaries/shared-libraries. May it assist you in sanity-checking and bloat-shaming package dependencies.
#! /bin/sh
rpmqf() {
rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" -f "$1"
}
for program in $@
do
rpmqf "$program"
ldd "$program" | grep '=>' | awk '{print $3}' | grep / |
while read file
do
rpmqf "$file"
done
done | sort -u
Use it thusly:
% ldd2rpm /lib64/libpcp.so.3 avahi-libs-0.6.31-30.fc21.x86_64 cyrus-sasl-lib-2.1.26-19.fc21.x86_64 dbus-libs-1.8.14-1.fc21.x86_64 glibc-2.20-7.fc21.x86_64 nspr-4.10.8-1.fc21.x86_64 nss-3.17.4-1.fc21.x86_64 nss-softokn-freebl-3.17.4-1.fc21.x86_64 nss-util-3.17.4-1.fc21.x86_64 pcp-libs-3.10.2-1.fc21.x86_64 zlib-1.2.8-7.fc21.x86_64
You can feed that list to a pipeline suggested at stackexchange to find transitive dependencies:
% repoquery --requires --recursive --resolve `ldd2rpm PATH`