### this file is sourced not run
PKGVER=1.0     # version number - must contain a dot.
PKGBUILD=1     # build number - can be anything
PKGARCH=noarch # or x86_64, or i686, or armhf, etc

### template for package definition
TARBALL= # the package's tarball
MD5SUM=  # package's md5sum
SRC_URL= # source URL to download the package
BUNDLE=  # if the tarball is contained within a bundle
SLACKREQ=  # slackware pkg dependencies, space separated, will go to install/slack-required
SLACKDESC= # slackware pkg info (will go to install/slack-desc)
SLACKCON=  # slackware pkg conflict, space separated, will go to install/slack-conflicts
SLACKSUG=  # slackware pkg suggested pkg, space separated, will go to install/slack-suggest
SLACKINSTALL=   # slackware pkg install script install/doinst.sh
SLACKUNINSTALL= # slackware pkg uninstall script install/slack-uninstall.sh

#PKG_KEEPLA=yes  # don't remove the .la files
#PKG_NOBUILD=yes # don't run the build-step (don't enter chroot)
#PKG_NOSTRIP=yes # don't strip binaries
#PKG_NOMAKEPKG=yes # don't run makepkg, supposedly pkg_package will do actual packaging

### note: functions.sh provide default implementation of all these 

# No assumption on where it is called, just use parameter 
# return 0=good, anything else=bad
# $1-where-to-save (absolute path) $2-tarball-name $SRC_URL-source url
# functions.sh provides default with wget
pkg_download() {
	: do nothing
}

# Called within $CHROOT_DIR, $SRC_DIR, $PATCHES_DIR and $OUTPUT_DIR 
# with absolute path, to extract / patch package
# all path access *must* be relative otherwise it will affect host
# return 0=good, anything else=bad
# functions.sh provides default to check integrity and extract tarball 
pkg_prepare() {
	: do nothing
}

# Called within $CHROOT_DIR, $SRC_DIR and $OUTPUT_DIR available 
# with absolute path, to clean up stuff before it is packaged
# all path access *must* be relative otherwise it will affect host
# return 0=good, anything else=bad
# function.sh provides default that does nothing
# Note: pkg_package is optional, but if it exist it has to return success
pkg_package() {
	: do nothing
}

# Called from inside chroot, to build package. 
# Absolute path access is ok.
# return 0=good, anything else=bad
# functions.sh provides default that does configure make install and
# add slackdesc
pkg_build() { 
	return 1; # failure will force build-pkg.sh to drop to shell
	#sh       # this will also work
}
