#!/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=tinycompress
pkgver=1.2.8
pkgrel=02
pkgdesc="This library provides the APIs to open an ALSA compressed device and read/write compressed data like MP3 etc to it"
ARCHpkgdesc="ALSA compressed device interface"
url="https://github.com/alsa-project/tinycompress"
arch=(x86_64)
depends=(glibc)
makedepends=(ffmpeg git)
optdepends=("ffmpeg: fcplay utility")
provides=(libtinycompress.so)
#options=(debug)
_commit=750ebbe68e48178fae1732aa169fdc8f46fec6fa  # tags/v1.2.8^0
source=("git+$url#commit=$_commit")

pkgver() {
  cd tinycompress
  git describe --tags | sed 's/^v//;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  mkdir -p build

  cd tinycompress
  ./autogen.sh
}

build() {
  local configure_options=(
    --prefix=/usr
    --sysconfdir=/etc
    --localstatedir=/var
    --enable-fcplay
  )

  cd build
  ../tinycompress/configure "${configure_options[@]}"
  make
}

check() {
  make -C build check
}

package() {
  make -C build install DESTDIR="$pkgdir"
  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 tinycompress/COPYING
}

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

license=(BSD LGPL2.1)

sha256sums=(SKIP)


