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

case (CARCH) {
s390x { setvar options = ""!check"" } # FIXME
}

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

proc check {
	cd $builddir
	make check
}

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

setvar sha512sums = ""29c6f937aa5d21343741aa0661aaf33ec9196b7784b7165d40dd87ce7bf8a7691f5ba94040663f078465ded1935ca01bb829a4b56b190f9db63cc141515d9819  libatomic_ops-7.4.6.tar.gz""