ghc-rpm-macros/ghc-deps.sh
Jens Petersen 5517c1f361 new cabal-tweak-drop-dep and other merges from github
- no longer use a topdir for subpackage building
- only autopackage license if subpackaging
- move uniq to ghc-pkg-wrapper
- add macros.ghc-fedora for Fedora specific config
- replace cabal_verbose with cabal_configure_verbose, cabal_build_verbose,
  cabal_install_verbose, cabal_haddock_verbose, and cabal_test_verbose
- new _ghcdocdir
2017-02-08 15:26:07 +09:00

40 lines
861 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)
pkgver=$(echo $i | sed -e "s%$pkgconfdir/\(.\+\)-.\+.conf%\1%")
ids=$($ghc_pkg field $pkgver $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