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

@ -6,7 +6,7 @@
#%%global without_hscolour 1 #%%global without_hscolour 1
Name: ghc-rpm-macros Name: ghc-rpm-macros
Version: 1.4.10 Version: 1.4.11
Release: 1%{?dist} Release: 1%{?dist}
Summary: RPM macros for building packages for GHC Summary: RPM macros for building packages for GHC
@ -32,6 +32,7 @@ Requires: redhat-rpm-config > 20-1.fc21
# for ghc_version # for ghc_version
Requires: ghc-compiler Requires: ghc-compiler
%if %{undefined without_hscolour} %if %{undefined without_hscolour}
# could use ghc_arches here
%ifarch %{ix86} %{ix86} x86_64 ppc ppc64 alpha sparcv9 armv7hl armv5tel s390 s390x ppc64le aarch64 %ifarch %{ix86} %{ix86} x86_64 ppc ppc64 alpha sparcv9 armv7hl armv5tel s390 s390x ppc64le aarch64
Requires: hscolour Requires: hscolour
%endif %endif
@ -88,6 +89,10 @@ install -p -D -m 0755 %{SOURCE5} %{buildroot}/%{_bindir}/cabal-tweak-flag
%changelog %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 * 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 - 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 [name] [version]
%ghc_lib_build_without_haddock()\ %ghc_lib_build_without_haddock()\
%global debug_package %{nil}\ %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\ %cabal build\
%{nil} %{nil}

Loading…
Cancel
Save