%global debug_package %{nil} %if 0%{?fedora} || 0%{?rhel} >= 7 %global macros_dir %{_rpmconfigdir}/macros.d %else %global macros_dir %{_sysconfdir}/rpm %endif Name: ghc-rpm-macros Version: 2.7.1 Release: 1%{?dist} Summary: RPM macros for building Haskell packages for GHC License: GPL-3.0-or-later # 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 Source13: ghc-info.sh Source14: macros.ghc-srpm-quick 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. %package quick Summary: Disables building of ghc prof and doc subpackages Requires: %{name} = %{version}-%{release} # added during F40 cycle Obsoletes: %{name}-no-prof < %{version}-%{release} Provides: %{name}-no-prof = %{version}-%{release} %description quick Overrides ghc-srpm-macros to disable building ghc prof and doc subpackages locally. This should not be used in official Fedora builds. %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} >= 38 Obsoletes: ghc-bytestring-show < 0.3.5.7 Obsoletes: ghc-bytestring-show-devel < 0.3.5.7 Obsoletes: ghc-bytestring-show-doc < 0.3.5.7 Obsoletes: ghc-bytestring-show-prof < 0.3.5.7 Obsoletes: ghc-djinn-ghc < 0.1 Obsoletes: ghc-djinn-ghc-devel < 0.1 Obsoletes: ghc-djinn-ghc-doc < 0.1 Obsoletes: ghc-djinn-ghc-prof < 0.1 Obsoletes: ghc-ghc-mtl < 1.2.2 Obsoletes: ghc-ghc-mtl-devel < 1.2.2 Obsoletes: ghc-ghc-mtl-doc < 1.2.2 Obsoletes: ghc-ghc-mtl-prof < 1.2.2 Obsoletes: ghc-ghc-syb-utils < 0.3.1 Obsoletes: ghc-ghc-syb-utils-devel < 0.3.1 Obsoletes: ghc-ghc-syb-utils-doc < 0.3.1 Obsoletes: ghc-ghc-syb-utils-prof < 0.3.1 Obsoletes: ghc-cabal-helper < 1.2 Obsoletes: ghc-cabal-helper-devel < 1.2 Obsoletes: ghc-cabal-helper-doc < 1.2 Obsoletes: ghc-cabal-helper-prof < 1.2 Obsoletes: ghc-cabal-plan < 0.8 Obsoletes: ghc-cabal-plan-devel < 0.8 Obsoletes: ghc-cabal-plan-doc < 0.8 Obsoletes: ghc-cabal-plan-prof < 0.8 Obsoletes: ghc-optics-core < 0.4 Obsoletes: ghc-optics-core-devel < 0.4 Obsoletes: ghc-optics-core-doc < 0.4 Obsoletes: ghc-optics-core-prof < 0.4 Obsoletes: ghc-semialign < 1.2 Obsoletes: ghc-semialign-devel < 1.2 Obsoletes: ghc-semialign-doc < 1.2 Obsoletes: ghc-semialign-prof < 1.2 Obsoletes: ghc-topograph < 1.0.0.2 Obsoletes: ghc-topograph-devel < 1.0.0.2 Obsoletes: ghc-topograph-doc < 1.0.0.2 Obsoletes: ghc-topograph-prof < 1.0.0.2 Obsoletes: ghc-indexed-profunctors < 0.1.1-18 Obsoletes: ghc-indexed-profunctors-devel < 0.1.1-18 Obsoletes: ghc-indexed-profunctors-doc < 0.1.1-18 Obsoletes: ghc-indexed-profunctors-prof < 0.1.1-18 Obsoletes: ghc-regex-compat-tdfa < 0.95.1.4-38 Obsoletes: ghc-regex-compat-tdfa-devel < 0.95.1.4-38 Obsoletes: ghc-regex-compat-tdfa-doc < 0.95.1.4-38 Obsoletes: ghc-regex-compat-tdfa-prof < 0.95.1.4-38 %endif %if 0%{?fedora} >= 39 Obsoletes: ghc-geniplate-mirror < 0.7.9-39 Obsoletes: ghc-geniplate-mirror-devel < 0.95.1.4-38 Obsoletes: ghc-geniplate-mirror-doc < 0.95.1.4-38 Obsoletes: ghc-geniplate-mirror-prof < 0.95.1.4-38 Obsoletes: ghc-data-array-byte < 0.1.0.1-3 Obsoletes: ghc-data-array-byte-doc < 0.1.0.1-3 Obsoletes: ghc-data-array-byte-prof < 0.1.0.1-3 %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 %{nil} %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 install -p -D -m 0644 %{SOURCE14} %{buildroot}%{macros_dir}/macros.ghc-srpm-quick %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 install -p -D -m 0755 %{SOURCE13} %{buildroot}%{_prefix}/lib/rpm/ghc-info.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-info.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 %files quick %{macros_dir}/macros.ghc-srpm-quick %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} %files -n ghc-obsoletes %endif