# $Id: PKGBUILD 150623 2012-02-19 00:37:36Z allan $
# Maintainer: AndyRTR <andyrtr@archlinux.org>

pkgname=hunspell-es
pkgver=20051101
pkgrel=1
pkgdesc="Spanish hunspell dictionaries"
arch=(any)
url="http://hunspell.sourceforge.net/"
license=('LGPL')
makedepends=('hunspell')
optdepends=('hunspell:	the spell checking libraries and apps')
source=('http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_AR.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_BO.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_CL.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_CO.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_CR.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_CU.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_DO.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_EC.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_ES.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_GT.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_HN.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_MX.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_NI.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_PA.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_PE.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_PR.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_PY.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_SV.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_UY.zip'
	'http://ftp.osuosl.org/pub/openoffice/contrib/dictionaries/es_VE.zip')
md5sums=('4c634da95fad11093ba65f6367ee5e19'
         '564921b9f82d9f2f46ea4b53e516975b'
         'b75c996c3665d2a73bab21588b9ee258'
         'cbc916ab3433755592868565a60471b8'
         'f2641aa3187a4b411b7a918046100848'
         'b13e5bbf7c5eddef292dac61c9f7b7fb'
         'e38aba8b2f43041b41df36bb383a59e2'
         '88bde5878d2a79807b4c38bc785001aa'
         '4b272f7c958dd619b2ddc007c45db53b'
         'cc0f781cb0d1662954692da3e03cb46d'
         'b13d8e86654c7552d2834c1024bbd391'
         'e32f5ec8c94fd902a9823dae4040a019'
         '87ac50f7fc714452b421dc91d581b476'
         '2f71f67090afb7963e7bcbbffbe317de'
         '0be27bea02ecdca8b651fad52193ab96'
         'b95eadbad8ae02bddb5e1fed25075e15'
         'd1f06558dc4fac30c7926f26216b3fec'
         '928536ead27886e819a5910d8fa1052f'
         '23c13ab1e0902f4b3d936839074daa12'
         '748e15e39e7c5b52877bd7f111196304')
es_langs="es_AR es_BO es_CL es_CO es_CR es_CU es_DO es_EC es_ES es_GT es_HN es_MX es_NI es_PA es_PE es_PR es_PY es_SV es_UY es_VE" # <- obsolete? it's not used in the pkg

package() {
  cd "$srcdir"
  install -dm755 ${pkgdir}/usr/share/hunspell
  cp -p *.dic *.aff $pkgdir/usr/share/hunspell

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