Subject: Re: devel/apache-ant problem
To: None <tech-pkg@NetBSD.org>
From: Antoine Reilles <Antoine.Reilles@loria.fr>
List: tech-pkg
Date: 12/21/2005 00:27:51
--CE+1k2dSO48ffgeK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Dec 14, 2005 at 09:31:33AM -0700, brook@biology.nmsu.edu wrote:
> Antoine Reilles writes:
>  > > The problem is that there is no $PREFIX/bin/java installed by java,
>  > > and so the program fails.
>  > It should be provided by pkg_alternatives
>=20
> Thank you.  This is indeed the problem.  Installing
> pkgtools/pkg_alternatives solves it.
but there is still a problem if pkg_alternatives is not installed
>=20
>  > pkg_alternatives should be installed as soon as you install a package
>  > providing an alternative, and i counted on that for apache-ant.
>=20
> As far as I can see, this is not the case.  For example, installing
> one of the java packages does not automatically install
> pkgtools/pkg_alternatives.  Consequently, downstream packages (e.g.,
> apache-ant) fail.
Maybe jmmv can say more about this: should each package providing
alternatives require pkg_alternatives is installed ? I'm not sure it
would be a good thing. Also, it is better not to use alternatives
wrapper from within a package, since the user may change the behavior,
creating strange behaviors (like using apache-ant with unmatched vm and
classpath). That way apache-ant was wrong.
>=20
> This suggests that pkgtools/pkg_alternatives is an absolute
> prerequisite for at least some packages to work correctly.  I am not
> sure what the best solution is, but it strikes me that this is an area
> in need of improvement, not by addressing specific packages (like
> apache-ant) but by providing a generic solution.
If pkg_altenratives may not be used from within packages, then the
apache-ant package needs a way to know where the java program is.
using ${JAVA_HOME}/bin/java is not enough, since some packages installs
their java vm with another name, e.g. sablevm.

I propose adding a JAVABIN variable in mk/java-vm.mk, and set it to the
correct value there, to be used in other packages installing scripts
calling java.

regards,
antoine

--CE+1k2dSO48ffgeK
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDqJN34VqmoGDE/mwRAg3iAJ4srGjWVPqHCXfDO24pTieD5ZX88wCeILKs
YohG7dJmnt5OJ+PHTJjibbU=
=E0Po
-----END PGP SIGNATURE-----

--CE+1k2dSO48ffgeK--