diff --git a/ghc-deps.sh b/ghc-deps.sh index 265614e..72372ba 100755 --- a/ghc-deps.sh +++ b/ghc-deps.sh @@ -1,12 +1,16 @@ #!/bin/sh # find rpm provides and requires for Haskell GHC libraries -[ $# -ne 2 ] && echo "Usage: $(basename $0) [--provides|--requires] %{buildroot}%{ghclibdir}" && exit 1 +[ $# -lt 2 ] && echo "Usage: $(basename $0) [--provides|--requires] %{buildroot}%{ghclibdir} [%{?ghc_name}]" && exit 1 set +x MODE=$1 PKGBASEDIR=$2 +if [ -z "$3" -o "$3" = "ghc" ]; +then GHCPREFIX=ghc +else GHCPREFIX=$(basename $PKGBASEDIR) +fi PKGCONFDIR=$PKGBASEDIR/package.conf.d GHC_PKG="/usr/lib/rpm/ghc-pkg-wrapper $PKGBASEDIR" @@ -25,13 +29,13 @@ for i in $files; do meta="" case $i in # exclude rts.conf - $pkgconfdir/*-*.conf) + $PKGCONFDIR/*-*.conf) name=$(grep "^name: " $i | sed -e "s/name: //") ids=$($GHC_PKG field $name $field | sed -e "s/ rts\b//" -e "s/bin-package-db-[^ ]\+//") for d in $ids; do case $d in *-*-internal) ;; - *-*) echo "ghc-devel($d)" ;; + *-*) echo "$GHCPREFIX-devel($d)" ;; *) ;; esac done @@ -45,11 +49,11 @@ for i in $files; do *-*) case $field in id) - echo "ghc-prof($d)" + echo "$GHCPREFIX-prof($d)" ;; *) if [ -f /usr/lib*/ghc-*/*/libHS${d}_p.a -o -f $PKGBASEDIR/*/libHS${d}_p.a ]; then - echo "ghc-prof($d)" + echo "$GHCPREFIX-prof($d)" fi ;; esac diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 9f678fd..73bfd97 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -7,7 +7,7 @@ %endif Name: ghc-rpm-macros -Version: 2.2.4 +Version: 2.3.0 Release: 1%{?dist} Summary: RPM macros for building Haskell packages for GHC @@ -184,8 +184,13 @@ EOF %changelog +* Wed Dec 8 2021 Jens Petersen - 2.3.0-1 +- support fileattrs dependency generation for ghc9.2 +- drop dependency generation for rhel6 + * Thu Sep 9 2021 Jens Petersen - 2.2.4-1 - cabal_configure: add -fhide-source-paths to ghc-options + (works for ghc-8.2 and above) * Mon Aug 23 2021 Jens Petersen - 2.2.3-6 - F35 obsoletes for attempt diff --git a/ghc.attr b/ghc.attr index 94bd957..5626da0 100644 --- a/ghc.attr +++ b/ghc.attr @@ -1,3 +1,3 @@ -%__ghc_provides %{_rpmconfigdir}/ghc-deps.sh --provides %{buildroot}%{ghclibdir} -%__ghc_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir} +%__ghc_provides %{_rpmconfigdir}/ghc-deps.sh --provides %{buildroot}%{ghclibdir} %{?ghc_name} +%__ghc_requires %{_rpmconfigdir}/ghc-deps.sh --requires %{buildroot}%{ghclibdir} %{?ghc_name} %__ghc_path ^%{ghclibdir}/(.*/libHS.*_p\.a|package.conf.d/.*\.conf)$