# $Id: PKGBUILD 151522 2012-02-27 15:01:34Z pierre $
# Maintainer: AndyRTR <andyrtr@archlinux.org>

pkgname=hyphen-es
pkgver=20051118
pkgrel=2
pkgdesc="Spanish hyphenation rules"
arch=('any')
url="http://wiki.services.openoffice.org/wiki/Dictionaries"
license=('LGPL')
optdepends=('hyphen: offers hyphenation library functions')
source=('http://vesta.informatik.rwth-aachen.de/ftp/pub/mirror/OpenOffice/contrib/dictionaries/hyph_es_ES.zip')
md5sums=('d34ab9eefdb49147c57c01227eeb0c66')

package() {
  cd "$srcdir"
  install -dm755 ${pkgdir}/usr/share/hyphen
  cp -p hyph_es_??.dic $pkgdir/usr/share/hyphen

  pushd $pkgdir/usr/share/hyphen/
  es_ES_aliases="es_AR es_BO es_CL es_CO es_CR es_CU es_DO es_EC es_GT es_HN es_MX es_NI es_PA es_PE es_PR es_PY es_SV es_UY es_VE"
  for lang in $es_ES_aliases; do
        ln -s hyph_es_ES.dic hyph_$lang.dic
  done
  popd

  # the symlinks
  install -dm755 ${pkgdir}/usr/share/myspell/dicts
  pushd $pkgdir/usr/share/myspell/dicts
    for file in $pkgdir/usr/share/hyphen/*; do
      ln -sv /usr/share/hyphen/$(basename $file) .
    done
  popd
  
  # docs
  install -dm755 ${pkgdir}/usr/share/doc/$pkgname
  cp -p README_hyph_es_??.txt $pkgdir/usr/share/doc/$pkgname
}
