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

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

diff --git a/hunspell-wa.spec b/hunspell-wa.spec
index 515e1d1..867a5eb 100644
--- a/hunspell-wa.spec
+++ b/hunspell-wa.spec
@@ -1,7 +1,13 @@
+%if 0%{?fedora} >= 36 || 0%{?rhel} > 9
+%global dict_dirname hunspell
+%else
+%global dict_dirname myspell
+%endif
+
 Name: hunspell-wa
 Summary: Walloon hunspell dictionaries
 Version: 0.4.17
-Release: 17%{?dist}
+Release: 18%{?dist}
 Source0: http://chanae.walon.org/walon/aspell-wa-%{version}.tar.bz2
 URL: http://chanae.walon.org/walon/aspell.php
 License: LGPLv2+
@@ -10,7 +16,7 @@ Patch0: hunspell-wa-0.4.15-buildfix.patch
 
 BuildRequires: make
 
-Requires: hunspell
+Requires: hunspell-filesystem
 Supplements: (hunspell and langpacks-wa)
 
 %description
@@ -34,16 +40,20 @@ for i in TODO README; do
 done
 
 %install
-mkdir -p $RPM_BUILD_ROOT/%{_datadir}/myspell
-cp -p wa.dic $RPM_BUILD_ROOT/%{_datadir}/myspell/wa_BE.dic
-cp -p wa.aff $RPM_BUILD_ROOT/%{_datadir}/myspell/wa_BE.aff
+mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{dict_dirname}
+cp -p wa.dic $RPM_BUILD_ROOT/%{_datadir}/%{dict_dirname}/wa_BE.dic
+cp -p wa.aff $RPM_BUILD_ROOT/%{_datadir}/%{dict_dirname}/wa_BE.aff
 
 
 %files
 %doc README LGPL ChangeLog TODO
-%{_datadir}/myspell/*
+%{_datadir}/%{dict_dirname}/*
 
 %changelog
+* Tue Mar 22 2022 Parag Nemade <pnemade AT redhat DOT com> - 0.4.17-18
+- Add conditional for new hunspell dir path and update to Requires:
+  hunspell-filesystem
+
 * Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.17-17
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild