--- postgresql-ocaml-1.7.0.orig/lib/postgresql.mli +++ postgresql-ocaml-1.7.0/lib/postgresql.mli @@ -727,6 +727,16 @@ @raise Error if there is a connection error. *) + (** Escaping *) + + method escape_string : ?pos : int -> ?len : int -> string -> string + (** [escape_string ?pos ?len str] escapes ASCII-substring [str] + of length [len] starting at position [pos] for use within SQL. + + @param pos default = 0 + @param len default = String.length str - pos + *) + method escape_bytea : ?pos : int -> ?len : int -> string -> string (** [escape_bytea ?pos ?len str] escapes binary substring [str] of length [len] starting at position [pos] for use within SQL. --- postgresql-ocaml-1.7.0.orig/lib/postgresql_stubs.c +++ postgresql-ocaml-1.7.0/lib/postgresql_stubs.c @@ -513,6 +513,29 @@ Int_val(v_len))); } +CAMLprim value PQescapeStringConn_stub( + value v_conn, value v_from, value v_pos_from, value v_len) +{ + size_t len = Int_val(v_len); + size_t to_len = len + len + 1; + char *buf = malloc(to_len); + int error; + size_t n_written = + PQescapeStringConn( + get_conn(v_conn), + buf, String_val(v_from) + Int_val(v_pos_from), + len, &error); + if (error) { + free(buf); + caml_failwith("Postgresql.escape_string_conn: failed to escape string"); + } else { + value v_res = caml_alloc_string(n_written); + memcpy(String_val(v_res), buf, n_written); + free(buf); + return v_res; + } +} + CAMLprim value PQescapeByteaConn_stub( value v_conn, value v_from, value v_pos_from, value v_len) { --- postgresql-ocaml-1.7.0.orig/lib/postgresql.ml +++ postgresql-ocaml-1.7.0/lib/postgresql.ml @@ -401,6 +401,10 @@ string -> int -> string -> int -> int -> int = "PQescapeString_stub" "noalloc" + external escape_string_conn : + connection -> string -> pos : int -> len : int -> string + = "PQescapeStringConn_stub" + external escape_bytea_conn : connection -> string -> int -> int -> string = "PQescapeByteaConn_stub" @@ -566,6 +570,24 @@ field "tty" tty; field "requiressl" requiressl; Buffer.contents b in + let get_str_pos_len ~loc ?pos ?len str = + let str_len = String.length str in + match pos, len with + | None, None -> 0, str_len + | Some pos, _ when pos < 0 -> + invalid_arg (sprintf "Postgresql.%s: pos < 0" loc) + | _, Some len when len < 0 -> + invalid_arg (sprintf "Postgresql.%s: len < 0" loc) + | Some pos, None when pos > str_len -> + invalid_arg (sprintf "Postgresql.%s: pos > length(str)" loc) + | Some pos, None -> pos, str_len - pos + | None, Some len when len > str_len -> + invalid_arg (sprintf "Postgresql.%s: len > length(str)" loc) + | None, Some len -> 0, len + | Some pos, Some len when pos + len > str_len -> + invalid_arg (sprintf "Postgresql.%s: pos + len > length(str)" loc) + | Some pos, Some len -> pos, len + in fun () -> let conn = Stub.connect conn_info in @@ -583,11 +605,12 @@ method finish = check_null (); Stub.finish conn - method escape_bytea ?(pos = 0) ?len str = - let str_len = String.length str in - let len = match len with Some len -> len | None -> str_len in - if pos < 0 || len < 0 || pos + len > str_len then - invalid_arg "Postgresql.escape_bytea"; + method escape_string ?pos ?len str = + let pos, len = get_str_pos_len ~loc:"escape_string" ?pos ?len str in + Stub.escape_string_conn conn str ~pos ~len + + method escape_bytea ?pos ?len str = + let pos, len = get_str_pos_len ~loc:"escape_bytea" ?pos ?len str in Stub.escape_bytea_conn conn str pos len method try_reset = --- postgresql-ocaml-1.7.0.orig/debian/libpostgresql-ocaml.dirs.in +++ postgresql-ocaml-1.7.0/debian/libpostgresql-ocaml.dirs.in @@ -0,0 +1 @@ +usr/lib/ocaml/@OCamlABI@/stublibs --- postgresql-ocaml-1.7.0.orig/debian/svn-deblayout +++ postgresql-ocaml-1.7.0/debian/svn-deblayout @@ -0,0 +1,3 @@ +origDir=../upstream +origUrl=svn+ssh://svn.debian.org/svn/pkg-ocaml-maint/trunk/packages/postgresql-ocaml/upstream +tagsUrl=svn+ssh://svn.debian.org/svn/pkg-ocaml-maint/tags/packages/postgresql-ocaml --- postgresql-ocaml-1.7.0.orig/debian/compat +++ postgresql-ocaml-1.7.0/debian/compat @@ -0,0 +1 @@ +5 --- postgresql-ocaml-1.7.0.orig/debian/docs +++ postgresql-ocaml-1.7.0/debian/docs @@ -0,0 +1 @@ +README --- postgresql-ocaml-1.7.0.orig/debian/control +++ postgresql-ocaml-1.7.0/debian/control @@ -0,0 +1,39 @@ +Source: postgresql-ocaml +Section: devel +Priority: optional +Maintainer: Debian OCaml Maintainers +Uploaders: Stefano Zacchiroli +Build-Depends: debhelper (>= 5.0.0), ocaml-nox (>= 3.10.0-4), ocaml-findlib (>= 1.1), libpq-dev, dpatch, cdbs +Standards-Version: 3.7.3 +Vcs-Svn: svn://svn.debian.org/svn/pkg-ocaml-maint/trunk/packages/postgresql-ocaml +Vcs-Browser: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/postgresql-ocaml/trunk/ +Homepage: http://www.ocaml.info/home/ocaml_sources.html#postgresql-ocaml + +Package: libpostgresql-ocaml-dev +Architecture: any +Section: libdevel +Depends: ocaml-nox-${F:OCamlABI}, ocaml-findlib (>= 1.1), libpq-dev, libpostgresql-ocaml (= ${binary:Version}) +Suggests: ocamlmakefile +Description: OCaml bindings to PostgreSQL's libpq + This OCaml-library provides an interface to PostgreSQL, an + efficient and reliable, open source, relational database. + Almost all functionality available through the C-API (libpq) is + replicated in a type-safe way. This library uses objects for + representing database connections and results of queries. + . + This package contains all the development stuff you need to use + OCaml Postgres bindings in your programs. + +Package: libpostgresql-ocaml +Architecture: any +Section: libs +Depends: ocaml-base-nox-${F:OCamlABI}, ${shlibs:Depends}, ${misc:Depends} +Description: OCaml bindings to PostgreSQL's libpq + This OCaml-library provides an interface to PostgreSQL, an + efficient and reliable, open source, relational database. + Almost all functionality available through the C-API (libpq) is + replicated in a type-safe way. This library uses objects for + representing database connections and results of queries. + . + This package contains only the shared runtime stub libraries. + --- postgresql-ocaml-1.7.0.orig/debian/libpostgresql-ocaml-dev.examples +++ postgresql-ocaml-1.7.0/debian/libpostgresql-ocaml-dev.examples @@ -0,0 +1 @@ +examples/* --- postgresql-ocaml-1.7.0.orig/debian/copyright +++ postgresql-ocaml-1.7.0/debian/copyright @@ -0,0 +1,19 @@ +This package was debianized by Stefano Zacchiroli on +Tue, 4 May 2004 15:33:22 +0200. + +It was downloaded from: + + http://www.oefai.at/~markus/home/ocaml_sources.html + +Upstream Authors: + Alain Frisch + Markus Mottl + +Copyright: + + PostgreSQL-OCaml is distributed under the terms of the GNU Lesser + General Public License (LGPL). + + On Debian GNU/Linux systems LGPL license can be found as: + /usr/share/common-licenses/LGPL + --- postgresql-ocaml-1.7.0.orig/debian/source.lintian-overrides +++ postgresql-ocaml-1.7.0/debian/source.lintian-overrides @@ -0,0 +1 @@ +postgresql-ocaml source: dpatch-index-references-non-existant-patch examples.dpatch --- postgresql-ocaml-1.7.0.orig/debian/libpostgresql-ocaml-dev.dirs.in +++ postgresql-ocaml-1.7.0/debian/libpostgresql-ocaml-dev.dirs.in @@ -0,0 +1 @@ +usr/lib/ocaml/@OCamlABI@ --- postgresql-ocaml-1.7.0.orig/debian/changelog +++ postgresql-ocaml-1.7.0/debian/changelog @@ -0,0 +1,187 @@ +postgresql-ocaml (1.7.0-3+lenny1build0.9.04.1) jaunty-security; urgency=low + + * fake sync from Debian + + -- Jamie Strandboge Sat, 12 Dec 2009 11:30:17 -0600 + +postgresql-ocaml (1.7.0-3+lenny1) stable-security; urgency=low + + * Add connection-aware escaping functions which can access character + encoding information and avoid SQL injection attacks based on the + choice specific encodings (CVE-2009-2943). + + -- Stefano Zacchiroli Sun, 20 Sep 2009 13:01:09 +0200 + +postgresql-ocaml (1.7.0-3) unstable; urgency=low + + * update standards-version + - substitute binary:Version substvar in debian/control for Source-Version, + now deprecated + * add Homepage field to debian/control + * set me as an uploader, d-o-m as the maintainer + * debian/patches: + - add description to patches install_destdir.dpatch and examples.dpatch.in + - fix 00list: it should list examples.dpatch (i.e. examples.dpatch.in + after it has been generated) + - refresh examples.dpatch.in to point to the current location of + OCamlMakefile + * suggests ocamlmakefile and point out in README.Debian that it is easier + with it to compile examples + * add lintian override for missing examples.dpatch patch in 00list; the + patch is automatically generated from examples.dpatch.in + + -- Stefano Zacchiroli Sat, 29 Dec 2007 23:37:11 +0100 + +postgresql-ocaml (1.7.0-2) unstable; urgency=low + + * rebuild against OCaml 3.10 and upload to unstable (closes: #441158) + * debian/rules + - enable generation of ocamldoc api reference (via CDBS) + + -- Stefano Zacchiroli Sat, 08 Sep 2007 10:51:27 +0200 + +postgresql-ocaml (1.7.0-1) experimental; urgency=low + + * new upstream release + * rebuild with OCaml 3.10 + * bump debhelper build-dep and compatibility level to 5 + * debian/patches + - remove no longer needed patch 05_meta + - rename patches to more meaningful names + * debian/rules + - remove a workaround for dpatch, no longer needed with the latest + ocaml.mk + + -- Stefano Zacchiroli Fri, 13 Jul 2007 11:11:42 +0200 + +postgresql-ocaml (1.5.4-2) unstable; urgency=low + + * debian/rules + - use ocaml.mk + * debian/control + - bumped build dependency on ocaml-nox to >= 3.09.2-7, since we now use + ocaml.mk + + -- Stefano Zacchiroli Sat, 4 Nov 2006 09:40:01 +0100 + +postgresql-ocaml (1.5.4-1) unstable; urgency=low + + * New upstream release + * debian/patches/05_meta + - commented out this patch, in this upstream release version number in + META matches library version + * debian/rules + - removed no longer needed workaround for cdbs + dpatch + - avoid to create debian/control from debian/control.in on ocamlinit + - special handling of debian/patches/03_examples: + + for the examples to be binNMU safe the patch needs to be filled as + other .in files -> added the patch to OFILES + + for dpatch to work with a .in patch, the patch must be instantiated + before cleaning -> added a cdbs pre-clean dep on ocamlinit + * debian/control.in + - file removed, no longer needed + * debian/watch + - changed web site (upstream web page moved) + - switched to watch format version 3 + + -- Stefano Zacchiroli Wed, 6 Sep 2006 10:17:43 +0200 + +postgresql-ocaml (1.4.6-7) unstable; urgency=low + + * Upload to unstable. + * debian/patches/03_examples.dpatch + - removed hard coded ocaml ABI versions + + -- Stefano Zacchiroli Sat, 27 May 2006 12:00:55 +0200 + +postgresql-ocaml (1.4.6-6) experimental; urgency=low + + * Rebuilt against OCaml 3.09.2, bumped deps accordingly. + * Bumped Standards-Version to 3.7.2 (no changes needed). + + -- Stefano Zacchiroli Thu, 11 May 2006 22:11:22 +0000 + +postgresql-ocaml (1.4.6-5) experimental; urgency=low + + * Rebuilt against OCaml 3.09.2, bumped deps accordingly. + * Bumped Standards-Version to 3.7.2 (no changes needed). + + -- Stefano Zacchiroli Thu, 11 May 2006 22:07:09 +0000 + +postgresql-ocaml (1.4.6-4) unstable; urgency=low + + * Rebuilt against OCaml 3.09.1, bumped deps accordingly. + + -- Stefano Zacchiroli Sat, 7 Jan 2006 14:33:57 +0100 + +postgresql-ocaml (1.4.6-3) unstable; urgency=low + + * debian/rules + - proper setting of DEB_MAKE_INSTALL_TARGET when ocamlopt is not + available, fixes FTBFS on non native code archs + + -- Stefano Zacchiroli Sun, 13 Nov 2005 14:35:44 +0000 + +postgresql-ocaml (1.4.6-2) unstable; urgency=low + + * Rebuilt with ocaml 3.09 + * debian/* + - use cdbs + - no longer hardcoding of ocaml abi version anywhere + * debian/control + - bumped standards version + * debian/patches/ + - removed CFLAGS from 01_makefile.dpatch, now set via cdbs + - ported 03_examples.dpatch to ocaml 3.09 + + -- Stefano Zacchiroli Sun, 13 Nov 2005 10:24:55 +0000 + +postgresql-ocaml (1.4.6-1) unstable; urgency=low + + * New upstream release + * debian/control + - changed dependencies accordingly to new postgresql packaging + * debian/patches/01_makefile + - uses pg_config to guess proper include dir + - uses /dev/null instead of foo.ld.conf to fool findlib ld.conf handling + * debian/patches/05_meta + - fix postgresql-ocaml version in upstream META + + -- Stefano Zacchiroli Mon, 13 Jun 2005 11:10:08 +0200 + +postgresql-ocaml (1.4.2-2) unstable; urgency=low + + * Rebuilt against ocaml 3.08.3 + + -- Stefano Zacchiroli Thu, 24 Mar 2005 22:37:33 +0100 + +postgresql-ocaml (1.4.2-1) unstable; urgency=low + + * New upstream release (Closes: Bug#286662) + + -- Stefano Zacchiroli Tue, 21 Dec 2004 16:59:55 +0100 + +postgresql-ocaml (1.3.3-3) unstable; urgency=medium + + * debian/control + - depend on ocaml-base-nox-3.08 instead of ocaml-base-3.08 since + this package doesn't directly need ocaml X libraries + + -- Stefano Zacchiroli Tue, 24 Aug 2004 12:14:56 +0200 + +postgresql-ocaml (1.3.3-2) unstable; urgency=low + + * rebuilt with ocaml 3.08 + * debian/control + - bumped ocaml deps to 3.08 + - bumped standards-version to 3.6.1.1 + - changed ocaml deps to ocaml-nox + + -- Stefano Zacchiroli Mon, 26 Jul 2004 18:20:53 +0200 + +postgresql-ocaml (1.3.3-1) unstable; urgency=low + + * Initial Release. + + -- Stefano Zacchiroli Tue, 4 May 2004 15:33:22 +0200 + --- postgresql-ocaml-1.7.0.orig/debian/watch +++ postgresql-ocaml-1.7.0/debian/watch @@ -0,0 +1,3 @@ +version=3 + +http://ocaml.info/ocaml_sources/postgresql-ocaml-(.*)\.tar\.gz --- postgresql-ocaml-1.7.0.orig/debian/rules +++ postgresql-ocaml-1.7.0/debian/rules @@ -0,0 +1,29 @@ +#!/usr/bin/make -f +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/makefile.mk +include /usr/share/cdbs/1/rules/dpatch.mk +include /usr/share/cdbs/1/class/ocaml.mk + +PKGNAME = libpostgresql-ocaml-dev + + # The examples patch needs to be patched since it contains hard coded ABI + # numbers. +OCAML_IN_FILES += debian/patches/examples.dpatch +OCAML_OCAMLDOC_PACKAGES = $(OCAML_LIBDEV_PACKAGES) +DEB_SRCDIR = $(CURDIR)/lib +DEB_MAKE_BUILD_TARGET = byte-code-library +CFLAGS += -I$(shell pg_config --includedir) -fPIC +DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(CURDIR)/debian/$(PKGNAME)$(OCAML_STDLIB_DIR) + +ifeq ($(OCAML_HAVE_OCAMLOPT),yes) +build/$(PKGNAME):: + $(MAKE) -C $(DEB_SRCDIR)/ native-code-library +endif + +ifneq ($(OCAML_HAVE_OCAMLOPT),yes) +export LIBINSTALL_FILES = libpostgresql_stubs.a postgresql.cma postgresql.cmi postgresql.mli dllpostgresql_stubs.so +endif + +binary-install/$(PKGNAME):: + mv $(CURDIR)/debian/$(PKGNAME)$(OCAML_STDLIB_DIR)/postgresql/*.so \ + $(CURDIR)/debian/$(patsubst %-dev,%,$(PKGNAME))$(OCAML_STDLIB_DIR)/stublibs/ --- postgresql-ocaml-1.7.0.orig/debian/README.Debian +++ postgresql-ocaml-1.7.0/debian/README.Debian @@ -0,0 +1,9 @@ +Building PostgtreSQL-OCaml examples +----------------------------------- + +To easily build the examples available in +/usr/share/doc/libpostgresql-ocaml-dev/examples/ you should install +OCamlMakefile which is available in the Debian package "ocamlmakefile", since +the examples' Makefiles reference it. + + -- Stefano Zacchiroli Sat, 29 Dec 2007 23:37:11 +0100 --- postgresql-ocaml-1.7.0.orig/debian/patches/00dpatch.conf +++ postgresql-ocaml-1.7.0/debian/patches/00dpatch.conf @@ -0,0 +1,2 @@ +conf_debianonly=1 +conf_origtargzpath=../upstream --- postgresql-ocaml-1.7.0.orig/debian/patches/00list +++ postgresql-ocaml-1.7.0/debian/patches/00list @@ -0,0 +1,2 @@ +install_destdir.dpatch +examples.dpatch --- postgresql-ocaml-1.7.0.orig/debian/patches/examples.dpatch.in +++ postgresql-ocaml-1.7.0/debian/patches/examples.dpatch.in @@ -0,0 +1,100 @@ +#! /bin/sh -e +## 03_examples.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: make examples easily buildable in Debian + +if [ $# -lt 1 ]; then + echo "`basename $0`: script expects -patch|-unpatch as argument" >&2 + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}" + +case "$1" in + -patch) patch -p1 ${patch_opts} < $0;; + -unpatch) patch -R -p1 ${patch_opts} < $0;; + *) + echo "`basename $0`: script expects -patch|-unpatch as argument" >&2 + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad /home/zack/dati/debian/packages/postgresql-ocaml/postgresql-ocaml-1.3.3/examples/dump/Makefile postgresql-ocaml-1.3.3/examples/dump/Makefile +--- /home/zack/dati/debian/packages/postgresql-ocaml/postgresql-ocaml-1.3.3/examples/dump/Makefile 2004-01-28 18:14:59.000000000 +0100 ++++ postgresql-ocaml-1.3.3/examples/dump/Makefile 2004-05-04 16:40:33.057062192 +0200 +@@ -1,8 +1,8 @@ +-OCAMLMAKEFILE = ../../OCamlMakefile ++OCAMLMAKEFILE = /usr/share/ocamlmakefile/OCamlMakefile + + SOURCES = dump.ml +-INCDIRS = ../../lib +-LIBDIRS = ../../lib ++INCDIRS = /usr/lib/ocaml/@OCamlABI@/postgresql ++LIBDIRS = /usr/lib/ocaml/@OCamlABI@/postgresql + LIBS = postgresql + RESULT = dump + +diff -urNad /home/zack/dati/debian/packages/postgresql-ocaml/postgresql-ocaml-1.3.3/examples/populate/Makefile postgresql-ocaml-1.3.3/examples/populate/Makefile +--- /home/zack/dati/debian/packages/postgresql-ocaml/postgresql-ocaml-1.3.3/examples/populate/Makefile 2004-01-28 18:15:00.000000000 +0100 ++++ postgresql-ocaml-1.3.3/examples/populate/Makefile 2004-05-04 16:40:36.453545848 +0200 +@@ -1,8 +1,8 @@ +-OCAMLMAKEFILE = ../../OCamlMakefile ++OCAMLMAKEFILE = /usr/share/ocamlmakefile/OCamlMakefile + + SOURCES = populate.ml +-INCDIRS = ../../lib +-LIBDIRS = ../../lib ++INCDIRS = /usr/lib/ocaml/@OCamlABI@/postgresql ++LIBDIRS = /usr/lib/ocaml/@OCamlABI@/postgresql + LIBS = postgresql + RESULT = populate + +diff -urNad /home/zack/dati/debian/packages/postgresql-ocaml/postgresql-ocaml-1.3.3/examples/prompt/Makefile postgresql-ocaml-1.3.3/examples/prompt/Makefile +--- /home/zack/dati/debian/packages/postgresql-ocaml/postgresql-ocaml-1.3.3/examples/prompt/Makefile 2004-01-28 18:15:00.000000000 +0100 ++++ postgresql-ocaml-1.3.3/examples/prompt/Makefile 2004-05-04 16:40:43.732439288 +0200 +@@ -1,8 +1,8 @@ +-OCAMLMAKEFILE = ../../OCamlMakefile ++OCAMLMAKEFILE = /usr/share/ocamlmakefile/OCamlMakefile + + SOURCES = prompt.ml +-INCDIRS = ../../lib +-LIBDIRS = ../../lib ++INCDIRS = /usr/lib/ocaml/@OCamlABI@/postgresql ++LIBDIRS = /usr/lib/ocaml/@OCamlABI@/postgresql + LIBS = postgresql + THREADS = yes + RESULT = prompt +diff -urNad /home/zack/dati/debian/packages/postgresql-ocaml/postgresql-ocaml-1.3.3/examples/prompt_gtk/Makefile postgresql-ocaml-1.3.3/examples/prompt_gtk/Makefile +--- /home/zack/dati/debian/packages/postgresql-ocaml/postgresql-ocaml-1.3.3/examples/prompt_gtk/Makefile 2004-01-28 18:15:00.000000000 +0100 ++++ postgresql-ocaml-1.3.3/examples/prompt_gtk/Makefile 2004-05-04 16:40:40.384948184 +0200 +@@ -1,8 +1,8 @@ +-OCAMLMAKEFILE = ../../OCamlMakefile ++OCAMLMAKEFILE = /usr/share/ocamlmakefile/OCamlMakefile + + SOURCES = prompt_gtk.ml +-INCDIRS = ../../lib +-LIBDIRS = ../../lib ++INCDIRS = /usr/lib/ocaml/@OCamlABI@/postgresql ++LIBDIRS = /usr/lib/ocaml/@OCamlABI@/postgresql + LIBS = postgresql + PACKS = lablgtk + OCAMLBLDFLAGS = gtkInit.cmo +diff -urNad /home/zack/dati/debian/packages/postgresql-ocaml/postgresql-ocaml-1.3.3/examples/test_lo/Makefile postgresql-ocaml-1.3.3/examples/test_lo/Makefile +--- /home/zack/dati/debian/packages/postgresql-ocaml/postgresql-ocaml-1.3.3/examples/test_lo/Makefile 2004-01-28 18:15:00.000000000 +0100 ++++ postgresql-ocaml-1.3.3/examples/test_lo/Makefile 2004-05-04 16:40:48.574703152 +0200 +@@ -1,8 +1,8 @@ +-OCAMLMAKEFILE = ../../OCamlMakefile ++OCAMLMAKEFILE = /usr/share/ocamlmakefile/OCamlMakefile + + SOURCES = test_lo.ml +-INCDIRS = ../../lib +-LIBDIRS = ../../lib ++INCDIRS = /usr/lib/ocaml/@OCamlABI@/postgresql ++LIBDIRS = /usr/lib/ocaml/@OCamlABI@/postgresql + LIBS = postgresql + RESULT = test_lo + --- postgresql-ocaml-1.7.0.orig/debian/patches/install_destdir.dpatch +++ postgresql-ocaml-1.7.0/debian/patches/install_destdir.dpatch @@ -0,0 +1,37 @@ +#! /bin/sh -e +## 01_makefile.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: enable passing target installation directory from debian/rules + +if [ $# -lt 1 ]; then + echo "`basename $0`: script expects -patch|-unpatch as argument" >&2 + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}" + +case "$1" in + -patch) patch -p1 ${patch_opts} < $0;; + -unpatch) patch -R -p1 ${patch_opts} < $0;; + *) + echo "`basename $0`: script expects -patch|-unpatch as argument" >&2 + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad trunk~/lib/Makefile trunk/lib/Makefile +--- trunk~/lib/Makefile 2005-05-31 16:00:47.000000000 +0000 ++++ trunk/lib/Makefile 2005-11-13 10:49:43.000000000 +0000 +@@ -4,6 +4,8 @@ + CFLAGS = -O2 + CLIBS = pq + RESULT = postgresql ++DESTDIR = ++OCAMLFIND_INSTFLAGS = -ldconf /dev/null -destdir $(DESTDIR) + + all: +