#!/usr/bin/env /bin/sh # bldr - build a binary package from an Everest package file pkgs=("${@}") usage() { printf "${0} - Build a binary package from an Everest package file\n" printf "usage: ${0} [-h] [-v] [-b] PACKAGE\n" printf "\n" printf "${0} {-h --help} Show this message\n" printf "${0} {-v --version} Show the current version\n" printf "${0} {-b --build} Build specified packages\n" printf "\n" printf "bldr is free software.\n" printf "See the GNU GPL version 3 for details.\n" } usage_small() { printf "usage: ${0} [-h] [-v] [-b] PACKAGE\n" } check_if_input_is_blank() { if [[ "${@}" == "" ]]; then printf "No package(s) specified.\n" exit 1 fi } get_pkg_sources() { pkgs=("${@}") for p in $pkgs; do source ${p} getsource done } mkpkg() { pkgs=("${@}") for p in $pkgs; do source ${p} buildpkg installpkg done } case $1 in -h|--help) usage "$@" exit 0 ;; -v|--version) printf "bldr v1.0.0\n" printf "everest-build-tools v1.0.0\n" exit 0 ;; -b|--build) shift check_if_input_is_blank "$@" get_pkg_sources "$@" mkpkg "$@" ;; *) usage_small "$@" exit 1 esac usage_small "$@" exit 1