makedist/makedist/makedist

81 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
# makedist - main program
# Copyright (c) 2007-2011 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
#
makedist_me="${0##*/}"
MAKEDIST_DIR=/usr/share/makedist
MAKEDIST_DEFS=$MAKEDIST_DIR/defs.inc.sh
[ -e $MAKEDIST_DIR ] || {
echo "Error: missing makedist directory $MAKEDIST_DIR."
echo "Please check your installation; aborting."
exit 1
}
[ -e $MAKEDIST_DIR/defs.inc.sh ] || {
echo "Error: missing makedist definitions file $MAKEDIST_DEFS."
echo "Please check your installation; aborting."
exit 1
}
[ "`id -u`" = "0" ] || {
echo "Error: you must be root to run makedist; aborting."
exit 1
}
opts=($@)
while test -n "$1" ; do
case $1 in
PLATFORM=*) eval $1 ;;
SUBPLATFORM=*) eval $1 ;;
ARCH=*) eval $1 ;;
KERNEL_EXTRAVER=*) eval $1 ;;
DISTROMATIC=*) eval $1 ;;
RELEASE=*) eval $1 ;;
VARIANT=*) eval $1 ;;
*) [ -z "$TARGET" ] && TARGET=$1 ;;
esac
shift
done
. $MAKEDIST_DIR/defs.inc.sh "$TARGET" "$PLATFORM" "$SUBPLATFORM" "$ARCH" "$KERNEL_EXTRAVER" "$DISTROMATIC" "$RELEASE" "$VARIANT"
copyleft="\
makedist media (CD/DVD/Images) creator for RPM based distributions
version $makedist_version
Copyright (c) 2003-2011 by Silvan Calarco <silvan.calarco@mambasoft.it>
Copyright (c) 2003-2005 by Davide Madrisan <davide.madrisan@gmail.com>
"
echo "$copyleft"
function usage() {
echo "\
usage: $makedist_me target [VAR=value]...
Supported variables:
PLATFORM=<platform> : final media platform (e.g. livecd)
SUBPLATFORM=<subplatform> : intermediate platform used by final media platform (e.g. livecd-root)
VARIANT=<variant> : platform variant
RELEASE=<release> : target release
DEBUG=<debuglevel> : debug level
DISTROMATIC=off : disable distromatic
VERBOSE=<level> : level of verbosity
LANGUAGE=<lang> : target language
ARCH=<arch> : target arch
KERNEL_EXTRAVER=<target> : kernel target
Available targets:
`ls $TARGETSDIR`
" >&2
}
[ "$TARGET" ] || { usage; exit 1; }
make --no-print-directory -C $MAKEDIST_DIR ${opts[*]}