# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=libdca
pkgver=0.0.7
pkgrel=2
pkgdesc='Library for decoding DTS Coherent Acoustics streams'
arch=('x86_64')
url='https://www.videolan.org/developers/libdca.html'
license=('GPL-2.0-or-later')
depends=('bash' 'glibc')
makedepends=('git')
source=("git+https://code.videolan.org/videolan/libdca.git?signed#tag=$pkgver")
b2sums=('0c290c4fcebe4b3ff4131ba9cc6ce5e77ce77a84ee034640edcbfa151bc980885caa2369406e504345391b17cd3f37bbc9cdd036556210848199b5f781132e57')

prepare() {
  cd $pkgname

  # Don't install symlink for libdts.a
  sed -i '/libdts.a/d' libdca/Makefile.am

  # Update symlinks to use compressed man pages
  sed -i '/DESTDIR/ s/\.1/.1.gz/g' src/Makefile.am

  autoreconf -fi
}

build() {
  cd $pkgname
  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
