#! /bin/sh -e 
## versioned_libdir.dpatch by  <luther@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Add the version as path element for OCAML_LIBDIR.

if [ $# -ne 1 ]; then
    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
    exit 1
fi
case "$1" in
    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;	
    *)
	echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
	exit 1;;
esac

exit 0
@DPATCH@
diff -ur ocaml.orig/camlp4/config/configure_batch ocaml/camlp4/config/configure_batch
--- ocaml.orig/camlp4/config/configure_batch.orig	2003-09-30 18:11:57.000000000 +0200
+++ ocaml/camlp4/config/configure_batch	2003-09-30 18:12:51.000000000 +0200
@@ -103,13 +103,13 @@
    *) echo "BINDIR=$bindir" >> Makefile.cnf;;
 esac
 case "$libdir" in
-  "") echo 'LIBDIR=$(PREFIX)/lib/camlp4' >> Makefile.cnf
-      libdir="$prefix/lib/camlp4";;
+  "") echo 'LIBDIR=$(PREFIX)/lib/ocaml/#OcamlABI#/camlp4' >> Makefile.cnf
+      libdir="$prefix/lib/ocaml/#OcamlABI#/camlp4";;
    *) echo "LIBDIR=$libdir" >> Makefile.cnf;;
 esac
 case "$mandir" in
-  "") echo 'MANDIR=$(PREFIX)/man/man1' >> Makefile.cnf
-      mandir="$prefix/man/man1";;
+  "") echo 'MANDIR=$(PREFIX)/share/man/man1' >> Makefile.cnf
+      mandir="$prefix/share/man/man1";;
    *) echo "MANDIR=$mandir" >> Makefile.cnf;;
 esac
 
diff -ur ocaml.orig/configure ocaml/configure
--- ocaml.orig/configure	2003-09-30 18:09:47.000000000 +0200
+++ ocaml/configure	2003-09-30 18:10:12.000000000 +0200
@@ -146,8 +146,8 @@
    *) echo "BINDIR=$bindir" >> Makefile;;
 esac
 case "$libdir" in
-  "") echo 'LIBDIR=$(PREFIX)/lib/ocaml' >> Makefile
-      libdir="$prefix/lib/ocaml";;
+  "") echo 'LIBDIR=$(PREFIX)/lib/ocaml/#OcamlABI#' >> Makefile
+      libdir="$prefix/lib/ocaml/#OcamlABI#";;
    *) echo "LIBDIR=$libdir" >> Makefile;;
 esac
 echo 'STUBLIBDIR=$(LIBDIR)/stublibs' >> Makefile
