User:Abo/Environment modules packaging

Environment modules is a system for manipulating environment variables upon the request of a user. The user adds or removes "modules" which for example can cause directories to be added to or removed from the PATH or MANPATH.

Typically this is used to allow a user to select between multiple versions of a single application or between multiple similar applications that provides the same commands. It's similar to the "alternatives" system but operates per user or per shell instead of per host.

If appropriate, a package should provide such a module by installing a module definition file in /usr/share/Modules/moduleshome/%{name}/%{version}. The contents of the file should be something like this:

/usr/share/Modules/moduleshome/java-1.5.0-gcj/1.5.0.0: prepend-path PATH /usr/lib/jvm/java-1.5.0-gcj-1.5.0.0
 * 1) %Module

Notes: Who owns .version? Forbid it?