#!/usr/bin/env bash # set -x # uncomment for debug # Builds packages from ABS recursively. It tries to find dependencies that # aren't built or need update and then makepkg them in order. usage() { print "Usage: %s [OPTIONS] [BUILD_DIR]" "${0##*/}" print "A (libre)makepkg wrapper that will also build dependencies" echo prose "More directly, it wraps fullpkg-find and fullpkg-build; fullpkg-find finds the dependencies, and sets them up in BUILD_DIR; then fullpkg-build builds them." echo prose "This script will check dependencies, build them if possible and stage the packages on its repo." echo prose "If no BUILD_DIR is specified, it will create a temporary directory." echo print "Options:" flag '-h' "Show this message" } while getopts 'h' arg; do case "$arg" in h) usage; exit 0 ;; esac done shift $(( OPTIND - 1 )) build_dir="${1:-$(mktemp -d /tmp/fullpkg.XXXXXX)}" fullpkg-find "$build_dir" && fullpkg-build -N "$build_dir" exit 0