commit myspell-dictionaries for openSUSE:Factory

Hello community, here is the log from the commit of package myspell-dictionaries for openSUSE:Factory checked in at 2014-05-02 13:53:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/myspell-dictionaries (Old) and /work/SRC/openSUSE:Factory/.myspell-dictionaries.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "myspell-dictionaries" Changes: -------- --- /work/SRC/openSUSE:Factory/myspell-dictionaries/myspell-dictionaries.changes 2014-01-03 19:47:12.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.myspell-dictionaries.new/myspell-dictionaries.changes 2014-05-02 13:53:43.000000000 +0200 @@ -1,0 +2,30 @@ +Mon Apr 28 14:48:48 UTC 2014 - pgajdos@suse.com + +- myspell-de provides myspell-austrian, myspell-german and + myspell-nswiss (removed subpackages from igerman98 source + package) + +------------------------------------------------------------------- +Thu Apr 24 11:38:16 UTC 2014 - pgajdos@suse.cz + +- obsolete libreoffice-hyphen +- obsolete/provide libreoffice-thesaurus-* + +------------------------------------------------------------------- +Tue Apr 22 11:12:27 UTC 2014 - pgajdos@suse.com + +- do not provide locale(OpenOffice_org:*) [bnc#806250#c21] + +------------------------------------------------------------------- +Tue Apr 22 10:59:45 UTC 2014 - pgajdos@suse.com + +- subpackages Provides old names + +------------------------------------------------------------------- +Fri Apr 18 07:37:32 UTC 2014 - pgajdos@suse.com + +- package reworked, using data and layout from + http://cgit.freedesktop.org/libreoffice/dictionaries/ + [bnc#806250] + +------------------------------------------------------------------- Old: ---- Diccionarios-Argentina_1.oxt Icelandic-dict-2009-08-23.oxt Korean_spell-checker-0.4.3_OOo.oxt Nwordlist.tgz SBBIC-spellingchecker-OOo.1.3.oxt as_IN.oxt asturianu.oxt avl.oxt catalan.oxt corrector_OOo3.oxt cy_GB.tar.bz2 dic-fur.oxt dicc-es_CR-0.4.oxt dict-af.oxt dict-ar.oxt dict-be-0.26.oxt dict-bn.oxt dict-br_0.3.oxt dict-cop_EG_v03.oxt dict-cs-2.0.oxt dict-da-current.oxt dict-de_AT-frami_2010-03-07.oxt dict-de_CH-frami_2010-03-07.oxt dict-de_DE-frami_2010-03-07.oxt dict-en-nz-2008-12-03.oxt dict-es_VE.oxt dict-et.oxt dict-gu.oxt dict-hi.oxt dict-hu.oxt dict-it.oxt dict-kk.oxt dict-la_2010-08-23.oxt dict-lt.oxt dict-mr.oxt dict-nr_ZA-2009.10.30.oxt dict-ro.1.3-cedilla.oxt dict-sk.oxt dict-sq.oxt dict-sr.oxt dict-ss_ZA-2009.10.30.oxt dict-uk_UA-1.6.0.oxt dict-ve_ZA-2009.10.30.oxt dict-xh_ZA-2009.10.30.oxt dict-zu_ZA-2009.12.10.oxt dict_ru_RU-0.3.4.oxt dictionaries-bg.oxt el_gr_v110.oxt en_AU.tar.bz2 en_CA.tar.bz2 en_GB.tar.bz2 en_US.tar.bz2 en_ZA.tar.bz2 es_BO.tar.bz2 es_CL.tar.bz2 es_CO.tar.bz2 es_DO.tar.bz2 es_EC.tar.bz2 es_ES.tar.bz2 es_GT.tar.bz2 es_HN.tar.bz2 es_MX.oxt es_NI.tar.bz2 es_PA.tar.bz2 es_PE.tar.bz2 es_PR.tar.bz2 es_PY.tar.bz2 es_SV.tar.bz2 es_UY.tar.bz2 esperantilo.oxt fa_IR.tar.bz2 fo_FO.tar.bz2 focloiri-gaeilge-4.4.oxt gd_GB.oxt he-IL-dict.oxt hr_HR.tar.bz2 hu_HU.tar.bz2 hunspell-chichewa-ny-dict-0.01.oxt hunspell-ht-0.06.oxt hy_AM-0.20.0.oxt id_ID.tar.bz2 jidysz.net.ooo.spellchecker.oxt kik_KE.oxt lower_sorbian_spelling_dictionary-1.4.2.oxt lv_LV-0.9.0.oxt mai_IN.oxt mg_MG.tar.bz2 mk_MK.tar.bz2 ml_IN_dict-1-1.oxt ms_MY.tar.bz2 myspell-dictionaries-gen-spec myspell-dictionaries.data myspell-tn_ZA-20060123.tar.bz2 nb_NO.tar.bz2 nl-dict.oxt nn_NO.tar.bz2 oc_fr.oxt oo3x-pt-pt-12.7.1.1.oxt ooo-dictionnaire-fr-reforme1990-v3.8.oxt ooo_swedish_dict_1.42.oxt ooo_swedish_finland_dict_1.42.oxt pack-sl.oxt papakupu-mi_NZ-0.5.20080630.oxt pl_PL.zip qu_EC.oxt rastnivis.oxt rw.oxt si_LK.oxt st_ZA.tar.bz2 sw_KE.tar.bz2 th_TH.tar.bz2 tl_PH.tar.bz2 ts_ZA.tar.bz2 vero_pt_br_v211aoc.oxt vi_spellchecker_OOo3.oxt New: ---- dictionaries.tar.xz update.sh ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ myspell-dictionaries.spec ++++++ ++++ 3984 lines (skipped) ++++ between /work/SRC/openSUSE:Factory/myspell-dictionaries/myspell-dictionaries.spec ++++ and /work/SRC/openSUSE:Factory/.myspell-dictionaries.new/myspell-dictionaries.spec ++++++ myspell-dictionaries.spec.in ++++++ --- /var/tmp/diff_new_pack.FfQMY1/_old 2014-05-02 13:53:46.000000000 +0200 +++ /var/tmp/diff_new_pack.FfQMY1/_new 2014-05-02 13:53:46.000000000 +0200 @@ -15,26 +15,163 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -@DO_NOT_EDIT_COMMENT@ +################################################################### +## @DO_NOT_EDIT_COMMENT@ +## Generate: sh update.sh +################################################################### Name: myspell-dictionaries -Version: 20140102 +Version: @VERSION@ Release: 0 Summary: A Source Package for Dictionaries Used by MySpell -License: @ALL_LICENSES@ +License: AGPL-3.0 and BSD-2-Clause and BSD-3-Clause and BSD-4-Clause and CC-BY-SA-1.0 and CC-BY-SA-3.0 and GFDL-1.1 and GPL-2.0 and GPL-2.0+ and GPL-3.0 and GPL-3.0+ and LGPL-2.0 and LGPL-2.1 and LGPL-2.1+ and LGPL-3.0 and LGPL-3.0+ and MPL-1.1 Group: Productivity/Text/Spell -Url: http://lingucomponent.openoffice.org/download_dictionary.html -# Novell jargon bnc#306333 -Source0: Nwordlist.tgz -Source1: myspell-dictionaries-gen-spec -Source2: myspell-dictionaries.spec.in -Source3: myspell-dictionaries.data -# dictionaries -@SOURCES@ +Url: http://cgit.freedesktop.org/libreoffice/dictionaries/ +Source0: dictionaries.tar.xz BuildRequires: dos2unix BuildRequires: recode BuildRequires: unzip BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch +Obsoletes: myspell-african +Obsoletes: myspell-albanian +Obsoletes: myspell-american +Obsoletes: myspell-arabic +Obsoletes: myspell-armenian +Obsoletes: myspell-assamese +Obsoletes: myspell-asturian +Obsoletes: myspell-australian +Obsoletes: myspell-austrian +Obsoletes: myspell-belarusian +Obsoletes: myspell-bengali +Obsoletes: myspell-brazilian +Obsoletes: myspell-breton +Obsoletes: myspell-british +Obsoletes: myspell-bulgarian +Obsoletes: myspell-canadian +Obsoletes: myspell-catalan +Obsoletes: myspell-chichewa +Obsoletes: myspell-coptic +Obsoletes: myspell-croatian +Obsoletes: myspell-czech +Obsoletes: myspell-danish +Obsoletes: myspell-dutch +Obsoletes: myspell-esperanto +Obsoletes: myspell-estonian +Obsoletes: myspell-faroese +Obsoletes: myspell-french +Obsoletes: myspell-friulian +Obsoletes: myspell-gaelic-scots +Obsoletes: myspell-galician +Obsoletes: myspell-german +Obsoletes: myspell-greek +Obsoletes: myspell-gujarati +Obsoletes: myspell-haitian +Obsoletes: myspell-hebrew +Obsoletes: myspell-hindi +Obsoletes: myspell-hungarian +Obsoletes: myspell-icelandic +Obsoletes: myspell-indonese +Obsoletes: myspell-irish +Obsoletes: myspell-italian +Obsoletes: myspell-kazakh +Obsoletes: myspell-khmer +Obsoletes: myspell-kichwa +Obsoletes: myspell-kikuyu +Obsoletes: myspell-kinyarwanda +Obsoletes: myspell-kiswahili +Obsoletes: myspell-korean +Obsoletes: myspell-kurdish +Obsoletes: myspell-latin +Obsoletes: myspell-latvian +Obsoletes: myspell-lithuanian +Obsoletes: myspell-lower-sorbian +Obsoletes: myspell-macedonian +Obsoletes: myspell-maithili +Obsoletes: myspell-malagasy +Obsoletes: myspell-malay +Obsoletes: myspell-malayalam +Obsoletes: myspell-maory +Obsoletes: myspell-marathi +Obsoletes: myspell-mexican +Obsoletes: myspell-ndebele +Obsoletes: myspell-new-zealand +Obsoletes: myspell-norsk-bokmaal +Obsoletes: myspell-norsk-nynorsk +Obsoletes: myspell-nswiss +Obsoletes: myspell-occitan-lengadocian +Obsoletes: myspell-persian +Obsoletes: myspell-polish +Obsoletes: myspell-portuguese +Obsoletes: myspell-romanian +Obsoletes: myspell-russian +Obsoletes: myspell-serbian-cyrillic +Obsoletes: myspell-serbian-latin +Obsoletes: myspell-setswana +Obsoletes: myspell-sinhala +Obsoletes: myspell-slovak +Obsoletes: myspell-slovene +Obsoletes: myspell-sotho-northern +Obsoletes: myspell-south-african-english +Obsoletes: myspell-spanish +Obsoletes: myspell-spanish-argentine +Obsoletes: myspell-spanish-bolivian +Obsoletes: myspell-spanish-chilean +Obsoletes: myspell-spanish-colombian +Obsoletes: myspell-spanish-costa-rican +Obsoletes: myspell-spanish-dominican +Obsoletes: myspell-spanish-ecuadorian +Obsoletes: myspell-spanish-guatemalan +Obsoletes: myspell-spanish-honduran +Obsoletes: myspell-spanish-nicaraguan +Obsoletes: myspell-spanish-panamanian +Obsoletes: myspell-spanish-paraguayan +Obsoletes: myspell-spanish-peruvian +Obsoletes: myspell-spanish-puerto-rican +Obsoletes: myspell-spanish-salvadorean +Obsoletes: myspell-spanish-uruguayan +Obsoletes: myspell-spanish-venezuelan +Obsoletes: myspell-swati +Obsoletes: myspell-swedish +Obsoletes: myspell-swedish-finland +Obsoletes: myspell-tagalog +Obsoletes: myspell-thai +Obsoletes: myspell-tsonga +Obsoletes: myspell-ukrainian +Obsoletes: myspell-valencian +Obsoletes: myspell-venda +Obsoletes: myspell-vietnamese +Obsoletes: myspell-welsh +Obsoletes: myspell-xhosa +Obsoletes: myspell-yiddish +Obsoletes: myspell-zulu +Obsoletes: libreoffice-thesaurus-bg +Obsoletes: libreoffice-thesaurus-ca +Obsoletes: libreoffice-thesaurus-cs +Obsoletes: libreoffice-thesaurus-da +Obsoletes: libreoffice-thesaurus-de +Obsoletes: libreoffice-thesaurus-de-AT +Obsoletes: libreoffice-thesaurus-de-CH +Obsoletes: libreoffice-thesaurus-el +Obsoletes: libreoffice-thesaurus-en-AU +Obsoletes: libreoffice-thesaurus-en-GB +Obsoletes: libreoffice-thesaurus-en-US +Obsoletes: libreoffice-thesaurus-es +Obsoletes: libreoffice-thesaurus-es-AR +Obsoletes: libreoffice-thesaurus-es-VE +Obsoletes: libreoffice-thesaurus-fr +Obsoletes: libreoffice-thesaurus-ga +Obsoletes: libreoffice-thesaurus-hu +Obsoletes: libreoffice-thesaurus-it +Obsoletes: libreoffice-thesaurus-nb +Obsoletes: libreoffice-thesaurus-ne +Obsoletes: libreoffice-thesaurus-pl +Obsoletes: libreoffice-thesaurus-pt +Obsoletes: libreoffice-thesaurus-ro +Obsoletes: libreoffice-thesaurus-ru +Obsoletes: libreoffice-thesaurus-sk +Obsoletes: libreoffice-thesaurus-sl +Obsoletes: libreoffice-thesaurus-sv +Obsoletes: libreoffice-hyphen %description This source package contains dictionaries for MySpell. @@ -44,131 +181,49 @@ @METADATA@ %prep -%setup -c -install -m 644 %{SOURCE1} . -# unpack sources -for archive in \ -@SOURCES_UNPACK@ ; do - archive_name=`basename $archive | sed -e "s|.zip$||" -e "s|.oxt$||" -e "s|.tar.gz$||" -e "s|.tar.bz2$||"` - mkdir $archive_name || exit 1; - case $archive in - *.zip|*.oxt) - cd $archive_name; unzip $archive || exit 1; cd - - ;; - *.tar.gz) - tar -xzf $archive -C $archive_name || exit 1; - ;; - *.tar.bz2) - tar -xjf $archive -C $archive_name || exit 1; - ;; - *) - echo "Error: Do not know how to uncompress $archive" - exit 1; - ;; - esac -done -# -# fix wrong filenames -@PREP_HACKS@# -# fix permissions -# -find . -type f -exec chmod 644 {} \; +%setup -q -n dictionaries %build -# add the Novell jargon into all dictionaries bnc#306333 -# Beware! The Nwordlist must begin with a newline. Some files do not contain -# LF at the end of file. -for dic in `find . -name "*.dic` ; do - cat Nwordlist >> $dic - # delete empty lines if they were created in some cases - grep -v "^$" $dic > $dic.no_space && mv $dic.no_space $dic -done %install -rm -f filelist.template -install -m 755 -d %{buildroot}%{_datadir}/myspell/ -for lang_dir in * ; do - test -d $lang_dir || continue - # support locales with 2 and 3 letters in the language code: ll_CC.aff and lll_CC.aff - for aff in `find $lang_dir -regextype posix-extended -regex ".*/[[:lower:]][[:lower:]][[:lower:]]?_[[:upper:]][[:upper:]].aff" | sort` ; do - # find dictionaries - dic=`echo $aff | sed -e "s|.aff$|.dic|"` - if ! test -f $dic ; then - echo "Warning: Found $aff but not $dic" - echo "Skipping $aff" - continue; - fi - - # both .dic and .aff files exists => valid dictionary - # initialize file list - filelist=`mktemp /tmp/myspell-dictionaries-XXXXXX` - echo "%%defattr(-,root,root,-)" >$filelist - echo "%%dir %{_datadir}/myspell/" >>$filelist - - # install the dictionary - for f in $aff $dic ; do - fname=$(basename $f) - if test -f %{buildroot}%{_datadir}/myspell/$fname ; then - echo "Error: file already installed: $f" - echo " Probably is provided by two source tarballs" - exit 1; - fi - install -m 644 $f %{buildroot}%{_datadir}/myspell/ - echo %{_datadir}/myspell/$fname >>$filelist - done - - # detect locale, lang and country - if test -n $dic ; then - # replace the underscore with a dot to be able to separate the language and the coutry code with the command "cut" - dic_pname=`basename $dic | sed "s|_|.|"` - lang=`echo $dic_pname | cut -d "." -f1` - country=`echo $dic_pname | cut -d "." -f2` - else - echo "Error: No dictionary found in $lang_dir" - exit 1; - fi - locale="${lang}_${country}" - - # detect long language name - case "$locale" in -@LANG_NAME@ *) echo "Error: do not know language name for the locale $locale" - exit 1 - ;; - esac - - # detect README encoding - coding=`LC_CTYPE="$locale" locale -k LC_CTYPE | grep charmap | sed "s|charmap=\"\(.*\)\"\$|\1|"` - # special hack for some locales - case "$locale" in -@ENCODING@ esac - - # install documentation - docdir=%{_docdir}/myspell-$lang_name - mkdir -p %{buildroot}$docdir - echo "%%doc $docdir" >>$filelist - for doc in `find $lang_dir -type f -printf "%%P\n" | \ - grep -v -e ".aff$" -e ".dic$" -e ".dat$" -e ".idx$" \ - -e ".orig$" -e ".old$" -e "~$" \ - -e ".sh$" -e "makefile" -e "META-INF"` ; do - if ! test -f $lang_dir/$doc ; then - echo "Error: is not a file: $lang_dir/$doc" - exit 1; - fi - recode utf8..utf16 <$lang_dir/$doc >/dev/null 2>&1 || recode $coding..utf8 $lang_dir/$doc - dos2unix $lang_dir/$doc - dname=$(dirname $doc) - install -m 755 -d %{buildroot}$docdir/$dname - install -m 644 $lang_dir/$doc %{buildroot}$docdir/$dname - done - # rename the file list according to the detacted lang and country - mv $filelist $locale.list - # generate tempalte for the %files section - echo "%%files -f $locale.list -n myspell-$lang_name" >>filelist.template - echo "" >>filelist.template - done +install -m 755 -d %{buildroot}%{_datadir}/hunspell/ +install -m 755 -d %{buildroot}%{_datadir}/hyphen/ +install -m 755 -d %{buildroot}%{_datadir}/mythes/ +for dir in @LANG_DIRS@ ; do + # install files + dic_files=`find $dir -maxdepth 1 -name '*.dic' -a ! -name 'hyph*' -o -name '*.aff'` + hyph_files=`find $dir -maxdepth 1 -name 'hyph*.dic'` + th_files=`find $dir -maxdepth 1 -name 'th*.dat'` + doc_files=`find $dir -maxdepth 1 -type f | grep '.txt\|.xcu\|.xml\|.png\|.tex\|^[^.]*$' || true` + if [ ! -z "$dic_files" ]; then # see zu_ZA + cp -P `echo $dic_files | tr '\n' ' '` %{buildroot}%{_datadir}/hunspell/ + fi + if [ ! -z "$hyph_files" ]; then + cp -P `echo $hyph_files | tr '\n' ' '` %{buildroot}%{_datadir}/hyphen/ + fi + if [ ! -z "$th_files" ]; then + cp -P `echo $th_files | tr '\n' ' '` %{buildroot}%{_datadir}/mythes/ + fi + install -m 755 -d %{buildroot}%{_docdir}/myspell-$dir + dos2unix -q $doc_files + install -m 644 `echo $doc_files | tr '\n' ' '` %{buildroot}%{_docdir}/myspell-$dir + # create file list + dic_files=`echo "$dic_files" | sed 's@^.*/@%{_datadir}/hunspell/@'` + hyph_files=`echo "$hyph_files" | sed 's@^.*/@%{_datadir}/hyphen/@'` + th_files=`echo "$th_files" | sed 's@^.*/@%{_datadir}/mythes/@'` + echo '%%defattr(-,root,root,-)' > $dir.list + echo "$dic_files" >> $dir.list + echo "$hyph_files" >> $dir.list + echo "$th_files" >> $dir.list + echo "%{_docdir}/myspell-$dir" >> $dir.list done -echo "******" + +%files +%defattr(-,root,root) +%dir %{_datadir}/hunspell/ +%dir %{_datadir}/hyphen/ +%dir %{_datadir}/mythes/ @FILES@ %changelog ++++++ update.sh ++++++ #!/bin/bash DOWNLOAD='yes' GIT_DIR='dictionaries' VERBOSE='no' 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 myspell-valencian libreoffice-thesaurus-ca" ["myspell-cs_CZ"]="myspell-czech libreoffice-thesaurus-cs" ["myspell-da_DK"]="myspell-danish libreoffice-thesaurus-da" ["myspell-de"]="myspell-german myspell-nswiss myspell-austrian" ["myspell-el_GR"]="myspell-greek libreoffice-thesaurus-el" ["myspell-en"]="myspell-american myspell-australian myspell-canadian myspell-british myspell-new-zaeland myspell-south-african-english libreoffice-thesaurus-en-AU libreoffice-thesaurus-en-GB libreoffice-thesaurus-US" ["myspell-es"]="myspell-spanish myspell-mexican myspell-spanish-argentine myspell-spanish-bolivian myspell-spanish-chilean myspell-spanish-colombian myspell-spanish-costa-rican myspell-spanish-dominican myspell-spanish-ecuadorian myspell-spanish-guatemalan myspell-spanish-honduran myspell-spanish-nicaraguan myspell-spanish-panamanian myspell-spanish-paraguayan myspell-spanish-peruvian myspell-spanish-puerto-rican myspell-spanish-salvadorean myspell-spanish-uruguayan myspell-spanish-venezuelan libreoffice-thesaurus-es libreoffice-thesaurus-es-AR libreoffice-thesaurus-VE" ["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-no"]="myspell-norsk-bokmaal 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" ) function directories() { ls $GIT_DIR/*/dictionaries.xcu | sed -e 's:dictionaries/::' -e 's:/dictionaries.xcu::' | tr '\n' ' ' } 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 '<!--' \ | grep -A1 'Locations\|Locales' \ | grep -v '\-\-\|Locations\|Locales' \ | sed s:%origin%:$dir:g \ | sed 's:.*<value>\(.*\)</value>.*:\1:' \ | while read files; do read locs echo $dir: $locs @ $files | tr '-' '_' >> locale_to_file_map.txt done done cd .. } function dir_locales() { dir=$1 grep "^$dir:" $GIT_DIR/locale_to_file_map.txt | sed 's/.*: //' | sed 's/ @.*//' | tr ' ' '\n' | sort -u | tr '\n' ' ' } function locale_files() { loc=$1 grep $loc $GIT_DIR/locale_to_file_map.txt | sed 's:.*@ ::' | tr ' ' '\n' | sort -u | tr '\n' ' ' } function description() { dir=$1 grep '<name lang="en.*">' dictionaries/$dir/description.xml | sed -e 's:.*<name lang="en.*">::' -e 's:</name>.*::' | tr '\n' ' ' | sed 's:[ \t]*$::' } # # download present git version, remove .git, unify layout # and create locale symlinks # if [ $DOWNLOAD == "yes" ]; then rm -rf $GIT_DIR git clone git://anongit.freedesktop.org/libreoffice/$GIT_DIR rm -rf $GIT_DIR/.git for dir in ca gd_GB; do cp --force $GIT_DIR/$dir/dictionaries/* dictionaries/$dir sed -i 's:dictionaries/::' dictionaries/$dir/dictionaries.xcu done date=`date +%Y%m%d` elif [ ! -e $GIT_DIR ]; then echo "ERROR: DOWNLOAD=$DOWNLOAD and $GIT_DIR doesn't exist" exit 1 else date=`rpmspec -q --qf "%{VERSION}\n" *.spec | head -n 1` fi # # create dir <-> locales <-> files mapping # in $GIT_DIR/locale_to_file_map.txt # dirs=$(directories) [ "$VERBOSE" == "yes" ] && echo directiories: $dirs locale_to_file_map # create symlinks in $GIT_DIR/$dir, e. g. es_GT -> es_ANY for dir in $dirs; do dir_locs=$(dir_locales $dir) [ "$VERBOSE" == "yes" ] && echo "DICTIONARY: $dir ($dir_locs)" for l in $dir_locs; do loc_files=$(locale_files $l) [ "$VERBOSE" == "yes" ] && echo " $l: $loc_files" for f in $loc_files; do f=`basename $f` prefix="" if [[ $f == hyph* ]] || [[ $f == th* ]]; then # nice collision with th_ for thesaurus if [ "$f" != "th_TH.aff" ] && [ "$f" != "th_TH.dic" ]; then prefix=`echo $f | sed 's:_.*:_:'` fi fi #echo FILE: $f ext=`echo $f | sed 's:.*\.::'` # file or link for this locale/extension exist yet, do not create symlink if ls $GIT_DIR/$dir/$prefix*$l*.$ext &> /dev/null; then continue; fi # work around which is bug imho in dictionaries.xcu. # It references file that doesn't exist. if [ ! -e "$GIT_DIR/$dir/$f" ]; then continue; fi linkname=$prefix$l.$ext ln -sf $f $GIT_DIR/$dir/$linkname done done done # # generate myspell-dictionaries.spec # cp myspell-dictionaries.spec.in myspell-dictionaries.spec sed -i "s:@DO_NOT_EDIT_COMMENT@:DO NOT EDIT THIS SPEC FILE:" myspell-dictionaries.spec sed -i "s:@VERSION@:$date:" myspell-dictionaries.spec for subpackage in $dirs; do desc=$(description $subpackage) sum="MySpell $subpackage Dictionary" dir_locs=$(dir_locales $subpackage) sed -i "s#@METADATA@#%package -n myspell-$subpackage\n@METADATA@#" myspell-dictionaries.spec sed -i "s#@METADATA@#Summary: $sum\n@METADATA@#" myspell-dictionaries.spec sed -i "s#@METADATA@#Group: Productivity/Text/Spell\n@METADATA@#" myspell-dictionaries.spec sed -i "s#@METADATA@#Requires: myspell-dictionaries\n@METADATA@#" myspell-dictionaries.spec sed -i "s#@METADATA@#Provides: myspell-dictionary\n@METADATA@#" myspell-dictionaries.spec for l in $dir_locs; do sed -i "s#@METADATA@#Provides: locale(libreoffice:$l)\n@METADATA@#" myspell-dictionaries.spec sed -i "s#@METADATA@#Provides: locale(seamonkey-spellchecker:$l)\n@METADATA@#" myspell-dictionaries.spec done for p in ${provides_map["myspell-$subpackage"]}; do sed -i "s#@METADATA@#Provides: $p\n@METADATA@#" myspell-dictionaries.spec done sed -i "s#@METADATA@#\n@METADATA@#" myspell-dictionaries.spec sed -i "s#@METADATA@#%description -n myspell-$subpackage\n@METADATA@#" myspell-dictionaries.spec sed -i "s#@METADATA@#$desc.\n@METADATA@#" myspell-dictionaries.spec sed -i "s#@METADATA@#\n@METADATA@#" myspell-dictionaries.spec done sed -i "s:@METADATA@::" myspell-dictionaries.spec sed -i "s:@LANG_DIRS@:$dirs:" myspell-dictionaries.spec for subpackage in $dirs; do sed -i "s:@FILES@:%files -n myspell-$subpackage -f $subpackage.list\n@FILES@:" myspell-dictionaries.spec sed -i "s:@FILES@:\n@FILES@:" myspell-dictionaries.spec done sed -i "s:@FILES@::" myspell-dictionaries.spec # # creating source archive # [ $DOWNLOAD == "yes" ] && tar cJf dictionaries.tar.xz dictionaries [ $DOWNLOAD == "yes" ] && rm -r dictionaries echo OK # # advice at the end .. # echo echo With osc diff, figure out if there is a new package. echo If yes, add its license in License: tag of both echo *.spec and *.spec.in echo if this license is not there yet. echo -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de