From c5dd9e98c334e8a313e5cc9d84909bfbfdac7668 Mon Sep 17 00:00:00 2001 From: Alexey Tourbin Date: Tue, 28 Aug 2007 18:05:30 +0400 Subject: [PATCH] merged pkgconfig.{req,prov} scripts into pkgconfig.req, added install-data-local target --- configure.in | 1 - scripts/Makefile.am | 8 +++++-- scripts/pkgconfig.prov.files | 10 -------- scripts/pkgconfig.prov.in | 44 ------------------------------------ scripts/pkgconfig.req.in | 21 ++++++++++++++++- 5 files changed, 26 insertions(+), 58 deletions(-) delete mode 100755 scripts/pkgconfig.prov.files delete mode 100755 scripts/pkgconfig.prov.in diff --git a/configure.in b/configure.in index ce8b41b..a2fe227 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 1e1e27c..d93d477 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -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 diff --git a/scripts/pkgconfig.prov.files b/scripts/pkgconfig.prov.files deleted file mode 100755 index 25a65a5..0000000 --- a/scripts/pkgconfig.prov.files +++ /dev/null @@ -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 diff --git a/scripts/pkgconfig.prov.in b/scripts/pkgconfig.prov.in deleted file mode 100755 index 4cc1ee0..0000000 --- a/scripts/pkgconfig.prov.in +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -efu -# -# Copyright (C) 2006 Dmitry V. Levin -# Copyright (C) 2007 Alexey Tourbin -# -# 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 "$@" diff --git a/scripts/pkgconfig.req.in b/scripts/pkgconfig.req.in index 810b48d..1176db4 100755 --- a/scripts/pkgconfig.req.in +++ b/scripts/pkgconfig.req.in @@ -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