packager="Great-OS Team"
maintainer="sipo"

description="Gives a fake chroot environment"
url="https://github.com/dex4er/fakechroot/wiki"

name=fakechroot
version=2.20.1

PKGMK_KEEP_SOURCES="no"

source=(https://github.com/dex4er/fakechroot/archive/$version.tar.gz
        fakechroot-2.20.1-glibc-2.33.patch)

build(){

  cd ${name}-${version}

  patch -Np1 -i ../fakechroot-2.20.1-glibc-2.33.patch

  ./configure --prefix=/usr \
              --sbindir=/usr/bin \
              --libdir=/usr/lib/libfakeroot \
              --sysconfdir=/etc
  make
}
  
package() {

  cd ${name}-${version}
  make DESTDIR=${PKG} install
  
  install -dm755 ${PKG}/etc/ld.so.conf.d/
  echo '/usr/lib/libfakeroot/fakechroot/' > ${PKG}/etc/ld.so.conf.d/fakechroot.conf
  rm $PKG/usr/lib/libfakeroot/fakechroot/libfakechroot.la
  
}
