From 8baf379c9f6a90007415c641001000017eeb0b35 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 12 Jan 2015 18:43:20 +0100 Subject: [PATCH 1/6] scripts/unison.build: added --- scripts/unison.build | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 scripts/unison.build diff --git a/scripts/unison.build b/scripts/unison.build new file mode 100755 index 0000000..0db233c --- /dev/null +++ b/scripts/unison.build @@ -0,0 +1,29 @@ +#!/bin/bash + +source "$(dirname $0)/../lib/libem.bash" + +function em.configure() { + : +} + +function em.build() { + cd "${MODULE_SRCDIR}" + make +} + +function em.install() { + cd "${MODULE_SRCDIR}" + install -m 0755 -d "${PREFIX}/bin" + install -m 0755 unison "${PREFIX}/bin" +} + +em.add_to_family 'System' +em.set_docfiles 'BUGS.txt' 'CONTRIB' 'COPYING' 'NEWS' 'README' +#em.set_build_dependencies "${COMPILER}" +em.make_all + +# Local Variables: +# mode: sh +# sh-basic-offset: 8 +# tab-width: 8 +# End: From ac1310dda71bc711eebead596bfdb8e1e46427cc Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 16 Jan 2015 16:13:33 +0100 Subject: [PATCH 2/6] unison: tar-ball added From f083ca4194faa73c0eb954f03e9141347b4f7709 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 27 Feb 2015 16:53:07 +0100 Subject: [PATCH 3/6] config/families.d/openmpi-1.8.2: added --- config/families.d/openmpi-1.8.2 | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 config/families.d/openmpi-1.8.2 diff --git a/config/families.d/openmpi-1.8.2 b/config/families.d/openmpi-1.8.2 new file mode 100644 index 0000000..d997a66 --- /dev/null +++ b/config/families.d/openmpi-1.8.2 @@ -0,0 +1,5 @@ +MPI=openmpi +MPI_VERSION=1.8.2 + +OPENMPI_VERSION=${MPI_VERSION} + From c4003e437d574a41068d6b96b85d1805a85aeb25 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 27 Feb 2015 16:58:43 +0100 Subject: [PATCH 4/6] System/unison/build: file moved --- scripts/{unison.build => System/unison/build} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename scripts/{unison.build => System/unison/build} (90%) diff --git a/scripts/unison.build b/scripts/System/unison/build similarity index 90% rename from scripts/unison.build rename to scripts/System/unison/build index 0db233c..715d2be 100755 --- a/scripts/unison.build +++ b/scripts/System/unison/build @@ -1,6 +1,6 @@ #!/bin/bash -source "$(dirname $0)/../lib/libem.bash" +source "$(dirname $0)/../../../lib/libem.bash" function em.configure() { : From 6c8e2c9fa9064e3669ca2735e91ac1a66e12072e Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 27 Feb 2015 22:47:20 +0100 Subject: [PATCH 5/6] lib/libem.bash: bugfixes --- lib/libem.bash | 4 ++-- scripts/Bootstrap/{Modules.build => Modules/build} | 0 scripts/Bootstrap/{ => Pmodules}/bash | 0 scripts/Bootstrap/{ => Pmodules}/bash_completion | 0 scripts/Bootstrap/{ => Pmodules}/dialog.bash | 0 scripts/Bootstrap/{ => Pmodules}/environment.bash | 0 scripts/Bootstrap/{ => Pmodules}/init_local_env.bash | 0 scripts/Bootstrap/{ => Pmodules}/libmodules.tcl | 0 scripts/Bootstrap/{ => Pmodules}/modsync.bash | 0 scripts/Bootstrap/{ => Pmodules}/modulecmd.bash | 0 scripts/Bootstrap/{ => Pmodules}/profile.bash | 0 scripts/Bootstrap/{Tcl.build => Tcl/build} | 0 scripts/Bootstrap/{bash.build => bash/build} | 0 scripts/Bootstrap/{build_pmodules.sh => compile_pmodules.sh} | 0 scripts/Bootstrap/{dialog.build => dialog/build} | 0 scripts/Bootstrap/{getopt.build => getopt/build} | 0 scripts/Bootstrap/{gettext.build => gettext/build} | 0 17 files changed, 2 insertions(+), 2 deletions(-) rename scripts/Bootstrap/{Modules.build => Modules/build} (100%) rename scripts/Bootstrap/{ => Pmodules}/bash (100%) rename scripts/Bootstrap/{ => Pmodules}/bash_completion (100%) rename scripts/Bootstrap/{ => Pmodules}/dialog.bash (100%) rename scripts/Bootstrap/{ => Pmodules}/environment.bash (100%) rename scripts/Bootstrap/{ => Pmodules}/init_local_env.bash (100%) rename scripts/Bootstrap/{ => Pmodules}/libmodules.tcl (100%) rename scripts/Bootstrap/{ => Pmodules}/modsync.bash (100%) rename scripts/Bootstrap/{ => Pmodules}/modulecmd.bash (100%) rename scripts/Bootstrap/{ => Pmodules}/profile.bash (100%) rename scripts/Bootstrap/{Tcl.build => Tcl/build} (100%) rename scripts/Bootstrap/{bash.build => bash/build} (100%) rename scripts/Bootstrap/{build_pmodules.sh => compile_pmodules.sh} (100%) rename scripts/Bootstrap/{dialog.build => dialog/build} (100%) rename scripts/Bootstrap/{getopt.build => getopt/build} (100%) rename scripts/Bootstrap/{gettext.build => gettext/build} (100%) diff --git a/lib/libem.bash b/lib/libem.bash index 51e741e..e59b0d0 100644 --- a/lib/libem.bash +++ b/lib/libem.bash @@ -195,7 +195,7 @@ function em.add_to_family() { if [[ -z ${1} ]]; then die 42 "${FUNCNAME}: Missing family argument." fi - if [[ ! -d ${PSI_PREFIX}/${PSI_MODULES_ROOT}/${1} ]]; then + if [[ ! -d ${PSI_PREFIX}/${PSI_TEMPLATES_DIR}/${1} ]]; then die 43 "${1}: family does not exist." fi MODULE_FAMILY=$1 @@ -243,7 +243,7 @@ function _load_build_dependencies() { fi if ! module_is_available "$m"; then debug "${m}: module not available" - local rels=( ${releases//: } ) + local rels=( ${releases//:/ } ) for rel in "${rels[@]}"; do debug "${m}: check release \"${rel}\"" eval $("${MODULECMD}" bash use ${rel}) diff --git a/scripts/Bootstrap/Modules.build b/scripts/Bootstrap/Modules/build similarity index 100% rename from scripts/Bootstrap/Modules.build rename to scripts/Bootstrap/Modules/build diff --git a/scripts/Bootstrap/bash b/scripts/Bootstrap/Pmodules/bash similarity index 100% rename from scripts/Bootstrap/bash rename to scripts/Bootstrap/Pmodules/bash diff --git a/scripts/Bootstrap/bash_completion b/scripts/Bootstrap/Pmodules/bash_completion similarity index 100% rename from scripts/Bootstrap/bash_completion rename to scripts/Bootstrap/Pmodules/bash_completion diff --git a/scripts/Bootstrap/dialog.bash b/scripts/Bootstrap/Pmodules/dialog.bash similarity index 100% rename from scripts/Bootstrap/dialog.bash rename to scripts/Bootstrap/Pmodules/dialog.bash diff --git a/scripts/Bootstrap/environment.bash b/scripts/Bootstrap/Pmodules/environment.bash similarity index 100% rename from scripts/Bootstrap/environment.bash rename to scripts/Bootstrap/Pmodules/environment.bash diff --git a/scripts/Bootstrap/init_local_env.bash b/scripts/Bootstrap/Pmodules/init_local_env.bash similarity index 100% rename from scripts/Bootstrap/init_local_env.bash rename to scripts/Bootstrap/Pmodules/init_local_env.bash diff --git a/scripts/Bootstrap/libmodules.tcl b/scripts/Bootstrap/Pmodules/libmodules.tcl similarity index 100% rename from scripts/Bootstrap/libmodules.tcl rename to scripts/Bootstrap/Pmodules/libmodules.tcl diff --git a/scripts/Bootstrap/modsync.bash b/scripts/Bootstrap/Pmodules/modsync.bash similarity index 100% rename from scripts/Bootstrap/modsync.bash rename to scripts/Bootstrap/Pmodules/modsync.bash diff --git a/scripts/Bootstrap/modulecmd.bash b/scripts/Bootstrap/Pmodules/modulecmd.bash similarity index 100% rename from scripts/Bootstrap/modulecmd.bash rename to scripts/Bootstrap/Pmodules/modulecmd.bash diff --git a/scripts/Bootstrap/profile.bash b/scripts/Bootstrap/Pmodules/profile.bash similarity index 100% rename from scripts/Bootstrap/profile.bash rename to scripts/Bootstrap/Pmodules/profile.bash diff --git a/scripts/Bootstrap/Tcl.build b/scripts/Bootstrap/Tcl/build similarity index 100% rename from scripts/Bootstrap/Tcl.build rename to scripts/Bootstrap/Tcl/build diff --git a/scripts/Bootstrap/bash.build b/scripts/Bootstrap/bash/build similarity index 100% rename from scripts/Bootstrap/bash.build rename to scripts/Bootstrap/bash/build diff --git a/scripts/Bootstrap/build_pmodules.sh b/scripts/Bootstrap/compile_pmodules.sh similarity index 100% rename from scripts/Bootstrap/build_pmodules.sh rename to scripts/Bootstrap/compile_pmodules.sh diff --git a/scripts/Bootstrap/dialog.build b/scripts/Bootstrap/dialog/build similarity index 100% rename from scripts/Bootstrap/dialog.build rename to scripts/Bootstrap/dialog/build diff --git a/scripts/Bootstrap/getopt.build b/scripts/Bootstrap/getopt/build similarity index 100% rename from scripts/Bootstrap/getopt.build rename to scripts/Bootstrap/getopt/build diff --git a/scripts/Bootstrap/gettext.build b/scripts/Bootstrap/gettext/build similarity index 100% rename from scripts/Bootstrap/gettext.build rename to scripts/Bootstrap/gettext/build From 7690327e9e78a8357fa624e3702fa079d6dce267 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 27 Feb 2015 22:49:18 +0100 Subject: [PATCH 6/6] Bootstrap: reorganization, bugfixes --- scripts/Bootstrap/Modules/build | 2 +- scripts/Bootstrap/Pmodules/modulecmd.bash | 12 +++++----- scripts/Bootstrap/Tcl/build | 28 ++++++++++++++++++++++- scripts/Bootstrap/bash/build | 2 +- scripts/Bootstrap/compile_pmodules.sh | 12 +++++----- scripts/Bootstrap/dialog/build | 2 +- scripts/Bootstrap/getopt/build | 4 ++-- scripts/Bootstrap/gettext/build | 2 +- scripts/Bootstrap/install_pmodules.sh | 19 ++++++++------- 9 files changed, 54 insertions(+), 29 deletions(-) mode change 120000 => 100755 scripts/Bootstrap/Tcl/build diff --git a/scripts/Bootstrap/Modules/build b/scripts/Bootstrap/Modules/build index be5e774..115b214 100755 --- a/scripts/Bootstrap/Modules/build +++ b/scripts/Bootstrap/Modules/build @@ -1,6 +1,6 @@ #!/bin/bash #set -o functrace -source "$(dirname $0)/../../lib/libem.bash" +source "$(dirname $0)/../../../lib/libem.bash" TCL_DIR="${PSI_PREFIX}/Tools/Pmodules/0.99.0" diff --git a/scripts/Bootstrap/Pmodules/modulecmd.bash b/scripts/Bootstrap/Pmodules/modulecmd.bash index 3fb4149..6b34ea3 100755 --- a/scripts/Bootstrap/Pmodules/modulecmd.bash +++ b/scripts/Bootstrap/Pmodules/modulecmd.bash @@ -569,10 +569,10 @@ subcommand_avail() { local dir='' # get number of columns of terminal - eval $(resize) + cols=$(tput cols) output_header() { - let i=($COLUMNS-${#dir})/2-2 + let i=($cols-${#dir})/2-2 printf -- "%0.s-" $(seq 1 $i) 1>&2 printf -- " %s " "${dir}" 1>&2 printf -- "%0.s-" $(seq 1 $i) 1>&2 @@ -618,7 +618,7 @@ subcommand_avail() { human_readable_output() { output_header - local -i column=$COLUMNS + local -i column=$cols local -i colsize=16 for ((i=0; i<${#mods[@]}; i+=2)); do if [[ ${userlvl} == 'novice' ]]; then @@ -637,11 +637,11 @@ subcommand_avail() { local -i len=${#mod} local -i span=$(( len / 16 + 1 )) local -i colsize=$(( span * 16 )) - if (( column+len >= COLUMNS )); then + if (( column+len >= cols )); then printf -- "\n" 1>&2 column=0 fi - if (( column+colsize < COLUMNS )); then + if (( column+colsize < cols )); then fmt="%-${colsize}s" else fmt="%-s" @@ -680,7 +680,7 @@ compute_family_depth () { { local -r family=$1 cd "${modulepath_root}" - local -r tmp=$(find "${family}" -d -type f -o -type l | head -1) + local -r tmp=$(find "${family}" -depth -type f -o -type l | head -1) local -ar tmp2=( ${tmp//\// } ) local depth=${#tmp2[@]} let depth-=3 diff --git a/scripts/Bootstrap/Tcl/build b/scripts/Bootstrap/Tcl/build deleted file mode 120000 index dfcb532..0000000 --- a/scripts/Bootstrap/Tcl/build +++ /dev/null @@ -1 +0,0 @@ -../Programming/Tcl.build \ No newline at end of file diff --git a/scripts/Bootstrap/Tcl/build b/scripts/Bootstrap/Tcl/build new file mode 100755 index 0000000..402004d --- /dev/null +++ b/scripts/Bootstrap/Tcl/build @@ -0,0 +1,27 @@ +#!/bin/bash + +source "$(dirname $0)/../../../lib/libem.bash" + +function em.configure() { + case ${OS} in + Linux ) + srcdir="${MODULE_SRCDIR}/unix" + ;; + Darwin ) + srcdir="${MODULE_SRCDIR}/macosx" + ;; + esac + "${srcdir}"/configure \ + --prefix="${PREFIX}" \ + --enable-shared=no \ + || exit 1 +} + +function em.post_install() { + { cd "${PREFIX}"/bin && rm -f tclsh && ln -fs tclsh${V%.*} tclsh; }; +} + +em.add_to_family 'Programming' +em.set_docfiles 'license.terms' 'README' +em.set_build_dependencies "${COMPILER}" +em.make_all diff --git a/scripts/Bootstrap/bash/build b/scripts/Bootstrap/bash/build index 122c5f9..19ef03f 100755 --- a/scripts/Bootstrap/bash/build +++ b/scripts/Bootstrap/bash/build @@ -1,6 +1,6 @@ #!/bin/bash -source "$(dirname $0)/../../lib/libem.bash" +source "$(dirname $0)/../../../lib/libem.bash" function em.configure() { "${MODULE_SRCDIR}"/configure \ diff --git a/scripts/Bootstrap/compile_pmodules.sh b/scripts/Bootstrap/compile_pmodules.sh index f36cbfc..2daebfa 100755 --- a/scripts/Bootstrap/compile_pmodules.sh +++ b/scripts/Bootstrap/compile_pmodules.sh @@ -8,13 +8,13 @@ source "${BASE_DIR}/config/pmodules_version.conf" unset PMODULES_HOME source "/opt/psi/config/environment.bash" -${BOOTSTRAP_DIR}/gettext.build --bootstrap -${BOOTSTRAP_DIR}/getopt.build --bootstrap -${BOOTSTRAP_DIR}/dialog.build --bootstrap -${BOOTSTRAP_DIR}/bash.build --bootstrap -${BOOTSTRAP_DIR}/Tcl.build --bootstrap +${BOOTSTRAP_DIR}/gettext/build --bootstrap +${BOOTSTRAP_DIR}/getopt/build --bootstrap +${BOOTSTRAP_DIR}/dialog/build --bootstrap +${BOOTSTRAP_DIR}/bash/build --bootstrap +${BOOTSTRAP_DIR}/Tcl/build --bootstrap # we have to remove the init directory - otherwise the next build will fail... rm -rf "${PMODULES_HOME}/init" -${BOOTSTRAP_DIR}/Modules.build --bootstrap +${BOOTSTRAP_DIR}/Modules/build --bootstrap mv -v "${PMODULES_HOME}/bin/modulecmd" "${PMODULES_HOME}/bin/modulecmd.tcl" diff --git a/scripts/Bootstrap/dialog/build b/scripts/Bootstrap/dialog/build index b5d7a1d..ae80ddd 100755 --- a/scripts/Bootstrap/dialog/build +++ b/scripts/Bootstrap/dialog/build @@ -1,6 +1,6 @@ #!/bin/bash -source "$(dirname $0)/../../lib/libem.bash" +source "$(dirname $0)/../../../lib/libem.bash" function em.configure() { "${MODULE_SRCDIR}"/configure \ diff --git a/scripts/Bootstrap/getopt/build b/scripts/Bootstrap/getopt/build index e502f0e..e910f51 100755 --- a/scripts/Bootstrap/getopt/build +++ b/scripts/Bootstrap/getopt/build @@ -1,6 +1,6 @@ #!/bin/bash -source "$(dirname $0)/../../lib/libem.bash" +source "$(dirname $0)/../../../lib/libem.bash" function em.configure() { : @@ -9,7 +9,7 @@ function em.configure() { function em.build() { case ${OS} in Linux ) - declare -x LDFLAGS="-lintl -liconv" + declare -x LDFLAGS="-lintl" ;; Darwin ) declare -x LDFLAGS="-lintl -liconv -framework CoreFoundation" diff --git a/scripts/Bootstrap/gettext/build b/scripts/Bootstrap/gettext/build index 56463f6..68d8744 100755 --- a/scripts/Bootstrap/gettext/build +++ b/scripts/Bootstrap/gettext/build @@ -1,6 +1,6 @@ #!/bin/bash -source "$(dirname $0)/../../lib/libem.bash" +source "$(dirname $0)/../../../lib/libem.bash" function em.configure() { "${MODULE_SRCDIR}"/configure \ diff --git a/scripts/Bootstrap/install_pmodules.sh b/scripts/Bootstrap/install_pmodules.sh index 7673c49..b540c0e 100755 --- a/scripts/Bootstrap/install_pmodules.sh +++ b/scripts/Bootstrap/install_pmodules.sh @@ -2,6 +2,7 @@ declare -r BASE_DIR=$(cd "$(dirname $0)/../.." && pwd) declare -r BOOTSTRAP_DIR="${BASE_DIR}/scripts/Bootstrap" +declare -r SRC_DIR="${BOOTSTRAP_DIR}/Pmodules" source "${BASE_DIR}/config/pmodules_version.conf" @@ -11,21 +12,19 @@ source "/opt/psi/config/environment.bash" sed_cmd="s:@PMODULES_HOME@:${PMODULES_HOME}:g;" sed_cmd+="s:@PMODULES_VERSION@:${PMODULES_VERSION}:g;" sed_cmd+="s:@MODULES_VERSION@:${MODULES_VERSION}:g" -sed "${sed_cmd}" "${BOOTSTRAP_DIR}/modulecmd.bash" > "${BOOTSTRAP_DIR}/modulecmd" +sed "${sed_cmd}" "${SRC_DIR}/modulecmd.bash" > "${SRC_DIR}/modulecmd" install -d -m 0755 "${PMODULES_HOME}/bin" install -d -m 0755 "${PMODULES_HOME}/config" install -d -m 0755 "${PMODULES_HOME}/init" install -d -m 0755 "${PMODULES_HOME}/lib" -install -m 0755 "${BOOTSTRAP_DIR}/modulecmd" "${PMODULES_HOME}/bin" -install -m 0755 "${BOOTSTRAP_DIR}/init_local_env.bash" "${PMODULES_HOME}/bin" -install -m 0755 "${BOOTSTRAP_DIR}/modsync.bash" "${PMODULES_HOME}/bin" -install -m 0755 "${BOOTSTRAP_DIR}/dialog.bash" "${PMODULES_HOME}/bin" +install -m 0755 "${SRC_DIR}/modulecmd" "${PMODULES_HOME}/bin" +install -m 0755 "${SRC_DIR}/init_local_env.bash" "${PMODULES_HOME}/bin" +install -m 0755 "${SRC_DIR}/modsync.bash" "${PMODULES_HOME}/bin" +install -m 0755 "${SRC_DIR}/dialog.bash" "${PMODULES_HOME}/bin" -#install -m 0644 "${BOOTSTRAP_DIR}/modulerc" "${PMODULES_HOME}/config" +install -m 0644 "${SRC_DIR}/bash" "${PMODULES_HOME}/init" +install -m 0644 "${SRC_DIR}/bash_completion" "${PMODULES_HOME}/init" -install -m 0644 "${BOOTSTRAP_DIR}/bash" "${PMODULES_HOME}/init" -install -m 0644 "${BOOTSTRAP_DIR}/bash_completion" "${PMODULES_HOME}/init" - -install -m 0644 "${BOOTSTRAP_DIR}/libmodules.tcl" "${PMODULES_HOME}/lib" +install -m 0644 "${SRC_DIR}/libmodules.tcl" "${PMODULES_HOME}/lib"