#!/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 "${BUILDER_SYSDIR}" ]; then mkdir -p "${BUILDER_SYSDIR}" || die "failed to create system root @ '${BUILDER_SYSDIR}'" 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 "${BUILDER_SYSDIR}" if [ -f "${BUILDER_SYSDIR}/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 "${BUILDER_SYSDIR}/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