b1fc196577
macros.ghc no longer uses ghc-pkg-wrapper - %ghc_fix_rpath gets lib dir directly by globbing buildroot - %ghc_gen_filelists reads pkg key from .conf - ghc-deps.sh: read unique pkg id from .conf before this preinstalled libs were interfering and this was further exasperated on ghc8 where .conf filenames are not keyed so we were querying `ghc-pkg list pkg` instead of pkg-ver.
40 lines
834 B
Bash
Executable File
40 lines
834 B
Bash
Executable File
#!/bin/sh
|
|
# find rpm provides and requires for Haskell GHC libraries
|
|
|
|
[ $# -ne 2 ] && echo "Usage: `basename $0` [--provides|--requires] %{buildroot}%{ghclibdir}" && exit 1
|
|
|
|
set +x
|
|
|
|
mode=$1
|
|
pkgbasedir=$2
|
|
pkgconfdir=$pkgbasedir/package.conf.d
|
|
|
|
ghc_pkg="/usr/lib/rpm/ghc-pkg-wrapper $pkgbasedir"
|
|
|
|
case $mode in
|
|
--provides) field=id ;;
|
|
--requires) field=depends ;;
|
|
*) echo "`basename $0`: Need --provides or --requires" ; exit 1
|
|
esac
|
|
|
|
files=$(cat)
|
|
|
|
for i in $files; do
|
|
case $i in
|
|
# exclude builtin_rts.conf
|
|
$pkgconfdir/*-*.conf)
|
|
id=$(grep "id: " $i | sed -e "s/id: //")
|
|
ids=$($ghc_pkg field $id $field | sed -e "s/rts//" -e "s/bin-package-db-[^ ]\+//")
|
|
|
|
for d in $ids; do
|
|
case $d in
|
|
*-*) echo "ghc-devel($d)" ;;
|
|
*) ;;
|
|
esac
|
|
done
|
|
;;
|
|
*)
|
|
;;
|
|
esac
|
|
done
|