From 09babb9078789004d270e8b7369279cdad64fd73 Mon Sep 17 00:00:00 2001 From: vishalvvr Date: Fri, 21 Jan 2022 17:21:19 +0530 Subject: [PATCH] update default dictionary install path - rename install dir name from myspell to hunspell - create symlink myspell for better backward compatibility - https://fedoraproject.org/wiki/Changes/Hunspell_dictionary_dir_change --- hunspell.spec | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/hunspell.spec b/hunspell.spec index 0e7a1e6..b40cf2b 100644 --- a/hunspell.spec +++ b/hunspell.spec @@ -3,7 +3,7 @@ Name: hunspell Summary: A spell checker and morphological analyzer library Version: 1.7.0 -Release: 12%{?dist} +Release: 13%{?dist} Source: https://github.com/hunspell/hunspell/archive/v%{version}.tar.gz URL: https://github.com/hunspell/hunspell License: LGPLv2+ or GPLv2+ or MPLv1.1 @@ -18,7 +18,7 @@ BuildRequires: words %endif BuildRequires: make Requires: hunspell-en-US -Requires: hunspell-filesystem +Requires: hunspell-filesystem = %{version}-%{release} Patch0: 0001-invalid-read-memory-access-624.patch @@ -92,11 +92,30 @@ rm -rf $RPM_BUILD_ROOT %make_install rm -f $RPM_BUILD_ROOT/%{_libdir}/*.a rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la +%if 0%{?fedora} > 35 +mkdir $RPM_BUILD_ROOT/%{_datadir}/hunspell +%else mkdir $RPM_BUILD_ROOT/%{_datadir}/myspell +%endif %find_lang %{name} %ldconfig_scriptlets +%if 0%{?fedora} > 35 +%pretrans -p +-- Rename dir from myspell to hunspell +-- DO NOT add a trailing slash at the end. +old_path = "/usr/share/myspell" +new_path = "/usr/share/hunspell" +st = posix.stat(old_path) +if st and st.type == "directory" then + status = os.rename(old_path, new_path) +end + +%post +%__ln_s %{_datadir}/hunspell %{_datadir}/myspell +%endif + %files -f %{name}.lang %doc README COPYING COPYING.LESSER COPYING.MPL AUTHORS license.hunspell license.myspell THANKS %{_libdir}/*.so.* @@ -125,9 +144,18 @@ mkdir $RPM_BUILD_ROOT/%{_datadir}/myspell %{_mandir}/man5/hunspell.5.gz %files filesystem +%if 0%{?fedora} > 35 +%ghost %{_datadir}/myspell +%{_datadir}/hunspell +%else %{_datadir}/myspell +%endif %changelog +* Fri Jan 21 2022 Vishal Vijayraghavan - 1.7.0-13 +- Rename install dir from myspell to hunspell & create symlink myspell +- https://fedoraproject.org/wiki/Changes/Hunspell_dictionary_dir_change + * Thu Jan 20 2022 Fedora Release Engineering - 1.7.0-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild