fix dictionary build

This commit is contained in:
Caolan McNamara 2009-04-23 11:14:56 +00:00
parent 40e21eddd9
commit 9851a7e5b3
3 changed files with 32 additions and 21 deletions

View File

@ -1,11 +0,0 @@
--- igerman98-20070829/Makefile.orig 2007-08-30 10:56:38.000000000 +0100
+++ igerman98-20070829/Makefile 2007-08-30 10:57:15.000000000 +0100
@@ -61,7 +61,7 @@
#ZIP_OPTS = -j -r -9 -X
ZIP = 7z
ZIP_OPTS = a -tzip -mx=9
-BUILDHASH = buildhash
+BUILDHASH = true
ISPELL = ispell
HUNSPELL_BIN = hunspell

View File

@ -2,15 +2,15 @@ Name: hunspell-de
Summary: German hunspell dictionaries
%define upstreamid 20090107
Version: 0.%{upstreamid}
Release: 1%{?dist}
Release: 2%{?dist}
Source: http://www.j3e.de/ispell/igerman98/dict/igerman98-%{upstreamid}.tar.bz2
Group: Applications/Text
URL: http://www.j3e.de/ispell/igerman98
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
License: GPLv2 or GPLv3
BuildArch: noarch
BuildRequires: aspell-en, hunspell
Patch1: hunspell-de.nobuildhash.patch
BuildRequires: aspell, hunspell
Patch1: igerman98-20090107-useaspell.patch
Requires: hunspell
@ -19,19 +19,17 @@ German (Germany, Switzerland, etc.) hunspell dictionaries.
%prep
%setup -q -n igerman98-%{upstreamid}
%patch1 -p1 -b .nobuildhash.patch
%patch1 -p1 -b .useaspell.patch
%build
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
tr -d '\r' < README_de_AT.txt > README_de_AT.txt.new
tr -d '\r' < README_de_CH.txt > README_de_CH.txt.new
tr -d '\r' < README_de_DE.txt > README_de_DE.txt.new
mv -f README_de_AT.txt.new README_de_AT.txt
mv -f README_de_CH.txt.new README_de_CH.txt
mv -f README_de_DE.txt.new README_de_DE.txt
for i in README_*.txt; do
iconv -f ISO-8859-1 -t UTF-8 $i > $i.new
tr -d '\r' <$i.new > $i
done
%install
rm -rf $RPM_BUILD_ROOT
@ -61,6 +59,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/myspell/*
%changelog
* Thu Apr 23 2009 Caolan McNamara <caolanm@redhat.com> - 0.20090107-2
- fix dictionaries
* Thu Feb 26 2009 Caolan McNamara <caolanm@redhat.com> - 0.20090107-1
- latest version

View File

@ -0,0 +1,21 @@
diff -ru igerman98-20090107-ispell/Makefile igerman98-20090107/Makefile
--- igerman98-20090107-ispell/Makefile 2009-04-23 11:40:50.000000000 +0100
+++ igerman98-20090107/Makefile 2009-04-23 11:41:48.000000000 +0100
@@ -275,7 +275,7 @@
# sed hack to merge /f/g to /fg : sed "s:/\(.*\)/:/\1:"
cat $$(WORDS_BLACKLISTS_$(1)) $$(WORDS_BLACKLISTS_de_all) >$$@
-hunspell-capmain-plus_$(1).tmp: ispell/$(1)_null.aff ispell/$(1)_null.hash hunspell/$(1)_small.dic hunspell/$(1)_small.aff $$(WORDS_CAPMAIN_PLUS_$(1)) $$(WORDS_CAPMAIN_PLUS_de_all)
+hunspell-capmain-plus_$(1).tmp: aspell/$(1).dat aspell/$(1)_affix.dat hunspell/$(1)_small.dic hunspell/$(1)_small.aff $$(WORDS_CAPMAIN_PLUS_$(1)) $$(WORDS_CAPMAIN_PLUS_de_all)
echo DEBUG: WORDS_CAPMAIN_PLUS_$(1) :: $$(WORDS_CAPMAIN_PLUS_$(1)) :::
echo DEBUG: WORDS_CAPMAIN_PLUS_de_all :: $$(WORDS_CAPMAIN_PLUS_de_all) :::
# limited dictionary of *-xx* files containing compounds not generated by capmain-small
@@ -283,7 +283,7 @@
#find dicts/ -name "*-xx*.txt" -print | xargs cat >> $$@.unfiltered-list.tmp
echo $$(WORDS_CAPMAIN_PLUS_$(1)) $$(WORDS_CAPMAIN_PLUS_de_all) | xargs cat >> $$@.unfiltered-list0.tmp
./bin/myspellfixprefix.pl < $$@.unfiltered-list0.tmp | (test -e ./bin/conv_dict_$(1) && ./bin/conv_dict_$(1) || cat) | grep -v '^$$$$' > $$@.unfiltered-list.tmp
- cat $$@.unfiltered-list.tmp | $(ISPELL) -d./ispell/$(1)_null -e > $$@.unfiltered-list-expanded.tmp
+ cat $$@.unfiltered-list.tmp | $(ASPELL) --lang=$(1) --local-data-dir=./aspell expand > $$@.unfiltered-list-expanded.tmp
$(SED) -f ./bin/dic2iso < $$@.unfiltered-list-expanded.tmp |$(SED) "s/qq//g" | $(NL) | $(HUNSPELL) -d hunspell/$(1)_small -L > $$@.unknown.tmp
$(SED) "s/^ *\([0-9]*\)\t.*$$$$/\1/" $$@.unknown.tmp > $$@.list-unknown-lines.tmp
./bin/extractlines.pl $$@.list-unknown-lines.tmp $$@.unfiltered-list.tmp > $$@.tmp