# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=libbytesize
pkgver=2.11
pkgrel=1
pkgdesc='A tiny library providing a C "class" for working with arbitrary big sizes in bytes'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url="https://github.com/storaged-project/libbytesize"
license=('LGPL')
depends=('mpfr' 'pcre2')
makedepends=('python')
checkdepends=('python-polib')
source=("$pkgname-$pkgver.tar.gz::https://github.com/rhinstaller/libbytesize/archive/$pkgver.tar.gz")
sha512sums=('57f6515b25e22819339dccbb23b1f9863592c5d82f20decaae1178d2fc5c56f46367cf4ea2efca7e41eefd8ea33df1a1b1001e254eda6209751518a3120db9f5')

build() {
  cd "$srcdir"/$pkgname-$pkgver
  ./autogen.sh
  ./configure --prefix=/usr
  make
}

check() {
  cd "$srcdir"/$pkgname-$pkgver
  make check TESTS=libbytesize_unittest.sh
}

package() {
  cd "$srcdir"/$pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}
