merged pkgconfig.{req,prov} scripts into pkgconfig.req, added install-data-local target

This commit is contained in:
Alexey Tourbin 2007-08-28 18:05:30 +04:00
parent 7b199c08da
commit c5dd9e98c3
5 changed files with 26 additions and 58 deletions

View File

@ -1002,7 +1002,6 @@ AC_OUTPUT([ Doxyfile Makefile rpmrc macros platform rpmpopt rpm.spec
scripts/lib.req
scripts/pam.prov
scripts/pam.req
scripts/pkgconfig.prov
scripts/pkgconfig.req
scripts/shebang.req
scripts/shell.prov

View File

@ -14,7 +14,7 @@ EXTRA_DIST = \
functions magic.prov magic.req \
ldd lib.req lib.req.files lib.prov lib.prov.files shlib.req.awk \
pam.req pam.req.files pam.prov pam.prov.files perl.prov perl.req \
pkgconfig.req pkgconfig.req.files pkgconfig.prov pkgconfig.prov.files \
pkgconfig.req pkgconfig.req.files \
rpmdiff rpmdiff.cgi rpm.daily rpm.log rpm.xinetd rpm2cpio.sh \
shebang.req shebang.req.files \
shell.req shell.req.files shell.prov shell.prov.files \
@ -40,7 +40,7 @@ config_SCRIPTS = \
functions magic.prov magic.req \
ldd lib.req lib.req.files lib.prov lib.prov.files shlib.req.awk \
pam.req pam.req.files pam.prov pam.prov.files perl.prov perl.req \
pkgconfig.req pkgconfig.req.files pkgconfig.prov pkgconfig.prov.files \
pkgconfig.req pkgconfig.req.files \
rpmdiff rpmdiff.cgi rpm.daily rpm.log rpm.xinetd rpm2cpio.sh \
shebang.req shebang.req.files \
shell.req shell.req.files shell.prov shell.prov.files \
@ -48,3 +48,7 @@ config_SCRIPTS = \
static.req static.req.files \
symlinks.req symlinks.req.files \
tcl.req trpm u_pkg.sh verify-elf vpkg-provides.sh vpkg-provides2.sh
install-data-local:
@LN_S@ pkgconfig.req $(DESTDIR)$(configdir)/pkgconfig.prov
@LN_S@ pkgconfig.req.files $(DESTDIR)$(configdir)/pkgconfig.prov.files

View File

@ -1,10 +0,0 @@
#!/bin/sh -efu
[ -n "${RPM_LIBDIR-}" ] || RPM_LIBDIR=`rpm --eval %_libdir`
while IFS=$'\t' read -r f t; do
case "$f" in
${RPM_BUILD_ROOT-}/usr/share/pkgconfig/*.pc)
echo "$f" ;;
${RPM_BUILD_ROOT-}$RPM_LIBDIR/pkgconfig/*.pc)
echo "$f" ;;
esac
done

View File

@ -1,44 +0,0 @@
#!/bin/sh -efu
#
# Copyright (C) 2006 Dmitry V. Levin <ldv@altlinux.org>
# Copyright (C) 2007 Alexey Tourbin <at@altlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
#
. @RPMCONFIGDIR@/functions
[ -n "${RPM_LIBDIR-}" ] || RPM_LIBDIR=`rpm --eval %_libdir`
PKG_CONFIG_PATH=$RPM_LIBDIR/pkgconfig:/usr/share/pkgconfig
[ -z "${RPM_BUILD_ROOT-}" ] ||
PKG_CONFIG_PATH=$RPM_BUILD_ROOT$RPM_LIBDIR/pkgconfig:$RPM_BUILD_ROOT/usr/share/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH
PkgconfigProv()
{
local f="$1" out=; shift
out=$(pkg-config --print-errors --print-provides "$f")
[ -n "$out" ] || return 0
echo "$out" |while read -r line; do
set -- $line
case $# in
1) echo "pkgconfig($1)" ;;
3) echo "pkgconfig($1) $2 $3" ;;
*) Fatal "$f: invalid pkg-config output: $line"
esac
done
}
ArgvFileAction PkgconfigProv "$@"

View File

@ -41,4 +41,23 @@ PkgconfigReq()
done
}
ArgvFileAction PkgconfigReq "$@"
PkgconfigProv()
{
local f="$1" out=; shift
out=$(pkg-config --print-errors --print-provides "$f")
[ -n "$out" ] || return 0
echo "$out" |while read -r line; do
set -- $line
case $# in
1) echo "pkgconfig($1)" ;;
3) echo "pkgconfig($1) $2 $3" ;;
*) Fatal "$f: invalid pkg-config output: $line"
esac
done
}
case "${0##*/}" in
pkgconfig.req*) ArgvFileAction PkgconfigReq "$@" ;;
pkgconfig.prov*) ArgvFileAction PkgconfigProv "$@" ;;
*) Fatal "req/prov method not recognized" ;;
esac