# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

# Note: USE=static-libs isn't great -- only PIC objects are provided.

EAPI="4"

inherit eutils

DESCRIPTION="high level interface to Linux seccomp filter"
HOMEPAGE="http://sourceforge.net/projects/libseccomp/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"

LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="amd64 x86 ~arm"
IUSE="static-libs tools"

src_compile() {
	emake V=1 include src
	use tools && emake tools
}

src_test() {
	emake V=1 include src tools tests
	cd tests
	./regression
}

src_install() {
	emake V=1 DESTDIR="${D}"
	use tools && dobin tools/scmp_sys_resolver
	use static-libs && dolib.a src/libseccomp.a
}