Commit eee5c158 authored by gsell's avatar gsell

- Bootstrap/ moved one level up

- pmodules.xyz() functions renamed to pbuild::xyz()
- use pbuild for bootstrapping components
parent 99a7feb8
#!/bin/bash #!/usr/bin/env pbuild
#set -o functrace
source "$(dirname $0)/../../../lib/libpmodules.bash"
TCL_DIR="${PMODULES_ROOT}/Tools/Pmodules/${PMODULES_VERSION}" TCL_DIR="${PMODULES_ROOT}/Tools/Pmodules/${PMODULES_VERSION}"
......
#!/bin/bash #!/usr/bin/env pbuild
source "$(dirname $0)/../../../lib/libpmodules.bash"
pmodules.configure() { pmodules.configure() {
case ${OS} in case ${OS} in
......
#!/bin/bash #!/usr/bin/env pbuild
source "$(dirname $0)/../../../lib/libpmodules.bash"
pmodules.configure() { pmodules.configure() {
"${MODULE_SRCDIR}"/configure \ "${MODULE_SRCDIR}"/configure \
......
#!/bin/bash #!/bin/bash
declare -r BASE_DIR=$(cd "$(dirname $0)/../.." && pwd) declare -r BASE_DIR=$(cd "$(dirname $0)/../.." && pwd)
declare -r BOOTSTRAP_DIR="${BASE_DIR}/scripts/Bootstrap" declare -r BOOTSTRAP_DIR="${BASE_DIR}/Bootstrap"
${BOOTSTRAP_DIR}/compile_pmodules.sh ${BOOTSTRAP_DIR}/compile_pmodules.sh
${BOOTSTRAP_DIR}/install_pmodules.sh ${BOOTSTRAP_DIR}/install_pmodules.sh
......
#!/bin/bash #!/bin/bash
declare -r BASE_DIR=$(cd "$(dirname $0)/../.." && pwd) declare -r BASE_DIR=$(cd "$(dirname $0)/.." && pwd)
declare -r BOOTSTRAP_DIR="${BASE_DIR}/scripts/Bootstrap" declare -r BOOTSTRAP_DIR="${BASE_DIR}/Bootstrap"
source "${BASE_DIR}/lib/lib.bash" source "${BASE_DIR}/lib/lib.bash"
......
#!/bin/bash #!/usr/bin/env pbuild
source "$(dirname $0)/../../../lib/libpmodules.bash"
pmodules.configure() { pmodules.configure() {
"${MODULE_SRCDIR}"/configure \ "${MODULE_SRCDIR}"/configure \
......
#!/usr/bin/env pbuild
pmodules.configure() {
"${MODULE_SRCDIR}"/configure \
--prefix="${PREFIX}" \
|| exit 1
}
pmodules.add_to_group 'Tools'
pmodules.make_all
#!/bin/bash #!/usr/bin/env pbuild
source "$(dirname $0)/../../../lib/libpmodules.bash"
pmodules.configure() { pmodules.configure() {
"${MODULE_SRCDIR}"/configure \ "${MODULE_SRCDIR}"/configure \
......
#!/bin/bash #!/usr/bin/env pbuild
source "$(dirname $0)/../../../lib/libpmodules.bash"
pmodules.configure() { pmodules.configure() {
: :
......
#!/bin/bash #!/usr/bin/env pbuild
source "$(dirname $0)/../../../lib/libpmodules.bash"
pmodules.configure() { pmodules.configure() {
"${MODULE_SRCDIR}"/configure \ "${MODULE_SRCDIR}"/configure \
......
#!/bin/bash #!/bin/bash
declare -r BASE_DIR=$(cd "$(dirname $0)/../.." && pwd) declare -r BASE_DIR=$(cd "$(dirname $0)/.." && pwd)
declare -r BOOTSTRAP_DIR="${BASE_DIR}/scripts/Bootstrap" declare -r BOOTSTRAP_DIR="${BASE_DIR}/Bootstrap"
declare -r SRC_DIR="${BOOTSTRAP_DIR}/Pmodules" declare -r SRC_DIR="${BOOTSTRAP_DIR}/Pmodules"
source "${BASE_DIR}/lib/lib.bash" source "${BASE_DIR}/lib/lib.bash"
......
#!/bin/bash
source $(dirname $0)/../lib/lib.bash
declare -rx BUILD_BLOCK=$(std::abspath "$1")
declare -rx BUILD_BLOCK_DIR=$(dirname "${BUILD_BLOCK}")
shift 1
source $(dirname $0)/../lib/libpmodules.bash
source "${BUILD_BLOCK}"
...@@ -6,9 +6,12 @@ unset CDPATH ...@@ -6,9 +6,12 @@ unset CDPATH
shopt -s expand_aliases shopt -s expand_aliases
declare -rx ARGS="$@" declare -rx ARGS="$@"
if [[ -z ${BUILD_BLOCK} ]]; then
# legacy support for 'old-style' build-blocks
declare -r BUILD_BLOCK_DIR=$( cd $(dirname "$0") && pwd )
declare -r BUILD_BLOCK="${BUILD_BLOCK_DIR}"/$(basename "$0")
fi
declare -r BUILDSCRIPT_DIR=$( cd $(dirname "$0") && pwd )
declare -r BUILDSCRIPT="${BUILDSCRIPT_DIR}"/$(basename "$0")
declare -rx SHLIBDIR=$( cd $(dirname "$BASH_SOURCE") && pwd ) declare -rx SHLIBDIR=$( cd $(dirname "$BASH_SOURCE") && pwd )
source "${SHLIBDIR}/lib.bash" source "${SHLIBDIR}/lib.bash"
...@@ -115,7 +118,7 @@ is_release () { ...@@ -115,7 +118,7 @@ is_release () {
# #
# $1: OS (as printed by 'uname -s') # $1: OS (as printed by 'uname -s')
# #
pmodules.supported_os() { pbuild::supported_os() {
for os in "$@"; do for os in "$@"; do
[[ ${os} == ${OS} ]] && return 0 [[ ${os} == ${OS} ]] && return 0
done done
...@@ -128,7 +131,7 @@ pmodules.supported_os() { ...@@ -128,7 +131,7 @@ pmodules.supported_os() {
# #
# $1: group # $1: group
# #
pmodules.add_to_group() { pbuild::add_to_group() {
if [[ -z ${1} ]]; then if [[ -z ${1} ]]; then
std::die 42 "${FUNCNAME}: Missing group argument." std::die 42 "${FUNCNAME}: Missing group argument."
fi fi
...@@ -144,11 +147,11 @@ pmodules.add_to_group() { ...@@ -144,11 +147,11 @@ pmodules.add_to_group() {
# #
# $@: dependencies # $@: dependencies
# #
pmodules.set_build_dependencies() { pbuild::set_build_dependencies() {
MODULE_BUILD_DEPENDENCIES=("$@") MODULE_BUILD_DEPENDENCIES=("$@")
} }
pmodules.set_runtime_dependencies() { pbuild::set_runtime_dependencies() {
MODULE_DEPENDENCIES=("$@") MODULE_DEPENDENCIES=("$@")
} }
...@@ -158,7 +161,7 @@ pmodules.set_runtime_dependencies() { ...@@ -158,7 +161,7 @@ pmodules.set_runtime_dependencies() {
# #
# $@: documentation files relative to source # $@: documentation files relative to source
# #
pmodules.set_docfiles() { pbuild::set_docfiles() {
MODULE_DOCFILES=("$@") MODULE_DOCFILES=("$@")
} }
...@@ -168,7 +171,7 @@ pmodules.set_docfiles() { ...@@ -168,7 +171,7 @@ pmodules.set_docfiles() {
# #
# $@: compilers # $@: compilers
# #
pmodules.set_supported_compilers() { pbuild::set_supported_compilers() {
MODULE_SUPPORTED_COMPILERS=("$@") MODULE_SUPPORTED_COMPILERS=("$@")
} }
...@@ -313,7 +316,7 @@ write_build_dependencies() { ...@@ -313,7 +316,7 @@ write_build_dependencies() {
# #
# cleanup environment # cleanup environment
# #
pmodules.cleanup_env() { pbuild::cleanup_env() {
C_INCLUDE_PATH='' C_INCLUDE_PATH=''
CPLUS_INCLUDE_PATH='' CPLUS_INCLUDE_PATH=''
...@@ -585,31 +588,31 @@ prep() { ...@@ -585,31 +588,31 @@ prep() {
} }
pmodules.pre_configure() { pbuild::pre_configure() {
: :
} }
pmodules.configure() { pbuild::configure() {
${MODULE_SRCDIR}/configure \ ${MODULE_SRCDIR}/configure \
--prefix="${PREFIX}" --prefix="${PREFIX}"
} }
pmodules.build() { pbuild::build() {
make -j${JOBS} make -j${JOBS}
} }
pmodules.install() { pbuild::install() {
make install make install
} }
pmodules.post_install() { pbuild::post_install() {
: :
} }
pmodules.install_doc() { pbuild::install_doc() {
std::info "Installing documentation to ${DOCDIR}" std::info "Installing documentation to ${DOCDIR}"
install -m 0755 -d "${DOCDIR}" install -m 0755 -d "${DOCDIR}"
install -m0444 "${MODULE_DOCFILES[@]/#/${MODULE_SRCDIR}/}" "${BUILDSCRIPT}" "${DOCDIR}" install -m0444 "${MODULE_DOCFILES[@]/#/${MODULE_SRCDIR}/}" "${BUILD_BLOCK}" "${DOCDIR}"
} }
set_legacy_link() { set_legacy_link() {
...@@ -652,7 +655,7 @@ set_link() { ...@@ -652,7 +655,7 @@ set_link() {
echo "${MODULE_RELEASE}" > "${release_file}" echo "${MODULE_RELEASE}" > "${release_file}"
} }
pmodules.cleanup_build() { pbuild::cleanup_build() {
[[ -n "${MODULE_BUILDDIR}" ]] \ [[ -n "${MODULE_BUILDDIR}" ]] \
|| std::die 1 "Oops: internal error: MODULE_BUILDDIR is set to empty string..." || std::die 1 "Oops: internal error: MODULE_BUILDDIR is set to empty string..."
[[ "${MODULE_BUILDDIR}" == "/" ]] \ [[ "${MODULE_BUILDDIR}" == "/" ]] \
...@@ -663,7 +666,7 @@ pmodules.cleanup_build() { ...@@ -663,7 +666,7 @@ pmodules.cleanup_build() {
rm -rf "/${MODULE_BUILDDIR}" rm -rf "/${MODULE_BUILDDIR}"
} }
pmodules.cleanup_src() { pbuild::cleanup_src() {
( (
[[ -d /${MODULE_SRCDIR} ]] || return 0 [[ -d /${MODULE_SRCDIR} ]] || return 0
cd "/${MODULE_SRCDIR}/.."; cd "/${MODULE_SRCDIR}/..";
...@@ -700,7 +703,7 @@ post_install() { ...@@ -700,7 +703,7 @@ post_install() {
return 0 return 0
} }
pmodules.make_all() { pbuild::make_all() {
local building='no' local building='no'
echo "${P}:" echo "${P}:"
_setup_env1 _setup_env1
...@@ -726,25 +729,25 @@ pmodules.make_all() { ...@@ -726,25 +729,25 @@ pmodules.make_all() {
if [[ ! -e "${MODULE_BUILDDIR}/.configure" ]]; then if [[ ! -e "${MODULE_BUILDDIR}/.configure" ]]; then
cd "${MODULE_SRCDIR}" cd "${MODULE_SRCDIR}"
pmodules.pre_configure pbuild::pre_configure
cd "${MODULE_BUILDDIR}" cd "${MODULE_BUILDDIR}"
pmodules.configure pbuild::configure
touch "${MODULE_BUILDDIR}/.configure" touch "${MODULE_BUILDDIR}/.configure"
fi fi
[[ "${target}" == "configure" ]] && return 0 [[ "${target}" == "configure" ]] && return 0
if [[ ! -e "${MODULE_BUILDDIR}/.compile" ]]; then if [[ ! -e "${MODULE_BUILDDIR}/.compile" ]]; then
cd "${MODULE_BUILDDIR}" cd "${MODULE_BUILDDIR}"
pmodules.build pbuild::build
touch "${MODULE_BUILDDIR}/.compile" touch "${MODULE_BUILDDIR}/.compile"
fi fi
[[ "${target}" == "compile" ]] && return 0 [[ "${target}" == "compile" ]] && return 0
if [[ ! -e "${MODULE_BUILDDIR}/.install" ]]; then if [[ ! -e "${MODULE_BUILDDIR}/.install" ]]; then
cd "${MODULE_BUILDDIR}" cd "${MODULE_BUILDDIR}"
pmodules.install pbuild::install
pmodules.post_install pbuild::post_install
pmodules.install_doc pbuild::install_doc
post_install post_install
if [[ ${bootstrap} == 'no' ]]; then if [[ ${bootstrap} == 'no' ]]; then
write_runtime_dependencies write_runtime_dependencies
...@@ -754,8 +757,8 @@ pmodules.make_all() { ...@@ -754,8 +757,8 @@ pmodules.make_all() {
fi fi
[[ "${target}" == "install" ]] && return 0 [[ "${target}" == "install" ]] && return 0
[[ ${enable_cleanup_build} == yes ]] && pmodules.cleanup_build [[ ${enable_cleanup_build} == yes ]] && pbuild::cleanup_build
[[ ${enable_cleanup_src} == yes ]] && pmodules.cleanup_src [[ ${enable_cleanup_src} == yes ]] && pbuild::cleanup_src
else else
echo "Not rebuilding $P/$V ..." echo "Not rebuilding $P/$V ..."
...@@ -769,6 +772,74 @@ pmodules.make_all() { ...@@ -769,6 +772,74 @@ pmodules.make_all() {
return 0 return 0
} }
#
# legacy functions, should be removed asap
#
pmodules.supported_os() {
pbuild::supported_os "$@"
}
pmodules.add_to_group() {
pbuild::add_to_group "@"
}
pmodules.set_build_dependencies() {
pbuild::set_build_dependencies "$@"
}
pmodules.set_runtime_dependencies() {
pbuild::set_runtime_dependencies "$@"
}
pmodules.set_docfiles() {
pbuild::set_docfiles "$@"
}
pmodules.set_supported_compilers() {
pbuild::set_supported_compilers "$@"
}
pmodules.cleanup_env() {
pbuild::cleanup_env "$@"
}
pmodules.pre_configure() {
pbuild::pre_configure "$@"
}
pmodules.configure() {
pbuild::configure "$@"
}
pmodules.build() {
pbuild::build "$@"
}
pmodules.install() {
pbuild::install "$@"
}
pmodules.post_install() {
pbuild::post_install "$@"
}
pmodules.install_doc() {
pbuild::install_doc "$@"
}
pmodules.cleanup_build() {
pbuild::cleanup_build "$@"
}
pmodules.cleanup_src() {
pbuild::cleanup_src "$@"
}
pmodules.make_all() {
pbuild::make_all "$@"
}
############################################################################## ##############################################################################
# #
debug_on='no' debug_on='no'
...@@ -781,7 +852,7 @@ enable_cleanup_src='no' ...@@ -781,7 +852,7 @@ enable_cleanup_src='no'
target='all' target='all'
pmodules.cleanup_env pbuild::cleanup_env
# array collecting all modules specified on the command line via '--with=module' # array collecting all modules specified on the command line via '--with=module'
with_modules=() with_modules=()
...@@ -856,10 +927,10 @@ fi ...@@ -856,10 +927,10 @@ fi
# while bootstraping the module command is not yet available # while bootstraping the module command is not yet available
if [[ ${bootstrap} == no ]]; then if [[ ${bootstrap} == no ]]; then
if [[ -r "${BUILDSCRIPT_DIR}/with_modules-$V" ]]; then if [[ -r "${BUILD_BLOCK_DIR}/with_modules-$V" ]]; then
with_modules+=( $(cat "${BUILDSCRIPT_DIR}/with_modules-$V") ) with_modules+=( $(cat "${BUILD_BLOCK_DIR}/with_modules-$V") )
elif [[ -r "${BUILDSCRIPT_DIR}/with_modules" ]]; then elif [[ -r "${BUILD_BLOCK_DIR}/with_modules" ]]; then
with_modules+=( $(cat "${BUILDSCRIPT_DIR}/with_modules") ) with_modules+=( $(cat "${BUILD_BLOCK_DIR}/with_modules") )
fi fi
source "${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/profile.bash" source "${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/profile.bash"
...@@ -880,11 +951,11 @@ if [[ ${bootstrap} == no ]]; then ...@@ -880,11 +951,11 @@ if [[ ${bootstrap} == no ]]; then
else else
unset PMODULES_HOME unset PMODULES_HOME
unset PMODULES_VERSION unset PMODULES_VERSION
read_versions "${BUILD_BASEDIR}/scripts/Bootstrap/Pmodules_version.conf" read_versions "${BUILD_BASEDIR}/Bootstrap/Pmodules_version.conf"
source "/opt/psi/config/environment.bash" source "/opt/psi/config/environment.bash"
fi fi
P=$(basename $(dirname "${BUILDSCRIPT}")) P=$(basename $(dirname "${BUILD_BLOCK}"))
P=${P%.*} P=${P%.*}
_P=$(echo $P | tr [:lower:] [:upper:]) _P=$(echo $P | tr [:lower:] [:upper:])
_P=${_P//-/_} _P=${_P//-/_}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment