pkgname=libcap
pkgver=2.76
pkgdesc="POSIX 1003.1e capabilities"
homepage="https://sites.google.com/site/fullycapable/"
license=('BSD-3-Clause OR GPL-2.0-only')
sources=("${pkgname}-${pkgver}.tar.xz")
urls=("https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/${sources[0]}")
md5sums=("449ade7d620b5c4eeb15a632fbaa4f74")


src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
  sed -i '/install -m.*STA/d' libcap/Makefile
}

src_build() {
  make prefix=/usr lib=lib
}

src_check() {
  make test
}

src_install() {
  make prefix=/usr lib=lib DESTDIR="${pkgdir}" install
  install -vDm 644 License -t "$pkgdir/usr/share/licenses/$pkgname/"
}
