#!/usr/bin/env build build_make_source_cleanup() { for arg in ${BUILD_SOURCE_CLEAN}; do if [ -d "${arg}" ]; then rm -rf "${arg}" elif [ -f "${arg}" ]; then rm "${arg}" fi done } build_make_source() {( build-make-prep "${1}" trap build_make_source_cleanup 0 echo "building source: ${1}" load_rules "${1}" if [ -d "${BUILDER_PKGDIR}/${CATEGORY}/${NAME}/source" ]; then die "source already exists for '${CATEGORY}/${NAME}'" fi mkenv "source" PKG_LOGFILE="${L}/source.log" mv "${S}" "${BUILDER_PKGDIR}/${CATEGORY}/${NAME}/source" >> "${PKG_LOGFILE}" 2>&1 )} if test "${BUILDER_CALL_STACK}" = '__main__'; then simple_usage 'source' '[all|[/]]' "$@" build_make_source "${@}" fi # vim: filetype=sh