diff -u plr-0.6.2/debian/rules plr-0.6.2/debian/rules --- plr-0.6.2/debian/rules +++ plr-0.6.2/debian/rules @@ -28,6 +28,7 @@ for v in 8.1; do \ mkdir build-$$v; \ tar -C build-$$v -xzf plr-*.tar.gz; \ + cd build-$$v; patch -N -p1 < ../debian/patches/R_HOME_default.patch; \ done touch unpack-stamp diff -u plr-0.6.2/debian/changelog plr-0.6.2/debian/changelog --- plr-0.6.2/debian/changelog +++ plr-0.6.2/debian/changelog @@ -1,3 +1,10 @@ +plr (1:0.6.2-4ubuntu1.2) feisty-proposed; urgency=low + + * SRU for LP: #130059, list of changes: + - Fall back to /usr/lib/R if R_HOME is not defined + + -- Luca Falavigna Fri, 24 Aug 2007 21:45:27 +0200 + plr (1:0.6.2-4ubuntu1.1) feisty-proposed; urgency=low * SRU: Provide missing files /usr/lib/postgresql/8.1/lib/plr.so and only in patch2: unchanged: --- plr-0.6.2.orig/debian/patches/R_HOME_default.patch +++ plr-0.6.2/debian/patches/R_HOME_default.patch @@ -0,0 +1,25 @@ +diff -Nur plr/plr/plr.c plr.new/plr/plr.c +--- plr/plr/plr.c 2007-08-24 21:39:57.000000000 +0200 ++++ plr.new/plr/plr.c 2007-08-24 21:43:00.000000000 +0200 +@@ -278,6 +278,9 @@ + /* refuse to start if R_HOME is not defined */ + r_home = getenv("R_HOME"); + if (r_home == NULL) ++ setenv("R_HOME", R_HOME_FALLBACK, 1); ++ r_home = getenv("R_HOME"); ++ if (r_home == NULL) + ereport(ERROR, + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("environment variable R_HOME not defined"), +diff -Nur plr/plr/plr.h plr.new/plr/plr.h +--- plr/plr/plr.h 2005-03-31 02:02:35.000000000 +0200 ++++ plr.new/plr/plr.h 2007-08-24 21:43:43.000000000 +0200 +@@ -77,6 +77,8 @@ + #undef ELOG_H + #include "utils/elog.h" + ++#define R_HOME_FALLBACK "/usr/lib/R" ++ + /* working with postgres 7.3 compatible sources */ + #if (CATALOG_VERSION_NO <= 200211021) + #define PG_VERSION_73_COMPAT