# Maintainer: Hugo Doria <hugo@archlinux.org>

pkgname=libcap
pkgver=2.20
pkgrel=1
pkgdesc="POSIX 1003.1e capabilities"
arch=('i686' 'x86_64')
url="http://www.kernel.org/pub/linux/libs/security/linux-privs/"
license=('GPL')
depends=('glibc' 'attr')
install="$pkgname.install"
source=("http://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/${pkgname}-${pkgver}.tar.gz")
md5sums=('8ce6905851ffdde287d00d8269775ade')

build() {
  cd "$srcdir/$pkgname-$pkgver/"
  
  sed -i -e "s|LIBDIR=\$(FAKEROOT)\$(lib_prefix)/\$(lib)|LIBDIR=\$(FAKEROOT)/\$(lib)|g" Make.Rules
}

package() {
  cd "$srcdir/$pkgname-$pkgver/"
  
  # We tell the installer to not attempt to use the 'setcap' binary
  # so the PKGBUILD will work as a normal user. We then replicate its
  # functionality in the .install file.
  make prefix=/usr DESTDIR=${pkgdir} RAISE_SETFCAP=no install
  
  rm ${pkgdir}/lib/*.a
  chmod 755 ${pkgdir}/lib/libcap.so.${pkgver}
}

# vim:set ts=2 sw=2 et:
