### this file is sourced not run
PKGVER=2.4.1
PKGBUILD=1
PKGARCH=noarch

# source: james
# this is how we securely handle external package

TARBALL=findnrun-${PKGVER}.tar.xz
MD5SUM=c85f86f688f3adb483940f1d35034eb1
SRC_URL="https://docs.google.com/uc?id=0B932fvbgcXnMSTRuNDI2SHF4d1k&export=download"
BUNDLE=

SLACKREQ=  # internal copy
SLACKDESC= # internal copy 

PKG_NOMAKEPKG=yes

### default pkg_download
### prepare
pkg_prepare() {
	if pkg_check $SRC_DIR $TARBALL $MD5SUM; then
		cp $SRC_DIR/$TARBALL tmp/pkg
	else
		return 1		
	fi
}

### default pkg_package
### build
pkg_build() {
	# extract and delete scripts
	# process in chroot, so bad things cannot impact the host
	
	mkdir /tmp/build && cd /tmp/build &&
	tar -xf /tmp/pkg/$TARBALL &&
	rm -f install/{doinst.sh,slack-uninstall.sh} # remove scripts
}

pkg_package() {
	# run makepkg ourselves to preseve original build recipes
	# and only process files inside /tmp/build, so any excess files
	# installed outside this, are not processed.
	cd tmp/build &&
	$MAKEPKG -c n -l n $OUTPUT_DIR/$PKG.$PKG_TYPE > /dev/null 2>&1
}

