# Maintainer: FWS
pkgname=fws-dnd
pkgver=2.0.0
pkgrel=1
pkgdesc="Gestionnaire D&D 5e pour FWS (GTK4) : dés, créateur de personnage (règles officielles), grimoire, sessions, tracker de combat"
arch=('any')
url="https://fws.local/fws-dnd"
license=('MIT')
depends=('python' 'python-gobject' 'gtk4')
source=("${pkgname}-${pkgver}.tar.gz")
sha256sums=('SKIP')

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # Module Python (application GTK4)
  install -d "${pkgdir}/usr/share/${pkgname}"
  cp -r gui/fwsdnd "${pkgdir}/usr/share/${pkgname}/"
  # pas de bytecode pré-généré dans le paquet
  find "${pkgdir}/usr/share/${pkgname}" -name '__pycache__' -type d -exec rm -rf {} +

  # Exécutable
  install -Dm755 bin/fws-dnd "${pkgdir}/usr/bin/fws-dnd"

  # Intégration bureau
  install -Dm644 fws-dnd.desktop "${pkgdir}/usr/share/applications/fws-dnd.desktop"
  install -Dm644 fws-dnd.svg "${pkgdir}/usr/share/icons/hicolor/scalable/apps/fws-dnd.svg"

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