[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Any interest in Debian packages of Geant 4?

On 23 Dec 2005 18:34:28 +0100, Thomas Walter <t.walter@nefkom.net> wrote:
> On Fri, 2005-12-23 at 01:59, Christian Holm Christensen wrote:
>> In my humble opinion, wrapper scripts are ugly.   That said, I could
>> imagine that it would be the best solution (for now) to package GEANT 4
>> - it's a mess when it comes to environment variables.  However, in the
>> long run, it'd probably be better to lobby for cleaning the code of
>> environment variables - after all, GEANT 4 is really a library, not a
>> specific application.

I agree the wrapper scripts are ugly -- unfortunately I can't think of
any other way to satisfy both Geant's need for environment variables
and Debian Policy's ban on them.  Also, my packages won't force the
user to use the wrapper scripts -- s/he can instead set the
environment variables at login time automatically (if s/he wants) just
by sourcing a specific shell file.  Check out the README.Debian in the
source package of geant4 (deb-src URL was given earlier in this

I further agree that upstream should switch away from environment
variables entirely, but it sometimes seems like a lot of physicists
have a strange addiction to them.  Must be due to the field's FORTRAN
heritage where it was non-trivial to write programs that can read
command-line flags.

> What's about the idea to switch to init files?
> A default in /etc and also a user init file in $HOME.
> But then it looks more like to be implemented by upstream.

The file debian/defaults/geant4 in my source package, which gets
installed as /etc/default/geant4 in the binary .deb of geant4-common,
and can be copied to $HOME/.geant4-defaults, is for exactly this
purpose.  :-) The logic that translates these variables into Geant 4
environment variables is in debian/scripts/g4defaults.sh and
opengl.sh, each of which is sourced (if it exists) from
debian/scripts/env.sh (installed as /usr/share/geant4/env.sh in the
geant4-common .deb).  In turn, env.sh is sourced from the g4make and
g4run wrapper scripts, or (if the user so desires) from the user's
shell login files.

Note that the installation directory env. variables like $G4LIB are
set automatically in env.sh with no user intervention needed.  Indeed,
since the Debian packages would always install files to specific
locations, there is no need for these to be user-settable.  Just the
"USE" flags, etc. such as $G4UI_USE_XM would be set through
/etc/default/geant4 or ~/.geant4-defaults.

best regards,

Kevin B. McCarty <kmccarty@princeton.edu>   Physics Department
WWW: http://www.princeton.edu/~kmccarty/    Princeton University
GPG: public key ID 4F83C751                 Princeton, NJ 08544

Reply to: