diff options
author | snafu | 2017-11-01 18:46:44 +0100 |
---|---|---|
committer | snafu | 2017-11-01 18:46:44 +0100 |
commit | 98ebe9bd35d5159da71cdc11852bac1313be45b9 (patch) | |
tree | 4821a2e6ebce48a156aa6ba34363e577b6c56bc2 | |
parent | aa40dce69817bfb08588c307f8668d4f85d12dff (diff) | |
download | aur-98ebe9bd35d5159da71cdc11852bac1313be45b9.tar.gz |
update to 4.0.0
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | PKGBUILD | 68 | ||||
-rw-r--r-- | env-modules.install | 23 | ||||
-rw-r--r-- | env-modules.sh | 11 | ||||
-rw-r--r-- | zshcomp.patch | 135 |
5 files changed, 168 insertions, 87 deletions
@@ -1,21 +1,21 @@ pkgbase = env-modules pkgdesc = Provides for an easy dynamic modification of a user's environment via modulefile. - pkgver = 3.2.10 - pkgrel = 4 + pkgver = 4.0.0 + pkgrel = 0 url = https://sourceforge.net/projects/modules/ + install = env-modules.install arch = i686 arch = x86_64 license = GPLv2 checkdepends = dejagnu depends = tcl>=7.4 - depends = procps-ng - backup = usr/Modules/init/.modulespath - source = https://sourceforge.net/projects/modules/files/Modules/modules-3.2.10/modules-3.2.10.tar.gz - source = env-modules.sh + conflicts = env-modules-tcl + replaces = env-modules-tcl + backup = etc/modules/init/modulerc + source = https://sourceforge.net/projects/modules/files/Modules/modules-4.0.0/modules-4.0.0.tar.gz source = zshcomp.patch - md5sums = 8b097fdcb90c514d7540bb55a3cb90fb - md5sums = 04115aa1410483724a8d11ebac8598b1 - md5sums = 38eb89089803a0464a6e9e23ff23a2f2 + md5sums = 454dba418b1556d2fd5de753fbbabe0b + md5sums = 2c6c0e8095d624da825e9a2938de0582 pkgname = env-modules @@ -1,49 +1,79 @@ -# Maintainer: Your Name <youremail@domain.com> +# Maintainer: snafu pkgname=env-modules -pkgver=3.2.10 -pkgrel=4 +pkgver=4.0.0 +pkgrel=0 epoch= pkgdesc="Provides for an easy dynamic modification of a user's environment via modulefile." arch=('i686' 'x86_64') url="https://sourceforge.net/projects/modules/" license=('GPLv2') groups=() -depends=('tcl>=7.4' 'procps-ng') +depends=('tcl>=7.4') makedepends=() checkdepends=('dejagnu') optdepends=() provides=() -conflicts=() -replaces=() -backup=("usr/Modules/init/.modulespath") +conflicts=(env-modules-tcl) +replaces=(env-modules-tcl) options=() -install= +install=env-modules.install changelog= -source=("https://sourceforge.net/projects/modules/files/Modules/modules-$pkgver/modules-$pkgver.tar.gz" env-modules.sh zshcomp.patch) +source=("https://sourceforge.net/projects/modules/files/Modules/modules-$pkgver/modules-$pkgver.tar.gz" zshcomp.patch) noextract=() validpgpkeys=() -md5sums=('8b097fdcb90c514d7540bb55a3cb90fb' - '04115aa1410483724a8d11ebac8598b1' - '38eb89089803a0464a6e9e23ff23a2f2') +md5sums=('454dba418b1556d2fd5de753fbbabe0b' + '2c6c0e8095d624da825e9a2938de0582') + + +# Install locations: +install_prefix=/usr +config_path=/etc +profiled="/etc/profile.d" +moduledir=modules + +backup=("${config_path:1}/${moduledir}/init/modulerc") + + +prepare() { + cd "modules-$pkgver" + + # uncomment if you don't won't the zsh-completion patch or if it doesn't work for you + patch -p1 < ../zshcomp.patch +} build() { cd "modules-$pkgver" - patch -p1 < ../zshcomp.patch - CPPFLAGS="-DUSE_INTERP_ERRORLINE" ./configure --prefix=/usr --disable-versioning + + + # heavy-weight default -- remove examples/docs + ./configure \ + --prefix=/usr \ + --docdir=$install_prefix/share/doc/$moduledir \ + --initdir=$config_path/$moduledir/init \ + --modulefilesdir=$config_path/$moduledir/modulefiles \ + --disable-set-binpath \ + --disable-set-manpath \ + --enable-compat-version \ + --enable-example-modulefiles \ + --enable-doc-install + make } check() { cd "modules-$pkgver" -# make -k check + + # uncomment if you run into problems... takes quite a while + #make -j1 -k test } package() { cd "modules-$pkgver" - make DESTDIR="$pkgdir/" install + make -j1 DESTDIR="$pkgdir/" install - _profiled="$pkgdir/etc/profile.d/" + _profiled="${pkgdir}${profiled}" mkdir -p "$_profiled" - ln -sf /usr/Modules/default/init/csh $_profiled/env-modules.csh - cp $srcdir/env-modules.sh $_profiled/env-modules.sh + ln -s ${config_path}/${moduledir}/init/profile-compat.csh $_profiled/env-modules.csh + ln -s ${config_path}/${moduledir}/init/profile-compat.sh $_profiled/env-modules.sh } + diff --git a/env-modules.install b/env-modules.install new file mode 100644 index 000000000000..17c24b7c32cb --- /dev/null +++ b/env-modules.install @@ -0,0 +1,23 @@ + +post_install() { + echo "" + echo "WARN: This installs the C-Version of modules as default, which is there for compatibilty reasons." + echo " You might consider to install env-modules-tcl (TCL-Version only), if you don't need the C-Version." + echo " Otherwise you can switch to the TCL Version by changing the symlink in /etc/profile.d/env-modules.{sh,csh}" + echo " or by unsetting the enviroment variable:" + echo " unset MODULES_USE_COMPAT_VERSION" + echo "" + echo "INFO: ZSH: For the use of module-cmd in a none-login Z-shell enviroment" + echo " the following entry should be added to the zshrc " + echo " (or zshenv if the module-cmd should be available in shell-scripts)" + echo "" + echo " (( \${+functions[module]} )) || source /etc/modules/init/zsh" + echo "" + echo " Adapt /etc/modules/init/modulerc and add your modulefiles to the specified directories." + echo "" +} + +post_upgrade() { + post_install +} + diff --git a/env-modules.sh b/env-modules.sh deleted file mode 100644 index 2b474b9e0b1c..000000000000 --- a/env-modules.sh +++ /dev/null @@ -1,11 +0,0 @@ - -# init module enviroment - -shell=$(/bin/basename $(/bin/ps -p $$ -ocomm=)) - -if [ -f /usr/Modules/init/$shell ]; then - source /usr/Modules/init/$shell -else - source /usr/Modules/init/sh -fi - diff --git a/zshcomp.patch b/zshcomp.patch index d3e7c4284b63..005ab066ce0d 100644 --- a/zshcomp.patch +++ b/zshcomp.patch @@ -1,55 +1,94 @@ -diff -aur modules-3.2.10/init/zsh.in modules-3.2.10-patched/init/zsh.in ---- modules-3.2.10/init/zsh.in 2012-10-25 21:33:34.000000000 +0200 -+++ modules-3.2.10-patched/init/zsh.in 2017-05-08 10:17:42.693291314 +0200 -@@ -22,3 +22,51 @@ - MODULEPATH=`sed -n 's/[ #].*$//; /./H; $ { x; s/^\n//; s/\n/:/g; p; }' ${MODULESHOME}/init/.modulespath` - export MODULEPATH - fi -+ -+# zsh-completion function, improves the standard zsh-completion (_module): -+# - support for symlinks +diff -aur modules-4.0.0/init/zsh-functions/_module modules-4.0.0-patched/init/zsh-functions/_module +--- modules-4.0.0/init/zsh-functions/_module 2017-10-16 06:49:58.000000000 +0200 ++++ modules-4.0.0-patched/init/zsh-functions/_module 2017-11-01 17:58:13.771039301 +0100 +@@ -4,17 +4,35 @@ + # Zsh command-line completion for module + # Copyright (C) 2017 Xavier Delaruelle <xavier.delaruelle@cea.fr> + # ++# patched version: +# - directory-wise completion ++# + +-_module_avail() { +- module avail -t 2>&1 | sed ' +- /^-\+/d; /^\s*$/d; +- /->.*$/d; +- /:$/d; +- /:ERROR:/d; +- s#^\(.*\)/\(.\+\)(.*default.*)#\1\n\1\/\2#; +- s#(.*)$##g; +- s#\s*$##g; +- s#/*$##g;' +function _module_completion () { -+ emulate -L zsh -+ local _module_path_prefix -+ local -a _module_search_path _module_type_d _module_type_f -+ _module_path_prefix=$(echo ${(q)words[$CURRENT]} | sed -ne 's#\(.*/\).*#\1#p') -+ _module_search_paths=(${^${(@s/:/)MODULEPATH}}/$_module_path_prefix) -+ -+ _module_type_d=() -+ _module_type_f=() -+ eval $(find $_module_search_paths -mindepth 1 -maxdepth 1 -not -name '.modulerc' -not -name '.version' -printf "_module_type_%Y+=${(q)_module_path_prefix}%P\n" 2> /dev/null) ++ emulate -L zsh ++ local _module_path_prefix ++ local -a _module_search_path _module_type_d _module_type_f ++ _module_path_prefix=$(echo ${(q)words[$CURRENT]} | sed -ne 's#\(.*/\).*#\1#p') ++ _module_search_paths=(${^${(@s/:/)MODULEPATH}}/$_module_path_prefix) + -+ if [[ "$@" != "dir" ]]; then -+ compadd -q -S / ${_module_type_d} -+ compadd ${_module_type_f} -+ else -+ compadd ${_module_type_d} -+ fi -+} ++ _module_type_d=() ++ _module_type_f=() ++ eval $(find $_module_search_paths -mindepth 1 -maxdepth 1 -not -name '.modulerc' -not -name '.version' -printf "_module_type_%Y+=${(q)_module_path_prefix}%P\n" 2> /dev/null) + -+# module avail should only complete directories -+function _module_avail { ++ case "$@" in ++ dir) ++ compadd ${_module_type_d} ++ ;; ++ notloaded) ++ local -a _modules_loaded=(${=LOADEDMODULES//:/}) ++ compadd -q -S / ${_module_type_d} ++ compadd ${_module_type_f:|_modules_loaded} ++ ;; ++ *) ++ compadd -q -S / ${_module_type_d} ++ compadd ${_module_type_f} ++ ;; ++ esac + } + + _module_savelist() { +@@ -24,18 +42,15 @@ + /:ERROR:/d;' + } + +-_module_not_yet_loaded() { +- _module_avail | sort | sed -r "\%^(${LOADEDMODULES//:/|})$%d" +-} +- +- + _module_avail_mods() { +- local -a avail_mods; +- avail_mods=(${$(_module_avail)}) + _module_completion dir +} + +- _describe -t avail-mods 'available modulefiles' avail_mods && ret=0 ++_module_all_mods() { ++ _module_completion + } + + -+# all the other use the full completion: -+local -a _module_complete_functions=( \ -+ _module_help \ -+ _module_load \ -+ _module_switch \ -+ _module_display \ -+ _module_whatis \ -+ _module_initadd \ -+ _module_initprepend \ -+ _module_initrm \ -+ _module_initswitch \ -+) -+ -+for _module_complete_function in $_module_complete_functions ; do -+ $_module_complete_function () { -+ _module_completion -+ } -+done -+ -+# vim: syntax=zsh + _module_saved_colls() { + local -a saved_colls; + saved_colls=(${$(_module_savelist)}) +@@ -44,10 +59,8 @@ + } + + _module_notloaded_mods() { +- local -a not_yet_loaded_mods; +- not_yet_loaded_mods=(${$(_module_not_yet_loaded)}) ++ _module_completion notloaded + +- _describe -t avail-mods 'available modulefiles' not_yet_loaded_mods && ret=0 + } + + _module_loaded_mods() { +@@ -169,7 +182,7 @@ + '*:modulepath:_files -/' && ret=0 + ;; + (display|help|show|test|whatis) +- _alternative 'avail-mods:modulefiles:{_module_avail_mods}' \ ++ _alternative 'avail-mods:modulefiles:{_module_all_mods}' \ + && ret=0 + ;; + esac |