blob: 73102d2bb437a40968bd7c4bf19e0bd95a0526e3 (
plain)
1 # Description: Hunspell dictionary for English
2 # URL: http://wordlist.sourceforge.net/
3 # Maintainer: Alan Mizrahi, alan at mizrahi dot com dot ve
4 # Depends on: hunspell
5
6 name=hunspell-en
7 version=7.1
8 release=1
9 source=(
10 http://downloads.sourceforge.net/wordlist/hunspell-en_US-$version-0.zip
11 http://downloads.sourceforge.net/wordlist/hunspell-en_CA-$version-0.zip
12 http://en-gb.pyxidium.co.uk/dictionary/en_GB.zip
13 )
14
15 build() {
16 declare -A missing
17 missing[en_GB]="en_AG en_AU en_BS en_BW en_BZ en_DK en_GH en_HK en_IE en_IN en_JM en_NA en_NG en_NZ en_SG en_TT en_ZA en_ZW"
18 missing[en_US]="en_PH"
19
20 mkdir -p $PKG/usr/share/hunspell
21
22 cp $SRC/*.aff $SRC/*.dic $PKG/usr/share/hunspell/
23
24 # Replace duplicate files with symbolic links
25 pushd $PKG/usr/share/hunspell
26 (md5sum * | sort | uniq --repeated -w 32 --all-repeated=separate; echo) | \
27 while read sum name; do
28 if [ -n "$name" ]; then
29 [ -z "$dups" ] && declare -A dups
30 dups[${#dups[*]}]=$name
31 else
32 for name in ${dups[@]}; do
33 [ $name != ${dups[0]} ] && ln -s -f ${dups[0]} $name
34 done
35 unset dups
36 fi
37 done
38 popd
39
40 # Create symbolic links for missing dictionaries
41 pushd $PKG/usr/share/hunspell
42 for lang in ${!missing[@]}; do
43 echo "source language is $lang"
44 for new in ${missing[$lang]}; do
45 echo "new language is $new"
46 ln -s $lang.aff $new.aff
47 ln -s $lang.dic $new.dic
48 done
49 done
50 popd
51 }
|