# Maintainer:  Bartłomiej Piotrowski <barthalion@gmail.com>
# Contributor: Maciej Sitarz <macieks@freesco.pl>

pkgname=hunspell-pl
pkgver=20111216
pkgrel=1
pkgdesc="Polish (Poland) dictionary for Hunspell"
arch=(any)
url="http://www.sjp.pl/slownik/ort/"
license=("GPL" "LGPL" "CCPL:cc-by-sa" "MPL")
optdepends=('hunspell: the spell checking libraries and apps')
source=(ftp://ftp.archlinux.org/other/community/$pkgname/sjp-myspell-pl-$pkgver.zip)
md5sums=('1a9070d12004dd4e883e3190e5cdb620')

build() {
    cd ${srcdir}
    bsdtar -xf pl_PL.zip
}

package() {
    cd "$srcdir"

    install -dm755 ${pkgdir}/usr/share/hunspell
    install -m644 pl_PL.aff ${pkgdir}/usr/share/hunspell
    install -m644 pl_PL.dic ${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
    install -m644 README_pl_PL.txt $pkgdir/usr/share/doc/$pkgname
}
