# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=rdma-core
pkgver=57.0
pkgrel=0
pkgdesc="RDMA core userspace libraries and daemons"
url="https://github.com/linux-rdma/rdma-core"
license="GPL-2.0-only OR BSD-2-Clause"
arch="all !s390x" # s390x ftbfs
options="!check" # tests are for installation
depends_dev="$pkgname=$pkgver-r$pkgrel"
makedepends="
	cmake
	eudev-dev
	libdrm-dev
	libnl3-dev
	py3-docutils
	samurai
	"
subpackages="$pkgname-libs $pkgname-dev $pkgname-doc $pkgname-openrc"
source="https://github.com/linux-rdma/rdma-core/releases/download/v$pkgver/rdma-core-$pkgver.tar.gz"

build() {
	CFLAGS="$CFLAGS -flto=auto" \
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_SYSCONFDIR=/etc \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	rm -rf "$pkgdir"/usr/lib/systemd
}

sha512sums="
4a904d34af6863655545fe720cc25a8800684f63c51cebb67be2058363949217903957dc925c69d41294362ccff75fb0d37f3bc31cd6f6f252a804d6713f62cf  rdma-core-57.0.tar.gz
"
