# Maintainer: Juergen Mang <mail@jcgames.de>

pkgname=mympd
pkgver=10.1.1
pkgrel=1
pkgdesc="A standalone and mobile friendly web-based MPD client."
arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64')
url="https://jcorporation.github.io/myMPD/"
license=(GPL3)
depends=('flac' 'libid3tag' 'lua' 'openssl' 'pcre2')
makedepends=('cmake' 'gzip' 'jq' 'perl')
install=archlinux.install
source=("${pkgname}_${pkgver}.orig.tar.gz")
sha256sums=('SKIP')
options=(debug strip)

build() {
  local cmake_options=(
    -B build
    -S "${srcdir}"
    -DCMAKE_BUILD_TYPE=Release
    -DCMAKE_INSTALL_PREFIX=/usr
    -Wno-dev
  )

  cmake "${cmake_options[@]}"
  cmake --build build
}

check() {
  ctest --test-dir build --output-on-failure
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -vDm 644 "${srcdir}"/{CHANGELOG,README}.md -t "$pkgdir/usr/share/doc/$pkgname/"
}
