# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>

pkgname=libmd
pkgver=1.1.0
pkgrel=1
pkgdesc="Message Digest functions from BSD systems"
arch=('i686' 'x86_64')
url="https://www.hadrons.org/software/libmd/"
makedepends=("gcc" "autotools" "make")
license=('spdx:BSD-2-Clause OR BSD-3-Clause OR ISC')
source=("https://libbsd.freedesktop.org/releases/$pkgname-$pkgver.tar.xz"{,.asc})
sha256sums=('1bd6aa42275313af3141c7cf2e5b964e8b1fd488025caf2f971f43b00776b332'
            'SKIP')
validpgpkeys=('4F3E74F436050C10F5696574B972BF3EA4AE57A3') # Guillem Jover

prepare() {
  cd "${pkgname}-${pkgver}"

  autoreconf -vfi
}

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

check() {
  cd "${pkgname}-${pkgver}"
  make -k check
}

package() {
  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  install -Dm644 COPYING -t "${pkgdir}"/usr/share/licenses/${pkgname}/
}
