# Maintainer: Kyle Fuller <kyle@fuller.li>
# Contributor: George Rawlinson <grawlinson@archlinux.org>

pkgname=znc-palaver
pkgver=1.2.2
pkgrel=1
pkgdesc='ZNC module for push notifications from Palaver'
arch=('x86_64')
url='https://github.com/cocodelabs/znc-palaver'
license=('MIT')
depends=('znc=1.8.2') # modules require recompilation on every version change
makedepends=(
  'git'
  'python'
  'cmake'
)
checkdepends=(
  'python-pytest'
  'python-pytest-asyncio'
  'python-semantic-version'
)
_commit='da992b24a567aa56a825629685cad5f2376ce6c4'
source=("git+https://github.com/cocodelabs/znc-palaver.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  git describe --tags | sed 's/^v//'
}

build() {
  cd "$pkgname"

  make
}

check() {
  cd "$pkgname"

  make test-integration
}

package() {
  cd "$pkgname"

  install -vDm755 -t "$pkgdir/usr/lib/znc" palaver.so

  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}