fix ghc-deps.sh when bootstrapping a new ghc version

ie do not assume bindir/ghc is the same ghc version just built
epel9
Jens Petersen 11 years ago
parent db486c2fbb
commit 0cd6abba00

@ -8,6 +8,8 @@
[ $# -ne 2 ] && echo "Usage: `basename $0` [--provides|--requires] %{buildroot}%{ghclibdir}" && exit 1
#set -x
MODE=$1
PKGBASEDIR=$2
PKGCONFDIR=$PKGBASEDIR/package.conf.d
@ -29,12 +31,8 @@ if [ -d "$PKGBASEDIR" ]; then
SHARED=$(find $PKGBASEDIR -type f -name '*.so')
fi
GHCVERSION=$(ghc --numeric-version)
files=$(cat)
#set -x
for i in $files; do
LIB_FILE=$(echo $i | grep /libHS | egrep -v "/libHSrts")
if [ "$LIB_FILE" ]; then
@ -68,7 +66,7 @@ for i in $files; do
fi
elif [ "$MODE" = "--requires" ]; then
if file $i | grep -q 'executable, .* dynamically linked'; then
BIN_DEPS=$(objdump -p $i | grep NEEDED | grep libHS | grep -v libHSrts | sed -e "s%^ NEEDED *libHS\(.*\)-ghc${GHCVERSION}.so%\1%")
BIN_DEPS=$(objdump -p $i | grep NEEDED | grep libHS | grep -v libHSrts | sed -e "s%^ *NEEDED *libHS\(.*\)-ghc${GHC_VER}.so%\1%")
if [ -d "$PKGCONFDIR" ]; then
PACKAGE_CONF_OPT="--package-conf=$PKGCONFDIR"
fi

@ -6,7 +6,7 @@
#%%global without_hscolour 1
Name: ghc-rpm-macros
Version: 1.1.1
Version: 1.1.2
Release: 1%{?dist}
Summary: RPM macros for building packages for GHC
@ -90,6 +90,9 @@ EOF
%changelog
* Mon Sep 9 2013 Jens Petersen <petersen@redhat.com> - 1.1.2-1
- fix ghc-deps.sh when bootstrapping a new ghc version
* Mon Sep 9 2013 Jens Petersen <petersen@redhat.com> - 1.1.1-1
- use objdump -p instead of ldd to read executable dependencies

Loading…
Cancel
Save