From f8ff148f186be20b2abda68c7b4e290ebe549fc5 Mon Sep 17 00:00:00 2001
From: Jens Petersen <petersen@redhat.com>
Date: Sun, 19 Dec 2021 15:01:25 +0800
Subject: [PATCH] Hadrian haddock dirs are not versioned

---
 ghc-rpm-macros.spec | 5 ++++-
 macros.ghc          | 5 +++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec
index b94d01d..99115e9 100644
--- a/ghc-rpm-macros.spec
+++ b/ghc-rpm-macros.spec
@@ -7,7 +7,7 @@
 %endif
 
 Name:           ghc-rpm-macros
-Version:        2.3.4
+Version:        2.3.5
 Release:        1%{?dist}
 Summary:        RPM macros for building Haskell packages for GHC
 
@@ -184,6 +184,9 @@ EOF
 
 
 %changelog
+* Sun Dec 19 2021 Jens Petersen <petersen@redhat.com> - 2.3.5-1
+- Hadrian haddock dirs are not versioned
+
 * Sun Dec 19 2021 Jens Petersen <petersen@redhat.com> - 2.3.4-1
 - move Cabal_arch into ghclibplatform macro
 
diff --git a/macros.ghc b/macros.ghc
index 03ab170..982c208 100644
--- a/macros.ghc
+++ b/macros.ghc
@@ -101,8 +101,9 @@ touch %{basepkg}-devel.files %{basepkg}-prof.files\
 fi\
 ls %{buildroot}%{ghcliblib}/package.conf.d/%{pkgnamever}*.conf >> %{basepkg}-devel.files\
 %if %{with haddock}\
-if [ -d %{buildroot}%{ghc_html_libraries_dir}/%{pkgnamever} ]; then\
-echo %{ghc_html_libraries_dir}/%{pkgnamever} >> %{basepkg}-doc.files\
+haddock_dir=%{ghc_html_libraries_dir}/%{?with_hadrian:%pkgname}%{!?with_hadrian:%pkgnamever}\
+if [ -d %{buildroot}$haddock_dir ]; then\
+echo $haddock_dir >> %{basepkg}-doc.files\
 fi\
 %endif\
 for i in %{basepkg}.files %{basepkg}-devel.files %{basepkg}-doc.files %{basepkg}-prof.files; do\