1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#!/bin/bash
set -e
cliname=`basename "$0"`
cmdname=$1
scriptdir=`realpath \`dirname "$0"\``
srcdir=`realpath "$scriptdir/.."`
[ $# -gt 0 ] && shift
cli_help() {
echo "
Authselect Automation Scripts
Usage: $cliname [command]
Commands:
install-build-deps Install build dependencies.
make-srpm Make source RPM.
* Help
"
exit 1
}
# helper functions
die() {
echo "$*" 1>&2 ;
exit 1;
}
# push to authselect root directory
pushd "$scriptdir/.." &> /dev/null
case "$cmdname" in
install-build-deps)
. "$scriptdir/commands/install-build-deps.sh" "$@"
;;
make-srpm)
. "$scriptdir/commands/make-srpm.sh" "$@"
;;
*)
cli_help
;;
esac
popd
|