2002-10-02 19:08:15 +04:00
#!/bin/sh -e
#
# brp-fixup - Misc fixups.
#
2006-01-24 03:13:07 +03:00
# Copyright (C) 2002-2006 Dmitry V. Levin <ldv@altlinux.org>
2002-10-02 19:08:15 +04:00
#
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
2003-11-09 19:30:18 +03:00
. @RPMCONFIGDIR@/functions
ValidateBuildRoot
2002-10-02 19:08:15 +04:00
cd "$RPM_BUILD_ROOT"
SHOW_METHODS=
AddShowMethods()
{
if [ -z "$SHOW_METHODS" ]; then
SHOW_METHODS="$*"
else
SHOW_METHODS="$SHOW_METHODS,$*"
fi
}
export FIXUP_BINCONFIG=
export FIXUP_PKGCONFIG=
export FIXUP_LIBTOOL=
2003-11-07 20:45:11 +03:00
for t in `printf %s "$RPM_FIXUP_METHOD" |tr , ' '`; do
2002-10-02 19:08:15 +04:00
case "$t" in
no|none|off|false|skip)
exit 0
;;
config|binconfig)
FIXUP_BINCONFIG=binconfig
AddShowMethods binconfig
;;
pkgconfig)
FIXUP_PKGCONFIG=pkgconfig
AddShowMethods pkgconfig
;;
la|libtool)
FIXUP_LIBTOOL=libtool
AddShowMethods libtool
;;
*)
2003-11-09 19:30:18 +03:00
Fatal "Unrecognized fixup method: $t"
2002-10-02 19:08:15 +04:00
;;
esac
done
if [ -z "$FIXUP_BINCONFIG" -a -z "$FIXUP_PKGCONFIG" -a -z "$FIXUP_LIBTOOL" ]; then
# Nothing to do
exit 0
fi
echo "Verifying and fixing files in $RPM_BUILD_ROOT ($SHOW_METHODS)"
: ${RPM_FIXUP_TOPDIR:=}
2004-10-31 14:34:50 +03:00
[ -d "$RPM_BUILD_ROOT$RPM_FIXUP_TOPDIR" ] || exit 0
2002-10-02 19:08:15 +04:00
2002-10-02 20:30:58 +04:00
if [ -n "$FIXUP_BINCONFIG" -a -d ./usr/bin ]; then
2002-10-02 19:08:15 +04:00
find ./usr/bin -maxdepth 1 -type f -name \*-config -print0 |
xargs -r0 @RPMCONFIGDIR@/fixup-binconfig
fi
2006-01-24 03:13:07 +03:00
if [ -n "$FIXUP_PKGCONFIG" ]; then
for d in ."$RPM_LIBDIR"/pkgconfig ./usr/share/pkgconfig; do
[ -d "$d" ] || continue
find "$d" -maxdepth 1 -type f -name \*.pc -print0 |
xargs -r0 @RPMCONFIGDIR@/fixup-pkgconfig
done
2005-06-16 20:18:15 +04:00
fi
2002-10-02 20:30:58 +04:00
if [ -n "$FIXUP_LIBTOOL" ]; then
2002-10-02 19:08:15 +04:00
find .$RPM_FIXUP_TOPDIR -type f -name \*.la -print0 |
xargs -r0 @RPMCONFIGDIR@/fixup-libtool
fi