summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cc537bb63e902b796bd25e436f4beebfe7b43415 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Maintainer: Mélanie Chauvel (ariasuni) <perso@hack-libre.org>

pkgbase='hunspell-fr-ungendered'
pkgname=(hunspell-fr-{'classical','comprehensive','modern','revised'}-ungendered)
pkgver=0.6.0
pkgrel=1
pkgdesc="French ungendered hunspell dictionary"
arch=(any)
url="https://github.com/RadicaliseesSurInternet/hunspell-inclusif"
license=('MPL2')
makedepends=('python')
conflicts=('hunspell-fr')
provides=('hunspell-fr')
source=("${url}/archive/${pkgver}.tar.gz")
sha256sums=('e86eb438b81eb67c1d35122325f000d1077779e42f4f5ec27554a8b390d44922')

package_hunspell-fr-classical-ungendered() {
  pkgdesc+=" (classical variant)"
  _package 'classique'
}

package_hunspell-fr-comprehensive-ungendered() {
  pkgdesc+=" (comprehensive variant)"
  _package 'toutesvariantes'
}

package_hunspell-fr-modern-ungendered() {
  pkgdesc+=" (modern variant)"
  _package 'moderne'
}

package_hunspell-fr-revised-ungendered() {
  pkgdesc+=" (revised variant)"
  _package 'reforme1990'
}

_package() {
  _dicname=$1
  cd "${srcdir}/hunspell-inclusif-${pkgver}"

  python3 scripts/generate-aff.py dicollecte/fr-${_dicname}.aff > fr.aff
  python3 scripts/generate-dic.py dicollecte/fr-${_dicname}.dic > fr.dic

  install -dm755 ${pkgdir}/usr/share/hunspell
  install -m644 fr.dic ${pkgdir}/usr/share/hunspell/fr_FR.dic
  install -m644 fr.aff ${pkgdir}/usr/share/hunspell/fr_FR.aff

  pushd "${pkgdir}"/usr/share/hunspell/
  aliases="fr_BE fr_CA fr_CH fr_LU"
  for lang in ${aliases}; do
    ln -s fr_FR.aff ${lang}.aff
    ln -s fr_FR.dic ${lang}.dic
  done
  popd

  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

  install -Dm644 README.md "${pkgdir}"/usr/share/doc/${pkgname}/README.md
}