diff -u plr-8.2.0.1/debian/control plr-8.2.0.1/debian/control --- plr-8.2.0.1/debian/control +++ plr-8.2.0.1/debian/control @@ -1,9 +1,10 @@ Source: plr Priority: optional Section: libs -Maintainer: Martin Pitt +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Martin Pitt Uploaders: Oliver Elphick -Build-Depends: debhelper (>= 4.0.0), postgresql-server-dev-8.2, r-base-core +Build-Depends: debhelper (>= 4.0.0), dpatch, postgresql-server-dev-8.2, r-base-core Standards-Version: 3.7.2 Package: postgresql-8.2-plr diff -u plr-8.2.0.1/debian/rules plr-8.2.0.1/debian/rules --- plr-8.2.0.1/debian/rules +++ plr-8.2.0.1/debian/rules @@ -3,6 +3,8 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +include /usr/share/dpatch/dpatch.make + HERE=$(shell pwd) ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) @@ -16,7 +18,7 @@ SHLIB_LINK=-Wl,-rpath /usr/lib/R/lib export LDFLAGS SHLIB_LINK -clean: +clean: unpatch dh_testdir dh_testroot $(MAKE) USE_PGXS=1 R_HOME=/usr/lib/R distclean @@ -24,7 +26,7 @@ rm -f unpack-stamp build-stamp build: build-stamp -build-stamp: +build-stamp: patch-stamp dh_testdir $(MAKE) USE_PGXS=1 R_HOME=/usr/lib/R -I/usr/share/R/include PG_CPPFLAGS=-I/usr/share/R/include touch build-stamp diff -u plr-8.2.0.1/debian/changelog plr-8.2.0.1/debian/changelog --- plr-8.2.0.1/debian/changelog +++ plr-8.2.0.1/debian/changelog @@ -1,3 +1,11 @@ +plr (1:8.2.0.1-1ubuntu1) gutsy; urgency=low + + * Set a fallback R_HOME environment variable if it is not provided + elsewhere (LP: #130059) + * Update Maintainer field in debian/control + + -- Luca Falavigna Fri, 24 Aug 2007 07:26:38 +0000 + plr (1:8.2.0.1-1) unstable; urgency=low * New upstream version, now works with PostgreSQL 8.2. only in patch2: unchanged: --- plr-8.2.0.1.orig/debian/patches/01_R_HOME_fallback.dpatch +++ plr-8.2.0.1/debian/patches/01_R_HOME_fallback.dpatch @@ -0,0 +1,32 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 01_R_HOME_hardcoded.dpatch by Luca Falavigna +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Set a fallback R_HOME environment variable if it is not provided elsewhere. + +@DPATCH@ +diff -urNad plr-8.2.0.1~/plr.c plr-8.2.0.1/plr.c +--- plr-8.2.0.1~/plr.c 2007-08-24 09:46:35.000000000 +0000 ++++ plr-8.2.0.1/plr.c 2007-08-24 09:50:23.000000000 +0000 +@@ -281,6 +281,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 -urNad plr-8.2.0.1~/plr.h plr-8.2.0.1/plr.h +--- plr-8.2.0.1~/plr.h 2007-08-24 09:41:00.000000000 +0000 ++++ plr-8.2.0.1/plr.h 2007-08-24 09:48:52.000000000 +0000 +@@ -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 <= 200510211) + #error "This version of PL/R only builds with PostgreSQL 8.2" only in patch2: unchanged: --- plr-8.2.0.1.orig/debian/patches/00list +++ plr-8.2.0.1/debian/patches/00list @@ -0,0 +1 @@ +01_R_HOME_fallback