Hello community,

here is the log from the commit of package myspell-dictionaries for 
openSUSE:Factory checked in at 2015-01-22 21:47:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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-09-17 17:41:50.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.myspell-dictionaries.new/myspell-dictionaries.changes
   2015-01-22 21:48:02.000000000 +0100
@@ -1,0 +2,6 @@
+Fri Dec 19 08:32:12 UTC 2014 - [email protected]
+
+- update to 20141215
+- package split according to locale [bnc#907966]
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ myspell-dictionaries.spec ++++++
++++ 5392 lines (skipped)
++++ between 
/work/SRC/openSUSE:Factory/myspell-dictionaries/myspell-dictionaries.spec
++++ and 
/work/SRC/openSUSE:Factory/.myspell-dictionaries.new/myspell-dictionaries.spec

++++++ dictionaries.tar.xz ++++++
/work/SRC/openSUSE:Factory/myspell-dictionaries/dictionaries.tar.xz 
/work/SRC/openSUSE:Factory/.myspell-dictionaries.new/dictionaries.tar.xz 
differ: char 26, line 1

++++++ myspell-dictionaries.spec.in ++++++
--- /var/tmp/diff_new_pack.tzMdVZ/_old  2015-01-22 21:48:04.000000000 +0100
+++ /var/tmp/diff_new_pack.tzMdVZ/_new  2015-01-22 21:48:04.000000000 +0100
@@ -186,90 +186,9 @@
 %build
 
 %install
-function install_dictionary_files
-{
-  locale=$1
-  system_dir=$2
-  files=$3
-
-  if [ ! -z "$files" ]; then
-    for file in $files; do
-      # install file
-      cp -P $file %{buildroot}%{_datadir}/$system_dir/
-      # symlink
-      ln -s %{_datadir}/$system_dir/$file 
%{buildroot}%{_datadir}/$compat_dir/$file
-      # file list
-      echo %{_datadir}/$system_dir/$file >> $locale.list
-      echo %{_datadir}/$compat_dir/$file >> $locale.list
-    done 
-  fi
-}
-function install_doc_files
-{
-  locale=$1
-  doc_files=$2
-  dos2unix -q $doc_files
-  install -m 755 -d %{buildroot}%{_docdir}/myspell-$locale
-  install -m 644 `echo $doc_files | tr '\n' ' '` 
%{buildroot}%{_docdir}/myspell-$locale
-  echo "%{_docdir}/myspell-$locale" >> $locale.list
-}
-function install_lightproof_files
-{
-  locale=$1
-  files=$2
-  dsc_files=$3
-  lightproof_dir=%{_libdir}/libreoffice/share/extensions/lightproof_$locale
-  if [[ "$files" =~ 'Lightproof.py' ]]; then
-     if [ ! -d %{buildroot}$lightproof_dir ]; then
-       mkdir -p %{buildroot}$lightproof_dir
-       echo "%dir %{_libdir}/libreoffice" >> ../common.list
-       echo "%dir %{_libdir}/libreoffice/share" >> ../common.list
-       echo "%dir %{_libdir}/libreoffice/share/extensions" >> ../common.list
-     fi
-     cp -r $files $dsc_files %{buildroot}$lightproof_dir
-     echo $lightproof_dir >> lightproof.$locale.list
-  fi
-}
-
-dic_dir="hunspell"
-hyph_dir="hyphen"
-th_dir="mythes"
-compat_dir="myspell"
-for system_dir in $dic_dir $hyph_dir $th_dir $compat_dir; do
-  install -m 755 -d %{buildroot}%{_datadir}/$system_dir/
-done
-echo '%%defattr(-,root,root,-)' > common.list
-for locale_dir in @LANG_DIRS@ ; do
-  pushd $locale_dir
-  dic_files=`find -maxdepth 1 -name '*.dic' -a ! -name 'hyph*' -o -name 
'*.aff'`
-  hyph_files=`find -maxdepth 1 -name 'hyph*.dic'`
-  th_files=`find  -maxdepth 1 -name 'th*.dat' -o -name 'th*.idx'`
-  doc_files=`find -maxdepth 1 -type f | grep 
'.txt\|.xcu\|.xml\|.png\|.tex\|^[^.]*$' || true`
-  lightproof_files=`find -maxdepth 1 -name 'pythonpath' -o -name 'dialog' -o 
-name 'Lightproof*' -o \
-                                     -name 'Linguistic.xcu' -o -name 
'META-INF' -o -name 'icons' -o \
-                                     -name 'description.xml'`
-  # install dictionary files  
-  echo '%%defattr(-,root,root,-)' > $locale_dir.list
-  install_dictionary_files $locale_dir $dic_dir  "$dic_files"
-  install_dictionary_files $locale_dir $hyph_dir "$hyph_files"
-  install_dictionary_files $locale_dir $th_dir   "$th_files"
-  # install documentation
-  install_doc_files $locale_dir "$doc_files"
-  # install lightproof files
-  echo '%%defattr(-,root,root,-)' > lightproof.$locale_dir.list
-  install_lightproof_files $locale_dir "$lightproof_files"
-  popd
-  mv $locale_dir/$locale_dir.list .
-  mv $locale_dir/lightproof.$locale_dir.list .
-done
-
-
-%files -f common.list
-%defattr(-,root,root)
-%dir %{_datadir}/hunspell/
-%dir %{_datadir}/hyphen/
-%dir %{_datadir}/mythes/
-%dir %{_datadir}/myspell/
+@INSTALL@
 
+%files 
 @FILES@
+
 %changelog

++++++ update.sh ++++++
--- /var/tmp/diff_new_pack.tzMdVZ/_old  2015-01-22 21:48:04.000000000 +0100
+++ /var/tmp/diff_new_pack.tzMdVZ/_new  2015-01-22 21:48:04.000000000 +0100
@@ -2,7 +2,17 @@
 # DOWNLOAD='no' when testing this script or spec.in
 DOWNLOAD='yes'
 GIT_DIR='dictionaries'
-VERBOSE='no'
+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"
@@ -11,13 +21,39 @@
 ["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-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"]="myspell-german myspell-nswiss myspell-austrian"
+["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"]="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-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"
@@ -32,7 +68,8 @@
 ["myspell-lt_LT"]="myspell-lithuanian"
 ["myspell-lv_LV"]="myspell-latvian"
 ["myspell-nl_NL"]="myspell-dutch"
-["myspell-no"]="myspell-norsk-bokmaal myspell-norsk-nynorsk"
+["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"
@@ -51,6 +88,12 @@
 ["myspell-zu_ZA"]="myspell-zulu"
 )
 
+declare -A recommends_map=(
+["myspell-de"]="myspell-de_DE"
+["myspell-en"]="myspell-en_US"
+["myspell-es"]="myspell-es_ES"
+)
+
 # directories under $GIT_DIR, which holds dictionaries
 function directories()
 {
@@ -71,7 +114,8 @@
        | sed 's:.*<value>\(.*\)</value>.*:\1:' \
        | while read files; do 
            read locs
-           echo $dir: $locs @ $files | tr '-' '_' >> locale_to_file_map.txt
+           locs=`echo $locs | tr '-' '_'`
+           echo $dir: $locs @ $files >> locale_to_file_map.txt
          done
   done
   # add idx files for every dat (where doesn't exist)
@@ -129,6 +173,132 @@
   [ -f $GIT_DIR/$dir/Lightproof.py ]
 }
 
+# figure out install path for given file name
+function install_path()
+{
+  filename=$1
+
+  install_dir=""
+  # *.dic, *.aff
+  if [[ $filename =~ \.dic$ ]] || [[ $filename =~ \.aff$ ]]; then
+    if [[ $filename =~ ^hyph ]]; then
+      install_dir="$DATADIR/$HYPH_DIR"
+    else
+      install_dir="$DATADIR/$DIC_DIR"
+    fi
+  fi
+  # th*.dat, th*.idx
+  if [[ $filename =~ th.*\.dat ]] || [[ $filename =~ th.*\.idx ]]; then
+    install_dir="$DATADIR/$TH_DIR"
+  fi
+
+  echo "$install_dir/$filename"
+}
+
+function install_regular()
+{
+  src=$1
+  dst=$2
+  sed -i "s#@INSTALL@#cp -P $src %{buildroot}$dst\n@INSTALL@#" 
myspell-dictionaries.spec
+}
+
+function install_regular_recursive()
+{
+  src=$1
+  dst=$2
+  sed -i "s#@INSTALL@#cp -rP $src %{buildroot}$dst\n@INSTALL@#" 
myspell-dictionaries.spec
+}
+
+function install_link()
+{
+  targ=$1
+  name=$2
+  sed -i "s#@INSTALL@#ln -s $targ %{buildroot}$name\n@INSTALL@#" 
myspell-dictionaries.spec
+}
+
+function install_dir()
+{
+  dirname=$1
+  sed -i "s#@INSTALL@#mkdir -p %{buildroot}$dirname\n@INSTALL@#" 
myspell-dictionaries.spec
+}
+
+function add_files()
+{
+  filelist=$1
+
+  sed -i "s#@FILES@#%defattr(-,root,root,-)\n@FILES@#" 
myspell-dictionaries.spec
+  for f in $filelist; do
+    f=$(echo $f | sed 's:%dir_:%dir :')
+    sed -i "s#@FILES@#$f\n@FILES@#" myspell-dictionaries.spec
+  done
+}
+
+function package_files()
+{
+  pname=$1
+  filelist=$2
+
+  sed -i "s#@FILES@#%files -n $pname\n@FILES@#" myspell-dictionaries.spec
+  add_files "$filelist"
+  sed -i "s#@FILES@#\n@FILES@#" myspell-dictionaries.spec
+}
+
+function package_metadata()
+{
+  locale=$1
+  dir=$2
+
+  desc=$(description $dir)
+  sum="MySpell $locale Dictionary"
+  sed -i "s#@METADATA@#%package -n myspell-$locale\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
+  sed -i "s#@METADATA@#Provides:       
locale(libreoffice:$locale)\n@METADATA@#" myspell-dictionaries.spec
+  sed -i "s#@METADATA@#Provides:       
locale(seamonkey-spellchecker:$locale)\n@METADATA@#" myspell-dictionaries.spec
+  for p in ${provides_map["myspell-$locale"]}; do
+    sed -i "s#@METADATA@#Provides:       $p\n@METADATA@#" 
myspell-dictionaries.spec
+  done
+  if [ "$locale" != "$dir" ]; then
+    # require main language subpackage
+    sed -i "s#@METADATA@#Requires:       myspell-$dir\n@METADATA@#" 
myspell-dictionaries.spec
+  fi
+  for p in ${recommends_map["myspell-$locale"]}; do
+    sed -i "s#@METADATA@#Recommends:       $p\n@METADATA@#" 
myspell-dictionaries.spec
+  done
+  sed -i "s#@METADATA@#BuildArch:      noarch\n@METADATA@#" 
myspell-dictionaries.spec
+  if have_lightproof $dir; then
+    sed -i "s#@METADATA@#Recommends:     myspell-lightproof-$dir\n@METADATA@#" 
myspell-dictionaries.spec
+  fi
+  sed -i "s#@METADATA@#\n@METADATA@#" myspell-dictionaries.spec
+  sed -i "s#@METADATA@#%description -n myspell-$locale\n@METADATA@#" 
myspell-dictionaries.spec
+  sed -i "s#@METADATA@#$desc.\n@METADATA@#" myspell-dictionaries.spec
+  sed -i "s#@METADATA@#\n@METADATA@#" myspell-dictionaries.spec
+}
+
+function lightproof_package_metadata()
+{
+  dir=$1
+
+  sed -i "s#@METADATA@#%package -n myspell-lightproof-$dir\n@METADATA@#" 
myspell-dictionaries.spec
+  sed -i "s#@METADATA@#Summary:        Lightproof for $dir\n@METADATA@#" 
myspell-dictionaries.spec
+  sed -i "s#@METADATA@#Group:          Productivity/Text/Spell\n@METADATA@#" 
myspell-dictionaries.spec
+  sed -i "s#@METADATA@#Requires:       myspell-$dir\n@METADATA@#" 
myspell-dictionaries.spec
+  sed -i "s#@METADATA@#\n@METADATA@#" myspell-dictionaries.spec
+  sed -i "s#@METADATA@#\n@METADATA@#" myspell-dictionaries.spec
+  sed -i "s#@METADATA@#%description -n myspell-lightproof-$dir\n@METADATA@#" 
myspell-dictionaries.spec
+  sed -i "s#@METADATA@#Lightproof grammar checker information for 
$dir.\n@METADATA@#" myspell-dictionaries.spec
+  sed -i "s#@METADATA@#\n@METADATA@#" myspell-dictionaries.spec
+}
+
+function finish_spec()
+{
+  sed -i "s:@METADATA@::" myspell-dictionaries.spec
+  sed -i "s:@INSTALL@::" myspell-dictionaries.spec
+  sed -i "s:@FILES@::" myspell-dictionaries.spec
+}
+
 #
 # prepare 'dictionaries' directory
 #
@@ -176,20 +346,45 @@
   fi
 done
 
-echo '--- Creating symlinks'
-# create symlinks in $GIT_DIR/$dir, e. g. es_GT -> es_ANY 
+#
+# generate myspell-dictionaries.spec
+#
+echo '--- Generating spec file'
+
+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
+
+# install main directories
+dir_filelist=""
+for d in $DATADIR/$DIC_DIR $DATADIR/$HYPH_DIR $DATADIR/$TH_DIR \
+         $DATADIR/$COMPAT_DIR $LO_DIR $LODATA_DIR $LOEXT_DIR; do
+  [ "$VERBOSE" == "yes" ] && echo "installing $DATADIR/$d"
+  install_dir $d
+  dir_filelist="$dir_filelist %dir_$d"
+done
+echo $dir_filelist
+add_files "$dir_filelist"
+
+# install dictionary files
 for dir in $dirs; do
   files=$(dir_files $dir)
+  # clear and declare filelist associative array
+  unset filelist
+  declare -A filelist
+
   [ "$VERBOSE" == "yes" ] && echo "DICTIONARY: $dir ($files)"
   for file in $files; do
+    file_into_main_package=1
+    fname=`basename $file`
     locales=$(file_locales $file)
     [ "$VERBOSE" == "yes" ] && echo " $file: $locales"
     for locale in $locales; do
-      fname=`basename $file`
       # work around which is bug imho in dictionaries.xcu. 
       # It references file that doesn't exist.
       if [ ! -e "$GIT_DIR/$dir/$fname" ]; then
-        [ "$VERBOSE" == "yes" ] && echo "WARNING: $GIT_DIR/$dir/$f doesn't 
exist"
+        [ "$VERBOSE" == "yes" ] && echo "WARNING: $GIT_DIR/$dir/$fname doesn't 
exist"
         continue;
       fi
 
@@ -209,80 +404,98 @@
       ext=`echo $fname | sed 's:.*\.::'`
       linkname=$prefix$locale$version.$ext
 
-      [ "$VERBOSE" == "yes" ] && echo -n " link: $linkname -> $fname .. "
+      [ "$VERBOSE" == "yes" ] && echo -n "  link: $linkname -> $fname .. "
 
-      # regular file or link for this locale/extension exist yet, 
+      # regular file for this locale/extension exists yet, 
       # do not create symlink
-      if ls $GIT_DIR/$dir/$linkname &> /dev/null; then
-         [ "$VERBOSE" == "yes" ] && echo "regular file or link exists yet"
+      if [ -f $GIT_DIR/$dir/$linkname ]; then
+        [ "$VERBOSE" == "yes" ] && 
+          echo "regular file exists yet, not creating link"
+        # should file go to language sub-subpackage?
+        # if not, it will be installed later (search for ***)
+        if [ "$locale" != "$dir" ]; then
+          file_into_main_package=0
+          ipath=$(install_path $linkname)
+          [ "$VERBOSE" == "yes" ] && 
+            echo " install: $ipath (myspell-dictionaries-$locale)"
+          install_regular $dir/$linkname $ipath
+          filelist[$locale]="${filelist[$locale]} $ipath"
+          compat_link="$DATADIR/$COMPAT_DIR/$linkname"
+          [ "$VERBOSE" == "yes" ] && 
+            echo " compat link install: $compat_link -> $ipath"
+          install_link $ipath $compat_link
+          filelist[$locale]="${filelist[$locale]} $compat_link"
+        fi
         continue;
       fi
 
-      ln -sf $fname $GIT_DIR/$dir/$linkname
-       [ "$VERBOSE" == "yes" ] && echo "created"
+      # regular file $linkname does not exist yet, create symlink
+      [ "$VERBOSE" == "yes" ] && echo "created"
+      lipath=$(install_path $linkname)
+      ripath=$(install_path $fname)
+      [ "$VERBOSE" == "yes" ] && 
+        echo "  link install: $ipath (myspell-dictionaries-$locale)"
+      install_link $ripath $lipath
+      filelist[$locale]="${filelist[$locale]} $lipath"
+      compat_link=$DATADIR/$COMPAT_DIR/$linkname
+      [ "$VERBOSE" == "yes" ] && 
+        echo "  compat link install: $compat_link -> $ipath"
+      install_link $lipath "$compat_link"
+      filelist[$locale]="${filelist[$locale]} $compat_link"
     done
-  done
-done
 
-#
-# generate myspell-dictionaries.spec
-#
-echo '--- Generating spec file'
-cp myspell-dictionaries.spec.in myspell-dictionaries.spec
+    # regular file to the main language subpackage if it is not in 
+    # some its sub-subpackages (search for ***)
+    if [ $file_into_main_package -eq 1 ]; then
+      ipath=$(install_path $fname)
+      [ "$VERBOSE" == "yes" ] && 
+        echo " install: $ipath (myspell-dictionaries-$dir)"
+      install_regular $file $ipath
+      filelist[$dir]="${filelist[$dir]} $ipath"
+      compat_link="$DATADIR/$COMPAT_DIR/$fname"
+      [ "$VERBOSE" == "yes" ] && 
+        echo " compat link install: $compat_link -> $ipath"
+      install_link $ipath $compat_link
+      filelist[$dir]="${filelist[$dir]} $compat_link"
+    fi
+  done
 
-sed -i "s:@DO_NOT_EDIT_COMMENT@:DO NOT EDIT THIS SPEC FILE:" 
myspell-dictionaries.spec
-sed -i "s:@VERSION@:$date:" myspell-dictionaries.spec
+  # install lightproof files
+  if have_lightproof $dir; then
+    lightproof_files=`find $GIT_DIR/$dir -maxdepth 1 -name 'pythonpath' -o 
-name 'dialog' -o -name 'Lightproof*' -o \
+                                                     -name 'Linguistic.xcu' -o 
-name 'META-INF' -o -name 'icons' -o \
+                                                     -name 'description.xml'`
+    install_dir "$LOEXT_DIR/lightproof-$dir"
+    lightproof_filelist="%dir_$LOEXT_DIR/lightproof-$dir"
+    for f in $lightproof_files; do
+      ipath="$LOEXT_DIR/lightproof-$dir/`basename $f`"
+      install_regular_recursive $dir/`basename $f` $ipath
+      lightproof_filelist="$lightproof_filelist $ipath"
+    done
+  fi
 
-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
+  # install doc files
+  doc_files=`find $GIT_DIR/$dir -maxdepth 1 -type f | grep 
'.txt\|.xcu\|.xml\|.png\|.tex\|^[^.]*$' || true`
+  install_dir "$DOCDIR/myspell-$dir"
+  filelist[$dir]="${filelist[$dir]} %dir_$DOCDIR/myspell-$dir"
+  for f in $doc_files; do
+    ipath="$DOCDIR/myspell-$dir/`basename $f`"
+    install_regular $dir/`basename $f` $ipath
+    filelist[$dir]="${filelist[$dir]} $ipath"
   done
-  for p in ${provides_map["myspell-$subpackage"]}; do
-    sed -i "s#@METADATA@#Provides:       $p\n@METADATA@#" 
myspell-dictionaries.spec
+
+  # write rpm subpackage information
+  for pkg in "${!filelist[@]}"; do
+    package_metadata $pkg $dir
+    package_files myspell-$pkg "${filelist[$pkg]}"
   done
-  sed -i "s#@METADATA@#BuildArch:      noarch\n@METADATA@#" 
myspell-dictionaries.spec
-  if have_lightproof $subpackage; then
-    sed -i "s#@METADATA@#Recommends:      
myspell-lightproof-$subpackage\n@METADATA@#" myspell-dictionaries.spec
-  fi
-  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
-  # lightproof subpackage
-  if have_lightproof $subpackage; then
-    sed -i "s#@METADATA@#%package -n 
myspell-lightproof-$subpackage\n@METADATA@#" myspell-dictionaries.spec
-    sed -i "s#@METADATA@#Summary:        Lightproof for 
$subpackage\n@METADATA@#" myspell-dictionaries.spec
-    sed -i "s#@METADATA@#Group:          Productivity/Text/Spell\n@METADATA@#" 
myspell-dictionaries.spec
-    sed -i "s#@METADATA@#Requires:       myspell-$subpackage\n@METADATA@#" 
myspell-dictionaries.spec
-    sed -i "s#@METADATA@#\n@METADATA@#" myspell-dictionaries.spec
-    sed -i "s#@METADATA@#\n@METADATA@#" myspell-dictionaries.spec
-    sed -i "s#@METADATA@#%description -n 
myspell-lightproof-$subpackage\n@METADATA@#" myspell-dictionaries.spec
-    sed -i "s#@METADATA@#Lightproof grammar checker information for 
$subpackage.\n@METADATA@#" myspell-dictionaries.spec
-    sed -i "s#@METADATA@#\n@METADATA@#" myspell-dictionaries.spec
+  if have_lightproof $dir; then
+    lightproof_package_metadata $dir
+    package_files myspell-lightproof-$dir "$lightproof_filelist"
   fi
 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
-  if have_lightproof $subpackage; then
-    sed -i "s:@FILES@:%files -n myspell-lightproof-$subpackage -f 
lightproof.$subpackage.list\n@FILES@:" myspell-dictionaries.spec
-    sed -i "s:@FILES@:\n@FILES@:" myspell-dictionaries.spec
-  fi
-done
-sed -i "s:@FILES@::" myspell-dictionaries.spec
+finish_spec
 
 #
 # creating source archive

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to