# Contributor: Jelle van der Waa <jelle vdwaa nl>

pkgname=hyphen-nl
pkgver=20050617
pkgrel=5
pkgdesc="Dutch hyphenation rules"
arch=('any')
url="https://wiki.services.openoffice.org/wiki/Dictionaries#Dutch_.28Netherlands.29"
license=('GPL2')
optdepends=('hyphen: offers hyphenation library functions')
source=("https://www.mirrorservice.org/sites/download.openoffice.org/contrib/dictionaries/hyph_nl_NL.zip")
md5sums=('6f0b18ce830445ae8337df8913155196')

package() {
  cd "${srcdir}"
  install -dm755 "${pkgdir}/usr/share/hyphen"
  install -m644 hyph_nl_NL.dic "${pkgdir}/usr/share/hyphen/hyph_nl_NL.dic"

  pushd "${pkgdir}/usr/share/hyphen/"
  nl_NL_aliases="nl_AW nl_BE"
  for lang in ${nl_NL_aliases}; do
        ln -s hyph_nl_NL.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}"
  install -m644 README_hyph_nl_NL.txt "${pkgdir}/usr/share/doc/${pkgname}/README_hyph_nl_NL.txt"
}
