opt/hunspell-es/Pkgfile

43 lines
1.1 KiB
Plaintext
Raw Normal View History

2013-09-28 01:26:14 +02:00
# Description: Hunspell dictionary for Spanish
2017-05-26 07:53:36 +02:00
# URL: https://github.com/sbosio/rla-es/
2013-09-28 01:26:14 +02:00
# Maintainer: Alan Mizrahi, alan at mizrahi dot com dot ve
# Depends on: hunspell
name=hunspell-es
2017-05-26 07:53:36 +02:00
version=2.2
2013-09-28 01:26:14 +02:00
release=1
2017-05-26 07:53:36 +02:00
source=(https://github.com/sbosio/rla-es/archive/v$version.zip)
2013-09-28 01:26:14 +02:00
build() {
2017-05-26 07:53:36 +02:00
cd rla-es-$version
# Generate .oxt files
dicts="$(for i in $(find . -type d -name l10n); do ls $i; done |grep ^es_ |sort |uniq)"
cd $SRC/rla-es-$version/ortograf/herramientas
for dict in $dicts; do
./make_dict.sh -c -l=$dict
done
2013-09-28 01:26:14 +02:00
2017-05-26 07:53:36 +02:00
# Install .aff and .dic files
mkdir -p $PKG/usr/share/hunspell
2013-09-28 01:26:14 +02:00
for i in *.oxt; do
unzip -q -n $i '*.dic' '*.aff' -d $PKG/usr/share/hunspell
done
# Replace duplicate files with symbolic links
2017-05-26 07:53:36 +02:00
cd $PKG/usr/share/hunspell
2013-09-28 01:26:14 +02:00
(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
}