# Maintainer: Guillaume ALAUX <guillaume@archlinux.org>

pkgname=hyphen-fr
pkgver=3.0
pkgrel=1
pkgdesc="French hyphenation rules"
arch=('any')
url="http://www.dicollecte.org/"
license=('LGPL')
optdepends=('hyphen: offers hyphenation library functions')
source=("http://www.dicollecte.org/download/fr/hyph-fr-v${pkgver}.zip")
md5sums=('69543c399f6be39ae7a578c8c3a93584')

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

  pushd ${pkgdir}/usr/share/hyphen/
  fr_FR_aliases="fr_BE fr_CA fr_CH fr_LU"
  for lang in ${fr_FR_aliases}; do
        ln -s hyph_fr_FR.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_fr.txt \
                ${pkgdir}/usr/share/doc/${pkgname}/README_hyph_fr_FR.txt
}
