diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 6497aac..a4a7e0e 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -10,7 +10,7 @@ #%%global without_hscolour 1 Name: ghc-rpm-macros -Version: 1.6.3 +Version: 1.6.4 Release: 1%{?dist} Summary: RPM macros for building packages for GHC @@ -135,6 +135,9 @@ EOF %changelog +* Wed Aug 17 2016 Jens Petersen - 1.6.4-1 +- add ghc_sublib_build and ghc_sublib_install to ease bundling libraries + * Sat Aug 6 2016 Jens Petersen - 1.6.3-1 - cabal_verbose from github fedora-haskell/ghc-rpm-macros diff --git a/macros.ghc-extra b/macros.ghc-extra index 38983c0..adadc53 100644 --- a/macros.ghc-extra +++ b/macros.ghc-extra @@ -55,3 +55,39 @@ This package provides the Haskell %{pkgname} library development files.\ %endif\ %{?devel_doc_files:%doc %devel_doc_files}\ %{nil} + +# ghc_sublib_build [name-version] ... +%ghc_sublib_build()\ +HOME=$PWD\ +%define cabal_configure_options --user\ +for i in %*; do\ +name=$(echo $i | sed -e "s/\(.*\)-.*/\1/")\ +ver=$(echo $i | sed -e "s/.*-\(.*\)/\1/")\ +cd $name-$ver\ +case $name in\ +haskell-platform)\ +%ghc_lib_build_without_haddock $name $ver\ +;;\ +*)\ +%ghc_lib_build $name $ver\ +./Setup register --inplace\ +;;\ +esac\ +cd ..\ +done\ +%{nil} + +# ghc_sublib_install [name-version] ... +%ghc_sublib_install()\ +HOME=$PWD\ +for i in %*; do\ +name=$(echo $i | sed -e "s/\(.*\)-.*/\1/")\ +ver=$(echo $i | sed -e "s/.*-\(.*\)/\1/")\ +cd $name-$ver\ +%ghc_lib_install $name $ver\ +echo "%%license $name-$ver/LICENSE" >> ghc-$name.files\ +rm %{buildroot}%{_docdir}/ghc-$name/LICENSE\ +mv *.files ..\ +cd ..\ +done\ +%{nil}