From deaef22e32ece26f5d86073629e98b993bae398f Mon Sep 17 00:00:00 2001
From: Parag Nemade <pnemade@fedoraproject.org>
Date: Tue, 22 Mar 2022 11:59:27 +0530
Subject: [PATCH] Add conditional for new hunspell dir path and update to
 Requires: hunspell-filesystem

---
 hunspell-haw.spec | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/hunspell-haw.spec b/hunspell-haw.spec
index 6a72f76..56770f3 100644
--- a/hunspell-haw.spec
+++ b/hunspell-haw.spec
@@ -1,12 +1,18 @@
+%if 0%{?fedora} >= 36 || 0%{?rhel} > 9
+%global dict_dirname hunspell
+%else
+%global dict_dirname myspell
+%endif
+
 Name: hunspell-haw
 Summary: Hawaiian hunspell dictionaries
 Version: 0.03
-Release: 9%{?dist}
+Release: 10%{?dist}
 Source: https://addons.mozilla.org/firefox/downloads/file/248540/hawaiian_spell_checker-%{version}-tb+fx+fn+sm.xpi
 URL: http://borel.slu.edu/crubadan/
 License: GPLv2+
 BuildArch: noarch
-Requires: hunspell
+Requires: hunspell-filesystem
 Supplements: (hunspell and langpacks-haw)
 
 %description
@@ -18,16 +24,20 @@ Hawaiian hunspell dictionaries.
 %build
 
 %install
-mkdir -p $RPM_BUILD_ROOT/%{_datadir}/myspell
-cp -p dictionaries/haw-US.aff $RPM_BUILD_ROOT/%{_datadir}/myspell/haw.aff
-cp -p dictionaries/haw-US.dic $RPM_BUILD_ROOT/%{_datadir}/myspell/haw.dic
+mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{dict_dirname}
+cp -p dictionaries/haw-US.aff $RPM_BUILD_ROOT/%{_datadir}/%{dict_dirname}/haw.aff
+cp -p dictionaries/haw-US.dic $RPM_BUILD_ROOT/%{_datadir}/%{dict_dirname}/haw.dic
 
 
 %files
 %doc dictionaries/README_haw_US.txt
-%{_datadir}/myspell/*
+%{_datadir}/%{dict_dirname}/*
 
 %changelog
+* Tue Mar 22 2022 Parag Nemade <pnemade AT redhat DOT com> - 0.03-10
+- Add conditional for new hunspell dir path and update to Requires:
+  hunspell-filesystem
+
 * Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.03-9
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild