summaryrefslogtreecommitdiff
path: root/hunspell-en/Pkgfile
blob: 82668a3e84ae221be9e0ff824b679777dfb79a54 (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=2017.01.22
    8 release=2
    9 source=(
   10 http://downloads.sourceforge.net/wordlist/speller/$version/hunspell-en_AU-$version.zip
   11 http://downloads.sourceforge.net/wordlist/speller/$version/hunspell-en_US-$version.zip
   12 http://downloads.sourceforge.net/wordlist/speller/$version/hunspell-en_CA-$version.zip
   13 http://downloads.sourceforge.net/wordlist/speller/$version/hunspell-en_GB-ise-$version.zip
   14 )
   15 
   16 build() {
   17 	declare -A missing
   18 	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"
   19 	missing[en_US]="en_PH"
   20 
   21 	mkdir -p $PKG/usr/share/hunspell
   22 
   23 	cp $SRC/*.aff $SRC/*.dic $PKG/usr/share/hunspell/
   24 	mv $PKG/usr/share/hunspell/{en_GB-ise.aff,en_GB.aff}
   25 	mv $PKG/usr/share/hunspell/{en_GB-ise.dic,en_GB.dic}
   26 
   27 	# Replace duplicate files with symbolic links
   28 	pushd $PKG/usr/share/hunspell
   29 	(md5sum * | sort | uniq --repeated -w 32 --all-repeated=separate; echo) | \
   30 	while read sum name; do
   31 		if [ -n "$name" ]; then
   32 			[ -z "$dups" ] && declare -A dups
   33 			dups[${#dups[*]}]=$name
   34 		else
   35 			for name in ${dups[@]}; do
   36 				[ $name != ${dups[0]} ] && ln -s -f ${dups[0]} $name
   37 			done
   38 			unset dups
   39 		fi
   40 	done
   41 	popd
   42 
   43 	# Create symbolic links for missing dictionaries
   44 	pushd $PKG/usr/share/hunspell
   45 	for lang in ${!missing[@]}; do
   46 		for new in ${missing[$lang]}; do
   47 			ln -s $lang.aff $new.aff
   48 			ln -s $lang.dic $new.dic
   49 		done
   50 	done
   51 	popd
   52 }

Generated by cgit