#!/usr/bin/env build pkg_post_install() { true; } build_make_install() {( echo "installing: ${1}" load_rules "${1}" if [ ! -f "${BUILDER_ATFDIR}/${CATEGORY}/${NAME}-${VERSION}-${RELEASE}.${ARCHIVE_FORMAT}" ]; then die "archive does not exist for package '${NAME}'" fi if [ ! -d "${SYSROOT}" ]; then mkdir -p "${SYSROOT}" || die "failed to create system root @ '${SYSROOT}'" fi # FIXME the builder configs should decide the binpkg archive format. case "${ARCHIVE_FORMAT}" in (tbz2|tar.bz2) ARCHIVE_DECOMPRESSOR="bzip2 -dc";; (tgz|tar.gz) ARCHIVE_DECOMPRESSOR="gzip -dc";; (*) die "unsupported archive format '${ARCHIVE_FORMAT}'";; esac cd "${SYSROOT}" if [ -f "${SYSROOT}/var/db/binpkgs/${CATEGORY}/${NAME}" ]; then echo "${NAME}: removing previous version" cat "var/db/binpkgs/${CATEGORY}/${NAME}" | xargs -0 rm -f rm "var/db/binpkgs/${CATEGORY}/${NAME}" fi ${ARCHIVE_DECOMPRESSOR} "${BUILDER_ATFDIR}/${CATEGORY}/${NAME}-${VERSION}-${RELEASE}.${ARCHIVE_FORMAT}" | tar x touch "${SYSROOT}/var/db/binpkgs/${CATEGORY}/${NAME}" pkg_post_install )} if test "${BUILDER_CALL_STACK}" = '__main__'; then simple_usage 'install' '[all|[/]]' "$@" build_make_install "${@}" fi # vim: filetype=sh