%global debug_package %{nil} %global macros_dir %{_sysconfdir}/rpm Name: ghc-rpm-macros Version: 2.5.2 Release: %mkrel 1 Summary: RPM macros for building Haskell packages for GHC License: GPLv3+ # Currently source is only in pkg git but tarballs could be made if it helps URL: https://src.fedoraproject.org/rpms/ghc-rpm-macros/ Source0: macros.ghc Source1: COPYING Source2: AUTHORS Source3: ghc-deps.sh Source4: cabal-tweak-dep-ver Source5: cabal-tweak-flag Source6: macros.ghc-extra Source7: ghc.attr Source8: ghc-pkg-wrapper Source9: macros.ghc-os Source10: Setup.hs Source11: cabal-tweak-drop-dep Source12: cabal-tweak-remove-upperbound Requires: redhat-rpm-config # ghc_version needs ghc-compiler or ghcX.Y-compiler-default Requires: chrpath BuildArch: noarch %description A set of macros for building GHC packages following the Haskell Guidelines of the Fedora Haskell SIG. %package extra Summary: Extra RPM macros for building Haskell library subpackages Requires: %{name} = %{version}-%{release} %description extra Extra macros used for subpackaging of Haskell libraries, for example in ghc and haskell-platform. %if 0%{?fedora} < 37 %package -n ghc-filesystem Summary: Shared directories for Haskell documentation %description -n ghc-filesystem This package provides some common directories used for Haskell libraries documentation. %endif # ideally packages should be obsoleted by some relevant package # this is a last resort when there is no such appropriate package %package -n ghc-obsoletes Summary: Dummy package to obsolete deprecated Haskell packages %if 0%{?fedora} >= 29 Obsoletes: ghc-content-store < 0.2.1-3 Obsoletes: ghc-content-store-devel < 0.2.1-3 Obsoletes: ghc-bdcs < 0.6.1-3 Obsoletes: ghc-bdcs-devel < 0.6.1-3 Obsoletes: ghc-bdcs-api < 0.1.3-3 Obsoletes: ghc-bdcs-api-devel < 0.1.3-3 %endif %if 0%{?fedora} >= 30 # ghc Obsoletes: ghc-hoopl < 3.10.2.2-74 Obsoletes: ghc-hoopl-devel < 3.10.2.2-74 # language-ecmascript Obsoletes: ghc-tagshare < 0.0-10 Obsoletes: ghc-tagshare-devel < 0.0-10 Obsoletes: ghc-testing-feat < 0.4.0.3-10 Obsoletes: ghc-testing-feat-devel < 0.4.0.3-10 # enumerator Obsoletes: ghc-enumerator < 0.4.20-12 Obsoletes: ghc-enumerator-devel < 0.4.20-12 Obsoletes: ghc-attoparsec-enumerator < 0.3.4-10 Obsoletes: ghc-attoparsec-enumerator-devel < 0.3.4-10 Obsoletes: ghc-blaze-builder-enumerator < 0.2.1.0-8 Obsoletes: ghc-blaze-builder-enumerator-devel < 0.2.1.0-8 Obsoletes: ghc-zlib-enum < 0.2.3.1-12 Obsoletes: ghc-zlib-enum-devel < 0.2.3.1-12 # Agda Obsoletes: ghc-monadplus < 1.4.2-17 Obsoletes: ghc-monadplus-devel < 1.4.2-17 # conduit-combinators Obsoletes: ghc-conduit-combinators < 1.3.1 %endif %if 0%{?fedora} >= 31 # base package obsoleted above in f30 Obsoletes: ghc-conduit-combinators-devel < 1.3.1 %endif %if 0%{?fedora} >= 32 Obsoletes: ghc-derive < 2.6.5-5 Obsoletes: ghc-derive-devel < 2.6.5-5 Obsoletes: ghc-derive-prof < 2.6.5-5 Obsoletes: ghc-here < 1.2.13-17 Obsoletes: ghc-here-devel < 1.2.13-17 Obsoletes: ghc-here-prof < 1.2.13-17 %endif %if 0%{?fedora} >= 33 Obsoletes: ghc-easytest < 0.2.1-4 Obsoletes: ghc-easytest-devel < 0.2.1-4 Obsoletes: ghc-easytest-prof < 0.2.1-4, Obsoletes: ghc-EdisonAPI < 1.3.1-23 Obsoletes: ghc-EdisonAPI-devel < 1.3.1-23 Obsoletes: ghc-EdisonAPI-prof < 1.3.1-23 Obsoletes: ghc-EdisonCore < 1.3.2.1-23 Obsoletes: ghc-EdisonCore-devel < 1.3.2.1-23 Obsoletes: ghc-EdisonCore-prof < 1.3.2.1-23 Obsoletes: ghc-gtksourceview2 < 0.13.3.1-14 Obsoletes: ghc-gtksourceview2-devel < 0.13.3.1-14 Obsoletes: ghc-gtksourceview2-prof < 0.13.3.1-14 %endif Obsoletes: ghc-iwlib < 0.1.0-16 Obsoletes: ghc-iwlib-devel < 0.1.0-16 Obsoletes: ghc-iwlib-prof < 0.1.0-16 %if 0%{?fedora} >= 35 Obsoletes: pandoc-citeproc < 0.18 Obsoletes: ghc-pandoc-citeproc < 0.18 Obsoletes: ghc-pandoc-citeproc-devel < 0.18 Obsoletes: ghc-pandoc-citeproc-doc < 0.18 Obsoletes: ghc-pandoc-citeproc-prof < 0.18 Obsoletes: pandoc-citeproc-common < 0.18 Obsoletes: ghc-base-noprelude < 4.13.0.1 Obsoletes: ghc-base-noprelude-devel < 4.13.0.1 Obsoletes: ghc-base-noprelude-doc < 4.13.0.1 Obsoletes: ghc-base-noprelude-prof < 4.13.0.1 Obsoletes: ghc-HsYAML-aeson < 0.2.0.1 Obsoletes: ghc-HsYAML-aeson-devel < 0.2.0.1 Obsoletes: ghc-HsYAML-aeson-doc < 0.2.0.1 Obsoletes: ghc-HsYAML-aeson-prof < 0.2.0.1 Obsoletes: ghc-chalmers-lava2000 < 1.6.2 Obsoletes: ghc-chalmers-lava2000-devel < 1.6.2 Obsoletes: ghc-chalmers-lava2000-doc < 1.6.2 Obsoletes: ghc-chalmers-lava2000-prof < 1.6.2 Obsoletes: ghc-codec-rpm < 0.2.3 Obsoletes: ghc-codec-rpm-devel < 0.2.3 Obsoletes: ghc-codec-rpm-doc < 0.2.3 Obsoletes: ghc-codec-rpm-prof < 0.2.3 Obsoletes: ghc-cpio-conduit < 0.7.1 Obsoletes: ghc-cpio-conduit-devel < 0.7.1 Obsoletes: ghc-cpio-conduit-doc < 0.7.1 Obsoletes: ghc-cpio-conduit-prof < 0.7.1 Obsoletes: ghc-failure < 0.2.0.4 Obsoletes: ghc-failure-devel < 0.2.0.4 Obsoletes: ghc-failure-doc < 0.2.0.4 Obsoletes: ghc-failure-prof < 0.2.0.4 Obsoletes: ghc-attempt < 0.4.0.2 Obsoletes: ghc-attempt-devel < 0.4.0.2 Obsoletes: ghc-attempt-doc < 0.4.0.2 Obsoletes: ghc-attempt-prof < 0.4.0.2 %endif %if 0%{?fedora} >= 36 Obsoletes: ghc-regex-applicative-text < 0.1.0.1-16 Obsoletes: ghc-regex-applicative-text-devel < 0.1.0.1-16 Obsoletes: ghc-regex-applicative-text-doc < 0.1.0.1-16 Obsoletes: ghc-regex-applicative-text-prof < 0.1.0.1-16 %endif %description -n ghc-obsoletes Meta package for obsoleting deprecated Haskell packages. This package can safely be removed. %prep %setup -c -T cp %{SOURCE1} %{SOURCE2} . %build echo no build stage %install install -p -D -m 0644 %{SOURCE0} %{buildroot}%{macros_dir}/macros.ghc install -p -D -m 0644 %{SOURCE6} %{buildroot}%{macros_dir}/macros.ghc-extra install -p -D -m 0644 %{SOURCE9} %{buildroot}%{macros_dir}/macros.ghc-os %if 0%{?fedora} < 38 echo -e "\n%%_ghcdynlibdir %%{_libdir}" >> %{buildroot}%{macros_dir}/macros.ghc-os %endif install -p -D -m 0755 %{SOURCE3} %{buildroot}%{_prefix}/lib/rpm/ghc-deps.sh %if 0%{?fedora} || 0%{?rhel} >= 7 install -p -D -m 0644 %{SOURCE7} %{buildroot}%{_prefix}/lib/rpm/fileattrs/ghc.attr %endif install -p -D -m 0644 %{SOURCE10} %{buildroot}%{_datadir}/%{name}/Setup.hs install -p -D -m 0755 %{SOURCE4} %{buildroot}%{_bindir}/cabal-tweak-dep-ver install -p -D -m 0755 %{SOURCE5} %{buildroot}%{_bindir}/cabal-tweak-flag install -p -D -m 0755 %{SOURCE11} %{buildroot}%{_bindir}/cabal-tweak-drop-dep install -p -D -m 0755 %{SOURCE12} %{buildroot}%{_bindir}/cabal-tweak-remove-upperbound install -p -D -m 0755 %{SOURCE8} %{buildroot}%{_prefix}/lib/rpm/ghc-pkg-wrapper %if 0%{?fedora} < 37 mkdir -p %{buildroot}%{_docdir}/ghc/html/libraries %endif %files %license COPYING %doc AUTHORS %{macros_dir}/macros.ghc %{macros_dir}/macros.ghc-os %if 0%{?fedora} || 0%{?rhel} >= 7 %{_prefix}/lib/rpm/fileattrs/ghc.attr %endif %{_prefix}/lib/rpm/ghc-deps.sh %{_prefix}/lib/rpm/ghc-pkg-wrapper %{_bindir}/cabal-tweak-dep-ver %{_bindir}/cabal-tweak-drop-dep %{_bindir}/cabal-tweak-flag %{_bindir}/cabal-tweak-remove-upperbound %{_datadir}/%{name}/Setup.hs %files extra %{macros_dir}/macros.ghc-extra %if 0%{?fedora} < 37 %files -n ghc-filesystem %dir %{_docdir}/ghc # %%{ghc_html_dir} %dir %{_docdir}/ghc/html # %%{ghc_html_libraries_dir} %dir %{_docdir}/ghc/html/libraries %endif %if 0%{?fedora} >= 29 %files -n ghc-obsoletes %endif