# Maintainer: Bruno Pagani <archange@archlinux.org>

pkgname=libfabric
pkgver=1.13.0
pkgrel=1
pkgdesc="User-space API for OpenFabrics Interfaces (OFI)"
arch=(x86_64)
url="https://ofiwg.github.io/libfabric/"
license=(GPL2)
depends=(glibc)
source=(https://github.com/ofiwg/libfabric/releases/download/v${pkgver}/libfabric-${pkgver}.tar.bz2)
sha512sums=(f78ea54e40fe65f6a09fa47788102442a363f3f5de7f3a3636a1c0d782a06e343353b79bd33d001aa369bfe26021e829bbe6088ee23e2a0ddd198de445595925)

prepare() {
  cd ${pkgname}-${pkgver}
  autoreconf -fvi
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd ${pkgname}-${pkgver}
  make test
}

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