fix ghc-deps.sh to handle obsoleted meta libraries

use --disable-shared for %ghc_without_shared
epel9
Jens Petersen 10 years ago
parent c2213a0236
commit 0b6b0198da

@ -35,42 +35,38 @@ case $MODE in
*) echo "`basename $0`: Need --provides or --requires" ; exit 1
esac
if [ -d "$PKGBASEDIR" ]; then
SHARED=$(find $PKGBASEDIR -type f -name '*.so')
fi
files=$(cat)
for i in $files; do
LIB_FILE=$(echo $i | grep /libHS | egrep -v "/libHSrts")
if [ "$LIB_FILE" ]; then
if [ -d "$PKGCONFDIR" ]; then
META=""
SELF=""
case $LIB_FILE in
*.so) META=ghc ;;
*.a) META=ghc-devel
if [ "$SHARED" ]; then
SELF=ghc
fi
;;
esac
if [ "$META" ]; then
PKGVER=$(echo $LIB_FILE | sed -e "s%$PKGBASEDIR/\([^/]\+\)/libHS.*%\1%")
HASHS=$(${GHC_PKG} -f $PKGCONFDIR field $PKGVER $FIELD | sed -e "s/^$FIELD: \+//")
for i in $HASHS; do
case $i in
*-*) echo "$META($i)" ;;
*) ;;
esac
done
if [ "$MODE" = "--requires" -a "$SELF" ]; then
HASHS=$(${GHC_PKG} -f $PKGCONFDIR field $PKGVER id | sed -e "s/^id: \+//")
for i in $HASHS; do
echo "$SELF($i)"
done
fi
META=""
SELF=""
case $i in
*/libHSrts.*) ;;
*/libHS*.so)
META=ghc
PKGVER=$(echo $i | sed -e "s%$PKGBASEDIR/\([^/]\+\)/libHS.*%\1%")
;;
*/package.conf.d/*.conf)
META=ghc-devel
PKGVER=$(echo $i | sed -e "s%$PKGCONFDIR/\(.\+\).conf%\1%")
if [ -f $PKGBASEDIR/$PKGVER/libHS$PKGVER-*.so ]; then
SELF=ghc
fi
;;
esac
if [ "$META" -a -d "$PKGCONFDIR" ]; then
HASHS=$(${GHC_PKG} -f $PKGCONFDIR field $PKGVER $FIELD | sed -e "s/^$FIELD: \+//")
for i in $HASHS; do
case $i in
*-*) echo "$META($i)" ;;
*) ;;
esac
done
if [ "$MODE" = "--requires" -a "$SELF" ]; then
HASHS=$(${GHC_PKG} -f $PKGCONFDIR field $PKGVER id | sed -e "s/^id: \+//")
for i in $HASHS; do
echo "$SELF($i)"
done
fi
elif [ "$MODE" = "--requires" ]; then
if file $i | grep -q 'executable, .* dynamically linked'; then

@ -6,7 +6,7 @@
#%%global without_hscolour 1
Name: ghc-rpm-macros
Version: 1.4.10
Version: 1.4.11
Release: 1%{?dist}
Summary: RPM macros for building packages for GHC
@ -32,6 +32,7 @@ Requires: redhat-rpm-config > 20-1.fc21
# for ghc_version
Requires: ghc-compiler
%if %{undefined without_hscolour}
# could use ghc_arches here
%ifarch %{ix86} %{ix86} x86_64 ppc ppc64 alpha sparcv9 armv7hl armv5tel s390 s390x ppc64le aarch64
Requires: hscolour
%endif
@ -88,6 +89,10 @@ install -p -D -m 0755 %{SOURCE5} %{buildroot}/%{_bindir}/cabal-tweak-flag
%changelog
* Mon Mar 2 2015 Jens Petersen <petersen@redhat.com> - 1.4.11-1
- fix ghc-deps.sh to handle meta-packages
- configure --disable-shared if ghc_without_shared
* Fri Feb 27 2015 Jens Petersen <petersen@fedoraproject.org> - 1.4.10-1
- have to turn off hardening in cabal_configure: set _hardened_ldflags to nil

@ -106,7 +106,7 @@ install -D --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf.
# ghc_lib_build_without_haddock [name] [version]
%ghc_lib_build_without_haddock()\
%global debug_package %{nil}\
%cabal_configure %{!?without_prof:-p} %{!?ghc_without_shared:--enable-shared} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{_docdir}/ghc-%1%{!?fedora:-%2} --htmldir=%{ghclibdocdir}/%1-%2} %{!?1:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
%cabal_configure %{!?without_prof:-p} %{?ghc_without_shared:--disable-shared} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{_docdir}/ghc-%1%{!?fedora:-%2} --htmldir=%{ghclibdocdir}/%1-%2} %{!?1:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
%cabal build\
%{nil}

Loading…
Cancel
Save