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

Re: Environment variables for Debian (e.g. JAVA_HOME, etc)



I hadn't looked at this policy before, but I still don't see the point.
The fact that debian packages must NOT rely on env. variables doesn't mean that
they can't provide some.

Once again let's look at java packages. In order to correctly use a JDK, you
need to have the /usr/j2sdk/bin directory in your path. As far as I saw,
make-jpkg doesn't create wrappers for every executable in /usr/lib/j2sdk/bin,
nor does it create symlinks to /usr/bin/ for them.

So, even after installing the .deb, java is not useable right away. Solutions :
 - export PATH=$PATH:/usr/j2sdk/bin
 - for i in /usr/j2sdk/bin/* ; do ln -s $i /usr/bin/ ; done
 - create a wrapper script for every executable
 - others ?

So, what's the debian way of doing things ? Added to that, what happens if
there's a deb that packages some .jar ? (ex: junit). How to tell the java
system to recognize the deb so that users don't have to export CLASSPATH
themselves ? once again, w/o env. variables, I don't see how the java system
could be useable right away.

Regards,
sam

Quoting Peter Samuelson <peter@p12n.org>:

>
> [Sami Dalouche]
> > OK, it looks fine for the administrator's environment variables.
> > But look at java JDKs packages created by make-jpkg.
> >
> > Does make-kpkg have any decent place for adding environment variables ?
> > It looks like it doesn't, and no variable is exported.
>
> Did you read Policy section 9.9, as Daniel Burrows suggested?
>
>   http://www.debian.org/doc/debian-policy/ch-opersys.html#s9.9
>
> I'll summarize: Debian does not need a mechanism for packages to set
> system-wide environment variables, because Debian packages are not
> allowed to rely on environment variables at all.
>
> Anything that requires users to set environment variables on other
> systems should be packaged with a wrapper script or similar mechanism,
> in Debian, so that the variables do not need to be set explicitly in
> the user's session.
>
> Peter
>




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



Reply to: