# Maintainer: TBK <alpine@jjtc.eu>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@alpinelinux.org>
pkgname=libatomic_ops
pkgver=7.4.8
pkgrel=0
pkgdesc="Provides semi-portable access to hardware provided atomic memory operations"
arch="all"
url="https://github.com/ivmai/libatomic_ops"
license="GPL-2.0"
makedepends=""
subpackages="$pkgname-dev $pkgname-doc"
source="$url/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz"
builddir="$srcdir/"$pkgname-$pkgver

case "$CARCH" in
s390x) options="!check" ;; # FIXME
esac

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-shared \
		--disable-static
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	install -Dm644 doc/LICENSING.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="d03bcb946f8143bf79c1f44ef0637d0462efc1eb7a0abf15231341f0f9193dd2d57a17f0670a95fda3731642f444a85d0944f86447cff8e69bc851b8d5acc863  libatomic_ops-7.4.8.tar.gz"
