diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 5838171..6520ad1 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -213,8 +213,9 @@ EOF %changelog * Wed Jun 24 2020 Jens Petersen - 2.0.11-1 -- only add dynlib to file list if it exists - (this allows for metapkg subpackages) +- handle meta subpackages: + - ghc_lib_subpackage -m + - only add dynlib to file-list if it exists * Thu Jun 18 2020 Jens Petersen - 2.0.10-1 - cabal-tweak script now output errors to stderr diff --git a/macros.ghc-extra b/macros.ghc-extra index 014b2de..54e9c75 100644 --- a/macros.ghc-extra +++ b/macros.ghc-extra @@ -1,8 +1,8 @@ # RPM Macros for packaging Haskell packages with multiple libs -*-rpm-spec-*- -# ghc_lib_subpackage [-c cdepslist] [-d] [-l licensetag] [-x] [name-version] +# ghc_lib_subpackage [-c cdepslist] [-d] [-l licensetag] [-m] [-x] [name-version] # for backward compat also support: ghc_lib_subpackage name version -%ghc_lib_subpackage(c:dl:x)\ +%ghc_lib_subpackage(c:dl:mx)\ %define pkgname %{?2:%{1}}%{!?2:%{lua:\ local pv = rpm.expand("%1")\ local _, _, name = string.find(pv, "^([%a%d-]+)-")\ @@ -15,6 +15,7 @@ print(string.sub(pv, string.find(pv, "[%d.]+$")))\ %{!-x:%{?1:%global ghc_packages_list %{?ghc_packages_list} %{pkgname}-%{pkgver}}}\ %define ghc_prefix %{?ghc_name}%{!?ghc_name:ghc}\ %define basepkg %{ghc_prefix}-%{pkgname}\ +%if 0%{!-m:1}\ %package -n %{basepkg}\ Summary: Haskell %{pkgname} library\ %{?1:Version: %{pkgver}}\ @@ -25,6 +26,7 @@ Url: http://hackage.haskell.org/package/%{pkgname}\ %description -n %{basepkg}\ This package provides the Haskell %{pkgname} library.\ \ +%endif\ %package -n %{basepkg}-devel\ Summary: Haskell %{pkgname} library development files\ %{?1:Version: %{pkgver}}\ @@ -32,7 +34,9 @@ Summary: Haskell %{pkgname} library development files\ Provides: %{basepkg}-static = %{pkgver}-%{release}\ Provides: %{basepkg}-static%{?_isa} = %{pkgver}-%{release}\ Requires: %{ghc_prefix}-compiler = %{ghc_version}%{?ghc_version_override:-%{release}}\ +%if 0%{!-m:1}\ Requires: %{ghc_prefix}-%{pkgname}%{?_isa} = %{pkgver}-%{release}\ +%endif\ %{?ghc_pkg_c_deps:Requires: %{ghc_pkg_c_deps}}\ %{-c:Requires: %{-c*}}\ %{?ghc_pkg_obsoletes:Obsoletes: %{ghc_pkg_obsoletes}}\ @@ -40,6 +44,7 @@ Requires: %{ghc_prefix}-%{pkgname}%{?_isa} = %{pkgver}-%{release}\ %description -n %{basepkg}-devel\ This package provides the Haskell %{pkgname} library development files.\ \ +%if 0%{!-m:1}\ %if %{with haddock}\ %package -n %{basepkg}-doc\ Summary: Haskell %{pkgname} library documentation\ @@ -65,7 +70,9 @@ This package provides the Haskell %{pkgname} profiling library.\ \ %files -n %{basepkg} -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}.files\ \ +%endif\ %files -n %{basepkg}-devel -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-devel.files\ +%if 0%{!-m:1}\ \ %if %{with haddock}\ %files -n %{basepkg}-doc -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-doc.files\ @@ -74,6 +81,7 @@ This package provides the Haskell %{pkgname} profiling library.\ %if %{with ghc_prof}\ %files -n %{basepkg}-prof -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-prof.files\ %endif\ +%endif\ %{nil} # ghc_libs_build [name-version] ...