# Maintainer: David Runge <dave@sleepmap.de>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Vincent Cappe <vcappe at gmail dot com>
# Contributor: Jeff Bailes <thepizzaking at gmail dot com>
# Contributor: SpepS <dreamspepser at yahoo dot it>

pkgname=liboggz
pkgver=1.1.3
pkgrel=1
pkgdesc="A simple programming interface for reading and writing Ogg files and streams"
arch=(x86_64 aarch64)
url="https://www.xiph.org/oggz/"
license=(BSD-3-Clause)
depends=(
  bash
  glibc
  libogg
)
makedepends=(
  doxygen
  git
)
provides=(liboggz.so)
source=(git+https://gitlab.xiph.org/xiph/liboggz#tag=$pkgver)
sha512sums=('ea985b6312b79db1d2276dbdf1da1762d76943acbc81cf2adc998d1f6980590074a811ff968d4fb510fd4bb77b1b1cea53fbfab4a0223f642cc3ab9843c851c0')
b2sums=('a7363c181079fcd5e3d5cc3a0c5c8ed217c31f73845113e36779985b745eae3defeef910c5226256a3ea7a85a49c84c283f368679bbf689161a29a0e294caeff')

prepare() {
  cd $pkgname
  ./autogen.sh
}

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

check() {
  cd $pkgname
  make check
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
  # license
  install -vDm 644 COPYING -t "$pkgdir/usr/share/licenses/$pkgname/"
  # bash completion
  install -vDm 644 bash-completion/oggz -t "$pkgdir/usr/share/bash-completion/completions/"
  # docs
  install -vDm 644 {AUTHORS,ChangeLog,NEWS,README,TODO} -t "$pkgdir/usr/share/doc/$pkgname/"
}
