# Maintainer: Anatol Pomozov

pkgname=aws-c-auth
pkgver=0.7.1
pkgrel=1
pkgdesc='C99 library implementation of AWS client-side authentication: standard credentials providers and signing'
arch=(x86_64 aarch64)
url='https://github.com/awslabs/aws-c-auth'
license=(Apache)
depends=(aws-c-common aws-c-http aws-c-sdkutils)
makedepends=(cmake)
source=(aws-c-auth-$pkgver.zip::https://github.com/awslabs/aws-c-auth/archive/v$pkgver.zip)
sha256sums=('79d43cebb3244b3a0667186166f1a3cbc176e9f5b717b275413b5e0458c5127c')

build() {
  cd aws-c-auth-$pkgver

  cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -S . -B build
  cmake --build build
}

check() {
  cd aws-c-auth-$pkgver
  cmake --build build --target test
}

package() {
  cd aws-c-auth-$pkgver

  cmake --build build --target install -- DESTDIR="$pkgdir/"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
