#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=libcap
pkgver=2.66
pkgrel=01
pkgdesc='POSIX 1003.1e capabilities'
arch=('x86_64')
url="https://sites.google.com/site/fullycapable/"
depends=('glibc' 'pam')
makedepends=('linux-api-headers')
provides=('libcap.so' 'libpsx.so')
#options=(debug)
source=("https://kernel.org/pub/linux/libs/security/linux-privs/${pkgname}2/${pkgname}-$pkgver.tar."{xz,sign} 
)

build() {
  make DYNAMIC=yes KERNEL_HEADERS=/usr/include lib=lib prefix=/usr sbindir=bin -C $pkgname-$pkgver
}

check() {
  make test -k -C $pkgname-$pkgver
}

package() {
  make DESTDIR="$pkgdir" RAISE_SETFCAP=no lib=lib prefix=/usr sbindir=bin install -C $pkgname-$pkgver
  install -vDm 644 $pkgname-$pkgver/{CHANGELOG,README} -t "$pkgdir/usr/share/doc/$pkgname/"
  install -vDm 644 $pkgname-$pkgver/pam_cap/capability.conf -t "$pkgdir/usr/share/doc/$pkgname/examples/"
}

#---- license gpg-key sha256sums ----

license=('GPL2')

validpgpkeys=(38A644698C69787344E954CE29EE848AE2CCF3F4) # Andrew G. Morgan <morgan@kernel.org>

sha256sums=(15c40ededb3003d70a283fe587a36b7d19c8b3b554e33f86129c059a4bb466b2 #  libcap-2.66.tar.xz
	c831cd6be9961544ce511aa5dba811a5c6ef875ddd43cbe73daef5268eddaac1) # libcap-2.66.tar.sign
