pkgname=libseccomp
pkgver=2.6.0
pkgdesc='Enhanced seccomp library'
arch=(x86_64)
license=(LGPL-2.1-only)
homepage="https://github.com/seccomp/libseccomp"
checkdepends=(
  valgrind
)
sources=("${pkgname}-${pkgver}.tar.gz"
  "libseccomp-2.5.3-skip-valgrind.patch"
)
urls=("https://github.com/seccomp/libseccomp/releases/download/v${pkgver}/${sources[0]}"
  "libseccomp-2.5.3-skip-valgrind.patch"
)
md5sums=("2d42bcde31fd6e994fcf251a1f71d487"
  "1c13f03ff54cc6ccfdc21731d0a0847d"
)

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1

  # according to Gentoo, "Valgrind isn't supported on all arches (and indeed profiles for older types of some arches) so let's just skip the automagic Valgrind dependency entirely."
  patch -p1 -i ${filedir}/${sources[1]}
}

src_build() {
  ./configure --prefix=/usr    \
              --disable-static \
              --disable-python
  make
}

src_check() {
  make check
}

src_install() {
  make DESTDIR="${pkgdir}" install
  install -Dm 644 CHANGELOG README.md SECURITY.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}


# vim:ft=sh syn=sh et sw=2:
