# Maintainer: Coleacanthus <uwu@coelacanthus.name>

_pkgname=globalplatformpro
pkgname=${_pkgname}-git
pkgver=26.06.04.r8.g1ae44dc
pkgrel=1
pkgdesc="Manage applets and keys on JavaCard-s like a pro"
arch=('any')
url="https://github.com/martinpaljak/GlobalPlatformPro"
license=('LGPL-3.0-or-later AND MIT')
depends=(
  'bash'
  'java-runtime-headless=21'
  'pcsclite'
)
makedepends=(
  'git'
  'java-environment=17'
  'maven'
  'which'
)
conflicts=('globalplatformpro')
provides=('globalplatformpro')
source=(
  "$_pkgname::git+https://github.com/martinpaljak/GlobalPlatformPro.git"
  'gpp'
)
b2sums=('SKIP'
        'd2831bd58c1efc43a3e3460d4deef5067252141562e3825ce9054655ac9b949fc100549136de062d35a2147eb68b277c17fe0041de0e8b88af0800a85aa570f5')

pkgver() {
  cd $_pkgname
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd $_pkgname
}

build() {
  cd $_pkgname
  mvn package
}

package() {
  install -Dm755 gpp -t "$pkgdir"/usr/bin/
  cd $_pkgname
  install -Dm644 tool/target/gp.jar -t "$pkgdir"/usr/share/java/"$_pkgname"
  install -Dm644 README.md -t "$pkgdir"/usr/share/licenses/"$pkgname"
}
# vim:set ts=2 sw=2 et:
