# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Gustavo Alvarez <sl1pkn07@gmail.com>
# Contributor: Panagiotis Papadopoulos pano_90 AT gmx DOT net 
pkgname=libbs2b
pkgver=3.1.0
pkgrel=7.1
pkgdesc="Bauer stereophonic-to-binaural DSP effect library"
url="http://bs2b.sourceforge.net"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
license=('custom:MIT')
depends=(libsndfile)
provides=(libbs2b.so)
source=("https://downloads.sourceforge.net/sourceforge/bs2b/$pkgname-$pkgver.tar.lzma")
md5sums=('00d32ffa6461dde6a632c846da3e0a13')
sha1sums=('ec847e38a3a6f7eeed245b44e53f02cfff056df0')

prepare() {
  cd $pkgname-$pkgver
  sed -i 's/dist-lzma/dist-xz/g' configure.ac
  autoreconf -fvi
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd $pkgname-$pkgver
  make check
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
