# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libseccomp
pkgver=2.3.2
pkgrel=0
pkgdesc="An interface to the Linux Kernel's syscall filtering mechanism"
url="https://github.com/seccomp/libseccomp"
arch="all"
license="LGPL-2.1"
makedepends="linux-headers"
checkdepends="bash"
subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/seccomp/libseccomp/releases/download/v$pkgver/libseccomp-$pkgver.tar.gz
	remove-redefinition-prctl.patch"
builddir="$srcdir/libseccomp-$pkgver"

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		|| return 1
	make || return 1
}

check() {
	cd "$builddir"
	make check || return 1
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install || return 1
}

sha512sums="0864a53ba2be61d0207f7361af94bcda4acff84a1814f915e6ccb19ab24f6ccc978da0eedc5cee047fa655dc1a583e2eeb7ab985ebfc77491c6a2606727b79ec  libseccomp-2.3.2.tar.gz
f2c31dcafdc9a1ad78e32e76b75e1c1603071eaa3f979e1f2483b879a34ad07e0a4ef3642196a695415cdf81e1ed2bf325175872fb4e203ef9d0e668c287493f  remove-redefinition-prctl.patch"
