pkgconfiglib.req: removed

'pkg-config --libs' seems to deploy dependencies recursively,
which is what I did not expect.

$ grep Requires pango.pc
Requires: glib-2.0,gobject-2.0,gmodule-no-export-2.0
$ grep Lib pango.pc
Libs: -lpango-1.0 -lm
$ pkg-config --libs-only-l pango.pc
-lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
$

I need some time to devise a better implementation.
This commit is contained in:
Alexey Tourbin 2007-09-30 14:59:22 +04:00
parent 517efb4b7d
commit 7ee459ab6b
3 changed files with 0 additions and 51 deletions

View File

@ -474,7 +474,6 @@ fi
%rpmattr %_rpmlibdir/lib.*
%rpmattr %_rpmlibdir/pam.*
%rpmattr %_rpmlibdir/pkgconfig.*
%rpmattr %_rpmlibdir/pkgconfiglib.*
%rpmattr %_rpmlibdir/shell.*
%rpmattr %_rpmlibdir/shebang.*
%rpmattr %_rpmlibdir/static.*

View File

@ -51,6 +51,4 @@ config_SCRIPTS = \
install-data-local:
@LN_S@ pkgconfig.req $(DESTDIR)$(configdir)/pkgconfig.prov
@LN_S@ pkgconfig.req $(DESTDIR)$(configdir)/pkgconfiglib.req
@LN_S@ pkgconfig.req.files $(DESTDIR)$(configdir)/pkgconfig.prov.files
@LN_S@ pkgconfig.req.files $(DESTDIR)$(configdir)/pkgconfiglib.req.files

View File

@ -58,56 +58,8 @@ PkgconfigProv()
done
}
PkgconfigLibReq()
{
local f="$1" l L; shift
l=$(pkg-config --print-errors --libs-only-l "$f") || Fatal "failed to process $f"
L=$(pkg-config --print-errors --libs-only-L "$f") || Fatal "failed to process $f"
l=$(echo '' $l |sed -e 's/ -l/ /g')
L=$(echo '' $L |sed -e 's/ -L/ /g')
local lib libdir
for lib in $l; do
lib=lib$lib.so
if [ -n "${RPM_BUILD_ROOT-}" ]; then
for libdir in $L "$RPM_LIBDIR"; do
[ -f "$RPM_BUILD_ROOT$libdir/$lib" ] ||
# ... allow absolute symbolic links:
[ -L "$RPM_BUILD_ROOT$libdir/$lib" ] || continue
# The library is under RPM_BUILD_ROOT.
# Nothing is required. Do next lib.
Verbose "$f: $lib -> \$RPM_BUILD_ROOT$libdir/$lib (skip)"
continue 2
done
fi
for libdir in $L "$RPM_LIBDIR"; do
[ -f "$libdir/$lib" ] || continue
# The library is found in the host system.
# Generate rpm dependency and do next lib.
libdir=$(CanonPath "$libdir")
local pkg n
pkg=$(rpmquery --whatprovides --queryformat='%{NAME}\n' "$libdir/$lib" |sort -u)
n=$(set -- $pkg; echo $#)
if [ "$pkg" = glibc-devel ]; then
Verbose "$f: $lib -> $pkg (skip)"
elif [ $n -eq 1 ]; then
Verbose "$f: $lib -> $pkg"
printf '%s\n' "$pkg"
elif [ $n -gt 1 ]; then
Info "$f: $libdir/$lib provided by:$(echo '' $pkg)"
Info "$f: $lib -> $libdir/$lib (raw, ambiguous)"
printf '%s\n' "$libdir/$lib"
else
Info "$f: cannot map $libdir/$lib to rpm dependency (skip)"
fi
continue 2
done
Info "$f: cannot find $lib library path (skip)"
done
}
case "${0##*/}" in
pkgconfig.req*) ArgvFileAction PkgconfigReq "$@" ;;
pkgconfig.prov*) ArgvFileAction PkgconfigProv "$@" ;;
pkgconfiglib.req*) ArgvFileAction PkgconfigLibReq "$@" ;;
*) Fatal "req/prov method not recognized" ;;
esac