opt/hunspell-en/Pkgfile

51 lines
1.6 KiB
Plaintext
Raw Normal View History

2021-01-29 14:05:06 +01:00
# Description: Hunspell dictionary for English
# URL: http://wordlist.aspell.net/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: hunspell
2013-09-28 01:26:00 +02:00
name=hunspell-en
2021-01-27 23:13:25 +01:00
version=2020.12.07
2019-12-30 14:09:31 +01:00
release=1
2021-01-29 14:05:06 +01:00
source=(http://downloads.sourceforge.net/wordlist/speller/$version/hunspell-en_AU-$version.zip
http://downloads.sourceforge.net/wordlist/speller/$version/hunspell-en_US-$version.zip
http://downloads.sourceforge.net/wordlist/speller/$version/hunspell-en_CA-$version.zip
http://downloads.sourceforge.net/wordlist/speller/$version/hunspell-en_GB-ise-$version.zip)
2013-09-28 01:26:00 +02:00
build() {
2021-01-29 14:05:06 +01:00
declare -A missing
missing[en_GB]="en_AG 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"
missing[en_US]="en_PH"
2013-09-28 01:26:00 +02:00
2021-01-29 14:05:06 +01:00
mkdir -p $PKG/usr/share/hunspell
2013-09-28 01:26:00 +02:00
2021-01-29 14:05:06 +01:00
cp $SRC/*.aff $SRC/*.dic $PKG/usr/share/hunspell/
mv $PKG/usr/share/hunspell/{en_GB-ise.aff,en_GB.aff}
mv $PKG/usr/share/hunspell/{en_GB-ise.dic,en_GB.dic}
2013-09-28 01:26:00 +02:00
2021-01-29 14:05:06 +01:00
# Replace duplicate files with symbolic links
pushd $PKG/usr/share/hunspell
(md5sum * | sort | uniq --repeated -w 32 --all-repeated=separate; echo) | \
while read sum name; do
if [ -n "$name" ]; then
[ -z "$dups" ] && declare -A dups
dups[${#dups[*]}]=$name
else
for name in ${dups[@]}; do
[ $name != ${dups[0]} ] && ln -s -f ${dups[0]} $name
done
unset dups
fi
done
popd
2013-09-28 01:26:00 +02:00
2021-01-29 14:05:06 +01:00
# Create symbolic links for missing dictionaries
pushd $PKG/usr/share/hunspell
for lang in ${!missing[@]}; do
for new in ${missing[$lang]}; do
ln -s $lang.aff $new.aff
ln -s $lang.dic $new.dic
done
done
popd
2013-09-28 01:26:00 +02:00
}