#!/bin/bash # DOWNLOAD='no' when testing this script or spec.in DOWNLOAD='yes' GIT_DIR='dictionaries' VERBOSE='yes' DATADIR="/usr/share" DOCDIR="/usr/share/doc/packages" DIC_DIR="hunspell" HYPH_DIR="hyphen" TH_DIR="mythes" COMPAT_DIR="myspell" LO_DIR="%{_libdir}/libreoffice" LODATA_DIR="$LO_DIR/share" LOEXT_DIR="$LODATA_DIR/extensions" declare -A provides_map=( ["myspell-af_ZA"]="myspell-african" ["myspell-ar"]="myspell-arabic" ["myspell-be_BY"]="myspell-belarusian" ["myspell-bg_BG"]="myspell-bulgarian libreoffice-thesaurus-bg" ["myspell-bn_BD"]="myspell-bengali" ["myspell-br_FR"]="myspell-breton" ["myspell-ca"]="myspell-catalan libreoffice-thesaurus-ca" ["myspell-ca_ES_valencia"]="myspell-valencian" ["myspell-cs_CZ"]="myspell-czech libreoffice-thesaurus-cs" ["myspell-da_DK"]="myspell-danish libreoffice-thesaurus-da" ["myspell-de_DE"]="myspell-german" ["myspell-de_AT"]="myspell-austrian" ["myspell-de_CH"]="myspell-nswiss" ["myspell-el_GR"]="myspell-greek libreoffice-thesaurus-el" ["myspell-en_US"]="myspell-american libreoffice-thesaurus-US" ["myspell-en_GB"]="myspell-british libreoffice-thesaurus-en-GB" ["myspell-en_ZA"]="myspell-south-african-english" ["myspell-en_AU"]="myspell-australian libreoffice-thesaurus-en-AU" ["myspell-en_NZ"]="myspell-new-zaeland" ["myspell-en_CA"]="myspell-canadian" ["myspell-es_UY"]="myspell-spanish-uruguayan" ["myspell-es_HN"]="myspell-spanish-honduran" ["myspell-es_GT"]="myspell-spanish-guatemalan" ["myspell-es_CO"]="myspell-spanish-colombian" ["myspell-es_CL"]="myspell-spanish-chilean" ["myspell-es_VE"]="myspell-spanish-venezuelan" ["myspell-es_CR"]="myspell-spanish-costa-rican" ["myspell-es_BO"]="myspell-spanish-bolivian" ["myspell-es_MX"]="myspell-mexican" ["myspell-es_SV"]="myspell-spanish-salvadorean" ["myspell-es_PA"]="myspell-spanish-panamanian" ["myspell-es_PE"]="myspell-spanish-peruvian" ["myspell-es_EC"]="myspell-spanish-ecuadorian" ["myspell-es_DO"]="myspell-spanish-dominican" ["myspell-es_PR"]="myspell-spanish-puerto-rican" ["myspell-es_AR"]="myspell-spanish-argentine" ["myspell-es_NI"]="myspell-spanish-nicaraguan" ["myspell-es_PY"]="myspell-spanish-paraguayan" ["myspell-es_ES"]="myspell-spanish" ["myspell-et_EE"]="myspell-estonian" ["myspell-fr_FR"]="myspell-french libreoffice-thesaurus-fr" ["myspell-gd_GB"]="myspell-gaelic" ["myspell-gl"]="myspell-galician" ["myspell-gu_IN"]="myspell-gujarati" ["myspell-he_IL"]="myspell-hebrew" ["myspell-hi_IN"]="myspell-hindi" ["myspell-hr_HR"]="myspell-croatian" ["myspell-hu_HU"]="myspell-hungarian libreoffice-thesaurus-hu" ["myspell-is"]="myspell-icelandic" ["myspell-it_IT"]="myspell-italian libreoffice-thesaurus-it" ["myspell-lt_LT"]="myspell-lithuanian" ["myspell-lv_LV"]="myspell-latvian" ["myspell-nl_NL"]="myspell-dutch" ["myspell-nb_NO"]="myspell-norsk-bokmaal" ["myspell-nn_NO"]="myspell-norsk-nynorsk" ["myspell-oc_FR"]="myspell-occitan-lengadocian" ["myspell-pl_PL"]="myspell-polish libreoffice-thesaurus-pl" ["myspell-pt_BR"]="myspell-brazilian libreoffice-thesaurus-pt" ["myspell-pt_PT"]="myspell-portuguese" ["myspell-ro"]="myspell-romanian libreoffice-thesaurus-ro" ["myspell-ru_RU"]="myspell-russian libreoffice-thesaurus-ru" ["myspell-si_LK"]="myspell-sinhala" ["myspell-sk_SK"]="myspell-slovak libreoffice-thesaurus-sk" ["myspell-sl_SI"]="myspell-slovene libreoffice-thesaurus-sl" ["myspell-sr"]="myspell-serbian-latin myspell-serbian-cyrillic" ["myspell-sv_SE"]="myspell-swedish libreoffice-thesaurus-sv" ["myspell-sw_TZ"]="myspell-kiswahili" ["myspell-th_TH"]="myspell-thai" ["myspell-uk_UA"]="myspell-ukrainian" ["myspell-vi"]="myspell-vietnamese" ["myspell-zu_ZA"]="myspell-zulu" ) declare -A recommends_map=( ["myspell-de"]="myspell-de_DE" ["myspell-en"]="myspell-en_US" ["myspell-es"]="myspell-es_ES" ["myspell-ro"]="myspell-ro_RO" ["myspell-no"]="myspell-nb_NO" ["myspell-vi"]="myspell-vi_VN" ) # directories under $GIT_DIR, which holds dictionaries function directories() { ls $GIT_DIR/*/dictionaries.xcu | sed -e 's:dictionaries/::' -e 's:/dictionaries.xcu::' | tr '\n' ' ' } # create central mapping dir <-> locales <-> files function locale_to_file_map() { cd $GIT_DIR rm -f locale_to_file_map.txt for dir in $dirs; do cat $dir/dictionaries.xcu \ | grep -v '