#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=alsa-utils
pkgver=1.2.8
pkgrel=01
pkgdesc="Advanced Linux Sound Architecture - Utilities"
arch=(x86_64)
url="https://www.alsa-project.org"
depends=(glibc pciutils psmisc)
makedepends=(alsa-lib docbook-xsl fftw libsamplerate ncurses python-docutils xmlto)
optdepends=('fftw: for alsabat')
# we require /var/lib/alsa for state file
options=(emptydirs)
#options=(debug emptydirs)  ##  uncomment this to have debug pkg produced
source=(https://www.alsa-project.org/files/pub/utils/$pkgname-$pkgver.tar.bz2{,.sig})

prepare() {
  cd $pkgname-$pkgver
  autoreconf -fiv
}

build() {
  cd "$pkgname-$pkgver"
  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --disable-alsaconf \
    --with-udev-rules-dir=/usr/lib/udev/rules.d \
    --with-systemdsystemunitdir=no
  make
}

check() {
  make -k check -C $pkgname-$pkgver
}

package() {
  depends+=(libasound.so libatopology.so libformw.so libmenuw.so libncursesw.so
  libpanelw.so libsamplerate.so)

  make DESTDIR="$pkgdir" install -C $pkgname-$pkgver
  install -vDm 644 $pkgname-$pkgver/README.md -t "$pkgdir/usr/share/doc/$pkgname/"
  # dir where to save ALSA state
  install -vdm 755 "$pkgdir/var/lib/alsa/"

}


#---- license gpg-key sha256sums ----

license=(GPL2)

validpgpkeys=('F04DF50737AC1A884C4B3D718380596DA6E59C91') # ALSA Release Team (Package Signing Key v1) <release@alsa-project.org>

sha256sums=(e140fa604c351f36bd72167c8860c69d81b964ae6ab53992d6434dde38e9333c  # alsa-utils-1.2.8.tar.bz2
	789900ad75d1509e99711077847815b24dc5ca191e99237aff04aebba6bf1114) # alsa-utils-1.2.8.tar.bz2.sig

