# Maintainer:
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Aaron Griffin <aaron@archlinux.org>

pkgname=fakechroot
pkgver=2.20.1
pkgrel=2
pkgdesc="Gives a fake chroot environment"
arch=('x86_64')
url="https://github.com/dex4er/fakechroot/wiki"
license=('LGPL')
depends=('sh' 'perl')
source=($pkgname-$pkgver.tar.gz::https://github.com/dex4er/fakechroot/archive/${pkgver}.tar.gz)
md5sums=('69612efa06636e79a56898512222b0fc')


build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --sbindir=/usr/bin \
    --libdir=/usr/lib/libfakeroot --sysconfdir=/etc
  make
}

check() {
  cd $pkgname-$pkgver

  # t/fts.t fails when building on BTRFS...  (really!)
  make -k check
}
  
package() {
  cd $pkgname-$pkgver
  make DESTDIR="${pkgdir}" install
  
  install -dm755 "${pkgdir}"/etc/ld.so.conf.d/
  echo '/usr/lib/libfakeroot/fakechroot/' > "${pkgdir}"/etc/ld.so.conf.d/fakechroot.conf
}
