Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure MODULESHOME location at installation time #292

Closed
xdelaruelle opened this issue Sep 18, 2019 · 1 comment
Closed

Configure MODULESHOME location at installation time #292

xdelaruelle opened this issue Sep 18, 2019 · 1 comment
Assignees
Milestone

Comments

@xdelaruelle
Copy link
Collaborator

As initially described on #287

Following a typical linux layout, e.g.

./configure \
		--prefix=/
		--etcdir=/etc \
		--initdir=/etc/modules/init \
		--modulefilesdir=/etc/modules/modulefiles
		--bindir=/usr/bin \
		--libdir=/usr/lib \
		--libexecdir=/usr/libexec \
		--datarootdir=/usr/share \
		--mandir=/usr/share/man \
		--docdir=/usr/share/doc \
		--vimdatadir=/usr/share/vim/vimfiles \

will lead to a wrong and empty MODULESHOMES (which seems not to be used by the tool itself, but is mainly used as $MODULESHOMES/init/<init-skript> by external scripts).

Suggested patches:

diff --git a/modulecmd.tcl.in b/modulecmd.tcl.in
index 843e178..8e77ec7 100644
--- a/modulecmd.tcl.in
+++ b/modulecmd.tcl.in
@@ -9066,7 +9066,7 @@ proc cmdModuleAutoinit {} {
    pushMode load
 
    # default MODULESHOME
-   setenv MODULESHOME @prefix@
+   setenv MODULESHOME [file dirname @initdir@]
 
    # register command location
    setenv MODULES_CMD [getAbsolutePath $::argv0]

Originally posted by @xdch47 in #287 (comment)

Without this fix, the prefix option is (from my point of view) is broken.

it feels pretty odd/wrong to have

./configure \
		--prefix=/usr/local/etc
		--etcdir=/etc \
		--initdir=/etc/modules/init \
		--modulefilesdir=/etc/modules/modulefiles
                ....

furthermore libdir, libexecdir,datarootdir,mandir,docdir,vimdatadir have to be manually prefix (with /usr/local) since they will be install to the wrong place (usr/local/etc) otherwise

an alternative to facilitate compability to all (but in my eyes stranges/broken setups) would be to add a --moduleshome option with the parentdir of the initdir as default.

Originally posted by @xdch47 in #287 (comment)

To clarify a bit more: the main compability I would like to keep is for users that had a local installation (default options -> /usr/local/Modules) and switch to a packaged installation.
However for a general packaging guideline is to have configuration files in /etc and binaries, libs, etc. in /usr

Originally posted by @xdch47 in #287 (comment)

@xdelaruelle
Copy link
Collaborator Author

Will add a configuration option home that will control the setup of the MODULESHOME variable. And a ./configure option --with-moduleshome to enable the setup of the right value at installation time.

@xdelaruelle xdelaruelle added this to the 4.4 milestone Sep 18, 2019
@xdelaruelle xdelaruelle self-assigned this Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant