Files
Pmodules/compile_pmodules.sh
T
gsell 018fa873ad - BUILD_DOWNLOADSDIR renamed to PMODULES_DISTDIR
- BUILD_TMPDIR rename to PMODULES_TMPDIR
- both above can be configured via command line or config file
2015-10-05 17:41:07 +02:00

71 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
declare -r BOOTSTRAP_DIR=$(dirname "$0")
unset PMODULES_HOME
unset PMODULES_VERSION
source "${BOOTSTRAP_DIR}/Pmodules/libstd.bash"
source "${BOOTSTRAP_DIR}/config/environment.bash"
declare force='no'
while (( $# > 0 )); do
case $1 in
-f | --force )
force='yes'
;;
-* )
std::die 1 "$1: illegal option"
;;
* )
std::die 1 "No arguments are allowed."
;;
esac
shift 1
done
std::read_versions "${BOOTSTRAP_DIR}/config/versions.conf"
#if [[ -n ${PMODULES_DIR} ]] && [[ "${PMODULES_DIR}" != "/" ]] && [[ -d "${PMODULES_DIR}" ]]; then
# rm -rf "${PMODULES_DIR}"
#fi
build () {
local -r name="$1"
local -r version="$2"
"${BOOTSTRAP_DIR}/Pmodules/modbuild" "${BOOTSTRAP_DIR}/${name}/build" --disable-cleanup "${version}" || \
std::die 3 "Compiling '${name}' failed!"
}
if [[ ! -f "${PMODULES_HOME}/bin/base64" ]] || [[ ${force} == 'yes' ]]; then
build coreutils "${COREUTILS_VERSION}"
fi
if [[ ! -f "${PMODULES_HOME}/bin/xgettext" ]] || [[ ${force} == 'yes' ]]; then
build gettext "${GETTEXT_VERSION}"
fi
if [[ ! -f "${PMODULES_HOME}/bin/getopt" ]] || [[ ${force} == 'yes' ]]; then
build getopt "${GETOPT_VERSION}"
fi
if [[ ! -f "${PMODULES_HOME}/bin/dialog" ]] || [[ ${force} == 'yes' ]]; then
build dialog "${DIALOG_VERSION}"
fi
if [[ ! -f "${PMODULES_HOME}/bin/bash" ]] || [[ ${force} == 'yes' ]]; then
build bash "4.3.30"
fi
if [[ ! -e "${PMODULES_HOME}/bin/tclsh" ]] || [[ ${force} == 'yes' ]]; then
build Tcl "${TCL_VERSION}"
fi
if [[ ! -e "${PMODULES_HOME}/libexec/modulecmd.tcl" ]] || [[ ${force} == 'yes' ]]; then
build Modules "${MODULES_VERSION}" && \
mv -v "${PMODULES_HOME}/bin/modulecmd" "${PMODULES_HOME}/libexec/modulecmd.tcl"
fi
echo "Done..."