for ghcMAJOR generate ghc-VERSION-devel(pkg-ver-hash) metadata

also fix lowercase typo of PKGCONFDIR which just happened to work by glob
epel9
Jens Petersen 3 years ago
parent 12a6c28236
commit b3062773f5

@ -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

@ -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 <petersen@redhat.com> - 2.3.0-1
- support fileattrs dependency generation for ghc9.2
- drop dependency generation for rhel6
* Thu Sep 9 2021 Jens Petersen <petersen@redhat.com> - 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 <petersen@redhat.com> - 2.2.3-6
- F35 obsoletes for attempt

@ -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)$

Loading…
Cancel
Save