# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=alsa-ucm-conf
pkgver=1.2.13
pkgrel=2
pkgdesc="ALSA Use Case Manager configuration (and topologies)"
arch=(any)
url="https://alsa-project.org/"
license=(BSD-3-Clause)
source=(
  $url/files/pub/lib/$pkgname-$pkgver.tar.bz2{,.sig}
  $pkgname-1_2_13-backport-sound-handling-fix.patch::https://github.com/alsa-project/alsa-ucm-conf/commit/11b028a9a01e47fc9b48e4a566803752011902e2.patch
)
sha512sums=('cad867268851ac178f3a5378a00e292184b0e0ec7955f297ae7ed56073d3dddb06c08666b23b1bf6b0065068a9370ee34608bd687763658c79d34b64059b1c85'
            'SKIP'
            'f181afad491377cf6fc0f6116d8b6a771b28cf6459d317f3055e936261b9d7222c517e84fbde0a798580555563abef26d3d3cbb6d73fb3980868b54b9f094058')
b2sums=('87e4bf2285961e316ca853e9245e02447ea9e60fa506e124c072e2b6ed71345fc0c30b19bf8c849f8123a6b95a4facd22225eafccba8164266961110a60ef44c'
        'SKIP'
        '7c2f91e60a4c5c51e68a7e57dd291b126e0454667c5cc0ae7de4403fe843a4d9c9551a30aa53e13693b667e304af71d6707b4692921ad40376ee7e231c810c44')
validpgpkeys=('F04DF50737AC1A884C4B3D718380596DA6E59C91') # ALSA Release Team (Package Signing Key v1) <release@alsa-project.org>

prepare() {
  patch --forward --strip=1 --directory=$pkgname-$pkgver \
        --input=../$pkgname-1_2_13-backport-sound-handling-fix.patch
}

package() {
  cd $pkgname-$pkgver
  install -vdm 755 "$pkgdir/usr/share/alsa/"
  cp -av ucm2 "$pkgdir/usr/share/alsa/"
  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
  install -vDm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
  install -vDm 644 ucm2/README.md -t "$pkgdir/usr/share/doc/$pkgname/ucm2"
}
