diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index 6bcbfa4..607aaec 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ /igerman98-20131206.tar.bz2 /igerman98-20151222.tar.bz2 /igerman98-20160407.tar.bz2 +/igerman98-20161207.tar.bz2 +/dict-de-20240224.tar.xz diff --git a/hunspell-de.spec b/hunspell-de.spec index fa81a72..5ba0513 100644 --- a/hunspell-de.spec +++ b/hunspell-de.spec @@ -1,64 +1,119 @@ -Name: hunspell-de -Summary: German hunspell dictionaries -%global upstreamid 20160407 -Version: 0.%{upstreamid} -Release: 3%{?dist} -Source: https://www.j3e.de/ispell/igerman98/dict/igerman98-%{upstreamid}.tar.bz2 -URL: https://www.j3e.de/ispell/igerman98 -License: GPLv2 or GPLv3 -BuildArch: noarch -BuildRequires: aspell, hunspell, perl-interpreter +Name: hunspell-de +Summary: German hunspell dictionaries +Version: 20240224 +Release: 4%{?dist} -Requires: hunspell +License: GPL-2.0-only OR GPL-3.0-only +URL: https://cgit.freedesktop.org/libreoffice/dictionaries/tree/de +# ./make_source.sh +Source0: dict-de-%{version}.tar.xz +BuildArch: noarch + +Requires: hunspell-filesystem Supplements: (hunspell and langpacks-de) %description German (Germany, Switzerland, etc.) hunspell dictionaries. %prep -%setup -q -n igerman98-%{upstreamid} -sed -i -e "s/AFFIX_EXPANDER = ispell/AFFIX_EXPANDER = aspell/g" Makefile +%autosetup -p1 -n dict-de-%{version} + %build -LC_ALL=C make hunspell/de_AT.dic hunspell/de_AT.aff \ - hunspell/de_CH.dic hunspell/de_CH.aff \ - hunspell/de_DE.dic hunspell/de_DE.aff -cd hunspell -for i in README_*.txt; do - if ! iconv -f utf-8 -t utf-8 -o /dev/null $i > /dev/null 2>&1; then - iconv -f ISO-8859-1 -t UTF-8 $i > $i.new - touch -r $i $i.new - mv -f $i.new $i - fi - tr -d '\r' < $i > $i.new - touch -r $i $i.new - mv -f $i.new $i -done +# Nothing to build + %install -mkdir -p $RPM_BUILD_ROOT/%{_datadir}/myspell -cd hunspell -cp -p de_??.dic de_??.aff $RPM_BUILD_ROOT/%{_datadir}/myspell +mkdir -p %{buildroot}%{_datadir}/hunspell -pushd $RPM_BUILD_ROOT/%{_datadir}/myspell/ -de_DE_aliases="de_BE de_LU" -for lang in $de_DE_aliases; do - ln -s de_DE.aff $lang.aff - ln -s de_DE.dic $lang.dic -done -de_CH_aliases="de_LI" -for lang in $de_CH_aliases; do - ln -s de_CH.aff $lang.aff - ln -s de_CH.dic $lang.dic -done -popd +install -pm 0644 de_AT_frami.aff %{buildroot}%{_datadir}/hunspell/de_AT.aff +install -pm 0644 de_AT_frami.dic %{buildroot}%{_datadir}/hunspell/de_AT.dic + +install -pm 0644 de_CH_frami.aff %{buildroot}%{_datadir}/hunspell/de_CH.aff +install -pm 0644 de_CH_frami.dic %{buildroot}%{_datadir}/hunspell/de_CH.dic +install -pm 0644 de_DE_frami.aff %{buildroot}%{_datadir}/hunspell/de_LI.aff +install -pm 0644 de_DE_frami.dic %{buildroot}%{_datadir}/hunspell/de_LI.dic + +install -pm 0644 de_DE_frami.aff %{buildroot}%{_datadir}/hunspell/de_DE.aff +install -pm 0644 de_DE_frami.dic %{buildroot}%{_datadir}/hunspell/de_DE.dic +install -pm 0644 de_DE_frami.aff %{buildroot}%{_datadir}/hunspell/de_BE.aff +install -pm 0644 de_DE_frami.dic %{buildroot}%{_datadir}/hunspell/de_BE.dic +install -pm 0644 de_DE_frami.aff %{buildroot}%{_datadir}/hunspell/de_LU.aff +install -pm 0644 de_DE_frami.dic %{buildroot}%{_datadir}/hunspell/de_LU.dic %files -%doc hunspell/README_de_??.txt hunspell/COPYING_GPLv2 hunspell/COPYING_GPLv3 hunspell/Copyright -%{_datadir}/myspell/* +%doc README_de_DE_frami.txt README_extension_owner.txt +%license COPYING_GPLv2 COPYING_GPLv3 +%{_datadir}/hunspell/* + %changelog +* Thu Jul 24 2025 Fedora Release Engineering - 20240224-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Fri Jan 17 2025 Fedora Release Engineering - 20240224-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Thu Jul 18 2024 Fedora Release Engineering - 20240224-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Sat Feb 24 2024 Sandro Mani - 20240224-1 +- Pull dictionaries from libreoffice git + +* Wed Jan 24 2024 Fedora Release Engineering - 20161207-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sat Jan 20 2024 Fedora Release Engineering - 20161207-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Jul 20 2023 Fedora Release Engineering - 20161207-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jan 19 2023 Fedora Release Engineering - 20161207-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jul 21 2022 Fedora Release Engineering - 20161207-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Tue Mar 22 2022 Parag Nemade - 20161207-3 +- Add conditional for new hunspell dir path and update to Requires: + hunspell-filesystem + +* Thu Jan 20 2022 Fedora Release Engineering - 20161207-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Tue Jan 04 2022 Sandro Mani - 20161207-1 +- Modernize spec +- Set an actual version + +* Thu Jul 22 2021 Fedora Release Engineering - 0.20161207-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jan 26 2021 Fedora Release Engineering - 0.20161207-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 0.20161207-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jan 29 2020 Fedora Release Engineering - 0.20161207-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Jul 25 2019 Fedora Release Engineering - 0.20161207-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Feb 01 2019 Fedora Release Engineering - 0.20161207-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 0.20161207-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Feb 27 2018 Michael Stahl - 0.20161207-1 +- Resolves: rhbz#1549640 upgrade to latest release + +* Wed Feb 07 2018 Fedora Release Engineering - 0.20160407-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Wed Jul 26 2017 Fedora Release Engineering - 0.20160407-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild diff --git a/make_source.sh b/make_source.sh new file mode 100755 index 0000000..682a069 --- /dev/null +++ b/make_source.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +datestr=$(date +%Y%m%d) +rm -rf dict-de-$datestr dict-de-$datestr.tar.xz +mkdir dict-de-$datestr +pushd dict-de-$datestr + +wget --content-disposition https://cgit.freedesktop.org/libreoffice/dictionaries/plain/de/COPYING_GPLv2 +wget --content-disposition https://cgit.freedesktop.org/libreoffice/dictionaries/plain/de/COPYING_GPLv3 +wget --content-disposition https://cgit.freedesktop.org/libreoffice/dictionaries/plain/de/README_de_DE_frami.txt +wget --content-disposition https://cgit.freedesktop.org/libreoffice/dictionaries/plain/de/README_extension_owner.txt +wget --content-disposition https://cgit.freedesktop.org/libreoffice/dictionaries/plain/de/de_AT_frami.aff +wget --content-disposition https://cgit.freedesktop.org/libreoffice/dictionaries/plain/de/de_AT_frami.dic +wget --content-disposition https://cgit.freedesktop.org/libreoffice/dictionaries/plain/de/de_CH_frami.aff +wget --content-disposition https://cgit.freedesktop.org/libreoffice/dictionaries/plain/de/de_CH_frami.dic +wget --content-disposition https://cgit.freedesktop.org/libreoffice/dictionaries/plain/de/de_DE_frami.aff +wget --content-disposition https://cgit.freedesktop.org/libreoffice/dictionaries/plain/de/de_DE_frami.dic + +popd + +tar cfJ dict-de-$datestr.tar.xz dict-de-$datestr +rm -rf dict-de-$datestr +echo "Created dict-de-$datestr.tar.xz!" diff --git a/plans/hunspell-de.fmf b/plans/hunspell-de.fmf new file mode 100644 index 0000000..c1627f9 --- /dev/null +++ b/plans/hunspell-de.fmf @@ -0,0 +1,5 @@ +summary: Basic smoke test +discover: + how: fmf +execute: + how: tmt diff --git a/sources b/sources index 25a152e..e86174f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5e5ce15bbfd56a6f89e7789e63fffad0 igerman98-20160407.tar.bz2 +SHA512 (dict-de-20240224.tar.xz) = 5cdfe2b73e600310483863506f10fba0c03c1740c73f89290c5bdc22afc1ff6db4203a86d2b0184ab2753ec0a61978f80a4b553b82605d0496b79e06c9da66a4 diff --git a/tests/test_dic_availability.fmf b/tests/test_dic_availability.fmf new file mode 100644 index 0000000..7c8936a --- /dev/null +++ b/tests/test_dic_availability.fmf @@ -0,0 +1,6 @@ +require: +- python3-enchant +- hunspell-de +test: python3 test_dic_availability.py +framework: shell + diff --git a/tests/test_dic_availability.py b/tests/test_dic_availability.py new file mode 100644 index 0000000..0bd811b --- /dev/null +++ b/tests/test_dic_availability.py @@ -0,0 +1,10 @@ +#!/usr/bin/python3 + +import enchant + +lang = "de_DE" +try: + dic = enchant.request_dict(lang) + print("Dictionary for {0} language is available for use".format(lang)) +except enchant.errors.DictNotFoundError: + print("Dictionary is not installed for use") diff --git a/tests/test_suggest_words.fmf b/tests/test_suggest_words.fmf new file mode 100644 index 0000000..19fee91 --- /dev/null +++ b/tests/test_suggest_words.fmf @@ -0,0 +1,6 @@ +require: +- python3-enchant +- hunspell-de +test: python3 test_suggest_words.py +framework: shell + diff --git a/tests/test_suggest_words.py b/tests/test_suggest_words.py new file mode 100644 index 0000000..eec7655 --- /dev/null +++ b/tests/test_suggest_words.py @@ -0,0 +1,9 @@ +#!/usr/bin/python3 + +import enchant + +wdlst = [ "Hall", "chai", "morge"] +dic = enchant.Dict("de_DE") +for wd in wdlst: + dic.check(wd) + print("input word = {0}, Suggestions => {1}".format(wd, dic.suggest(wd)))