archrelease: copy trunk to community-any
[ArchLinux/community.git] / hunspell-fr / trunk / PKGBUILD
blob9691b963f642ebea4a31a7071556ff21f9ec9b57
1 # Maintainer: Bruno Pagani <archange@archlinux.org>
3 pkgname=hunspell-fr
4 pkgver=7.0
5 pkgrel=2
6 pkgdesc="French (classic/modern) hunspell dictionaries"
7 arch=(any)
8 url="https://grammalecte.net/download.php?prj=fr"
9 license=(MPL2)
10 makedepends=(qt6-webengine)
11 optdepends=('hunspell: the spell checking libraries and apps')
12 source=("https://grammalecte.net/download/fr/${pkgname/-fr/}-french-dictionaries-v${pkgver}.zip")
13 sha256sums=('eb7ac36dc14b9c3e3c0cabae0f90304a137da8e6ae607bcaf56d65720fbd097f')
15 package() {
16   install -Dm644 fr-classique.dic "${pkgdir}"/usr/share/hunspell/fr_FR.dic
17   install -Dm644 fr-classique.aff "${pkgdir}"/usr/share/hunspell/fr_FR.aff
19   pushd "${pkgdir}"/usr/share/hunspell/
20   fr_FR_aliases="fr_BE fr_CA fr_CH fr_LU"
21   for lang in ${fr_FR_aliases}; do
22     ln -s fr_FR.aff ${lang}.aff
23     ln -s fr_FR.dic ${lang}.dic
24   done
25   popd
27   # the symlinks
28   install -dm755 "${pkgdir}"/usr/share/myspell/dicts
29   pushd "${pkgdir}"/usr/share/myspell/dicts
30     for file in "${pkgdir}"/usr/share/hunspell/*; do
31       ln -sv /usr/share/hunspell/$(basename ${file}) .
32     done
33   popd
35   # docs
36   install -Dm644 README_dict_fr.txt -t "${pkgdir}"/usr/share/doc/${pkgname}/
38   # Install webengine dictionaries   
39   install -d "$pkgdir"/usr/share/qt{,6}/qtwebengine_dictionaries/
40   for _file in "$pkgdir"/usr/share/hunspell/*.dic; do
41   _filename=$(basename $_file)
42     /usr/lib/qt6/qwebengine_convert_dict $_file "$pkgdir"/usr/share/qt6/qtwebengine_dictionaries/${_filename/\.dic/\.bdic}
43   ln -rs "$pkgdir"/usr/share/qt6/qtwebengine_dictionaries/${_filename/\.dic/\.bdic} "$pkgdir"/usr/share/qt/qtwebengine_dictionaries/
44   done