### this file is sourced not run
PKGVER=5.1.0
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=proot-$PKGVER.tar.xz
MD5SUM=829941bb171b31cd1aa223131227870a
SRC_URL=https://github.com/proot-me/PRoot/archive/v$PKGVER.tar.gz
BUNDLE=

SLACKREQ='libtalloc libarchive' # liblzo2 build-time only
SLACKDESC="proot: proot $PKGVER (Non-privileged chroot)  
proot:  
proot: PRoot is a user-space implementation of chroot, bind-mount, and 
proot: binfmt_misc, enabling non-root users to use an arbitrary directory as 
proot: the new root filesystem, make files accessible somewhere else in the 
proot: filesystem hierarchy, or executing programs built for another CPU 
proot: architecture transparently through QEMU user-mode. This package also 
proot: comes with CARE, a tool to create an archive that contains all the 
proot: material required to re-execute it in the same context.  
proot: 
proot: http://proot.me/
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/PRoot* &&
	patch -Np1 -i $CHROOT_DIR/tmp/pkg/proot-4.0.3-build.patch
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/PRoot*/src
	
	# bins
	make proot care &&
	make PREFIX=/usr install install-care &&
	
	# docs
	cd .. &&
	cp doc/proot/man.1 /usr/share/man/man1/proot.1 &&	
	mkdir -p /usr/share/doc/proot &&
	cp -a doc /usr/share/doc/proot &&
	
	pkg_build_slackdesc
}
