[Pkg-postgresql-public] Bug#506728: postgresql-8.3-plr: Does not run ldconfig and does not set R_HOME in postgresql environment

Martin Pitt mpitt at debian.org
Tue Nov 25 07:23:56 UTC 2008


Andreas Tille [2008-11-24 21:13 +0100]:
> > 2. This change won't have an effect for clusters which are created
> >   after installation of -plr.
> 
> These cases should be covered by the included README.Debian.
> I see no other chance to copy with this.

Provinding an implicit default to the variable would cover this as
well.

> It seems as if there should be not that much instances of the R_HOME
> variable to be changed:
> 
> 6$ grep -R R_HOME * | grep -v -e ":[[:space:]]*/*\*" -e echo -e printf -e ":[[:space:]]*err" -e README -e '#' -e '^doc'
> debian/rules:DEB_MAKE_ENVVARS:=USE_PGXS=1 R_HOME=/usr/lib/R
> debian/rules:DEB_MAKE_INSTALL_TARGET:=USE_PGXS=1 R_HOME=/usr/lib/R install DESTDIR=debian/tmp/
> Makefile:ifdef R_HOME
> Makefile:r_libdir1x = ${R_HOME}/bin
> Makefile:r_libdir2x = ${R_HOME}/lib
> Makefile:r_includespec = ${R_HOME}/include
> Makefile:R_HOME := $(shell pkg-config --variable=rhome libR)
> Makefile:ifneq (,${R_HOME})

Those should all be irrelevant, since they only affect build.

> Makefile:override CPPFLAGS += -DR_HOME_DEFAULT=\"$(rhomedef)\"

That looks interesting! Maybe setting $rhomedef during build will
already exactly do what we need?

> pg_userfuncs.c: unsetenv("R_HOME");
> plr.c:  r_home = getenv("R_HOME");
> plr.c:          size_t          rh_len = strlen(R_HOME_DEFAULT);

This seems to be the important code, indeed. If $R_HOME_DEFAULT isn't
already a fallback, then having something like

  r_home = getenv("R_HOME");
  if (!r_home)
	  r_home = "/usr/lib/R";

should do the trick?

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)



More information about the Pkg-postgresql-public mailing list