--- camlzip-1.04.orig/debian/META.in
+++ camlzip-1.04/debian/META.in
@@ -0,0 +1,4 @@
+version="@VERSION@"
+requires="unix"
+archive(byte)="zip.cma"
+archive(native)="zip.cmxa"
--- camlzip-1.04.orig/debian/libzip-ocaml-dev.examples
+++ camlzip-1.04/debian/libzip-ocaml-dev.examples
@@ -0,0 +1 @@
+test/*
--- camlzip-1.04.orig/debian/README.source
+++ camlzip-1.04/debian/README.source
@@ -0,0 +1,16 @@
+Camlzip Debian source package
+=============================
+
+Patching upstream sources
+-------------------------
+
+This source package uses quilt to apply and remove its patches. Please
+refer to `/usr/share/doc/quilt/README.source' for information about
+how to use quilt for source packages.
+
+The quilt series is generated from the Git repository, using
+dom-{apply,save}-patches, from the dh-ocaml (>= 0.5) package. Please
+refer to the appendix about Git in the Debian OCaml Packaging Policy
+(from the same package).
+
+ -- Stéphane Glondu <glondu@debian.org>, Tue, 29 Sep 2009 09:55:12 +0200
--- camlzip-1.04.orig/debian/changelog
+++ camlzip-1.04/debian/changelog
@@ -0,0 +1,256 @@
+camlzip (1.04-6) unstable; urgency=low
+
+  * Switch patches to quilt
+  * debian/rules, debian/control:
+    - switch to dh+overrides and dh-ocaml 0.9
+    - update versioned dependencies to debhelper, quilt, dh-ocaml and
+      ocaml
+
+ -- Stéphane Glondu <glondu@debian.org>  Tue, 29 Sep 2009 10:45:25 +0200
+
+camlzip (1.04-5) unstable; urgency=low
+
+  * Fix version field in META file
+  * Add README.source
+  * debian/control:
+    - update Standards-Version to 3.8.3
+    - update Conflicts/Replaces for libzip-ocaml
+    - update my e-mail address and remove DMUA
+
+ -- Stéphane Glondu <glondu@debian.org>  Tue, 08 Sep 2009 23:01:37 +0200
+
+camlzip (1.04-4) unstable; urgency=low
+
+  * Install zip.a along with zip.cmxa (Closes: #524017)
+
+ -- Stephane Glondu <steph@glondu.net>  Tue, 14 Apr 2009 10:59:42 +0200
+
+camlzip (1.04-3) unstable; urgency=low
+
+  * Add myself to Uploaders and DMUA
+  * Move to new archive section ocaml
+  * Discriminate binary packages in short descriptions
+  * Move .cma and META to libzip-ocaml, build .cmxs
+  * Add Homepage field to debian/control
+  * Bump Standards-Version to 3.8.1
+
+ -- Stephane Glondu <steph@glondu.net>  Sun, 12 Apr 2009 00:09:00 +0200
+
+camlzip (1.04-2) unstable; urgency=low
+
+  [ Stephane Glondu ]
+  * Switch packaging to git
+
+  [ Samuel Mimram ]
+  * Use dh-ocaml's predefined variables.
+
+ -- Samuel Mimram <smimram@debian.org>  Tue, 24 Feb 2009 17:48:49 +0100
+
+camlzip (1.04-1) experimental; urgency=low
+
+  [ Stefano Zacchiroli ]
+  * debian/copyright: mention the usual OCaml linking exception to LGPL
+
+  [ Samuel Mimram ]
+  * New upstream release.
+  * Build-depend on dh-ocaml.
+  * Updated compat to 7.
+  * Refreshed uncompress.dpatch.
+  * Updated standards version to 3.8.0.
+  * Version LGPL reference.
+
+ -- Samuel Mimram <smimram@debian.org>  Tue, 10 Feb 2009 12:35:24 +0100
+
+camlzip (1.03-7) experimental; urgency=low
+
+  [ Stefano Zacchiroli ]
+  * fix vcs-svn field to point just above the debian/ dir
+
+  [ Ralf Treinen ]
+  * Recompile with ocaml 3.10.2
+  * Capitalization error in short package description
+  * Standards-Version 3.7.3 (no change)
+  * Added myself to Uploaders.
+
+ -- Ralf Treinen <treinen@debian.org>  Mon, 07 Apr 2008 20:31:08 +0200
+
+camlzip (1.03-6) unstable; urgency=low
+
+  * Change distribution to unstable
+  * Use ocaml >= 3.10.8 to have the .doc-base.ocamldoc-apiref template
+
+ -- Sylvain Le Gall <gildor@debian.org>  Wed, 05 Sep 2007 13:40:47 +0200
+
+camlzip (1.03-5) experimental; urgency=low
+
+  * Ocamldoc documentation generation (Closes: #334284)
+  * Upgrade build-dependency to ocaml 3.10.0
+
+ -- Sylvain Le Gall <gildor@debian.org>  Tue, 04 Sep 2007 00:34:16 +0200
+
+camlzip (1.03-4) experimental; urgency=low
+
+  * Rebuild for ocaml 3.10.0
+  * Ignore error in clean target
+  * Use binary:Version for versioned dependency
+  * Upgrade to debhelper 5
+
+ -- Sylvain Le Gall <gildor@debian.org>  Sat, 14 Jul 2007 02:15:06 +0200
+
+camlzip (1.03-3) unstable; urgency=low
+
+  * Remove produced .so files at clean time, closes: #424150.
+
+ -- Samuel Mimram <smimram@debian.org>  Tue, 15 May 2007 21:58:20 +0200
+
+camlzip (1.03-2) unstable; urgency=low
+
+  * Upload to unstable.
+
+ -- Samuel Mimram <smimram@debian.org>  Wed, 11 Apr 2007 16:52:20 +0200
+
+camlzip (1.03-1) experimental; urgency=low
+
+  * New upstream release.
+  * Improved packaging.
+  * Updated uncompress.dpatch.
+  * We don't need to remove rpaths anymore.
+  * Added myself to uploaders.
+
+ -- Samuel Mimram <smimram@debian.org>  Tue,  6 Mar 2007 23:40:20 +0100
+
+camlzip (1.01-17) unstable; urgency=low
+
+  [ Julien Cristau ]
+  * Add build-dep on chrpath and delete rpath from the stublib (fixes lintian
+    warning).
+
+  [ Stefano Zacchiroli ]
+  * Rebuilt against ocaml 3.09.2, bumped deps accordingly.
+  * debian/control
+    - bumped Standards-Version (no changes needed)
+  * debian/*
+    - use the more common 'ocamlinit' target in debian/rules to update the
+      hard-coded version of the ocaml ABI. Avoids unintented re-generation of
+      debian/control during the build
+
+ -- Stefano Zacchiroli <zack@debian.org>  Fri, 19 May 2006 21:06:10 -0500
+
+camlzip (1.01-16) unstable; urgency=low
+
+  [ Sven Luther ]
+
+  * Rebuilt against ocaml 3.09.0.
+
+  [ Stefano Zacchiroli ]
+
+  * Made svn structure svn-buildpackage friendly
+  * debian/control
+    - bumped standards version
+  * debian/changelog
+    - removed dh_make boilerplate
+  * Added myself as an Uploader
+
+ -- Debian OCaml Maintainers <debian-ocaml-maint@lists.debian.org>  Sat, 26 Nov 2005 22:25:12 +0100
+
+camlzip (1.01-15) unstable; urgency=medium
+
+  * Rebuild against ocaml 3.08.3.
+
+ -- Sven Luther <luther@debian.org>  Tue, 22 Mar 2005 08:40:56 +0100
+
+camlzip (1.01-14) unstable; urgency=high
+
+  * Rebuilt for ocaml 3.08.2 unix breakage :/ (Closes: #293904)
+
+ -- Sven Luther <luther@debian.org>  Mon, 14 Feb 2005 09:00:40 +0100
+
+camlzip (1.01-13) unstable; urgency=low
+
+  * Rebuilt for ocaml 3.08.
+
+ -- Sven Luther <luther@debian.org>  Thu, 15 Jul 2004 14:01:27 +0200
+
+camlzip (1.01-12) unstable; urgency=low
+
+  * Forgot dpathc build-dependency. (Closes: #229385)
+
+ -- Sven Luther <luther@debian.org>  Fri, 30 Jan 2004 13:47:33 +0100
+
+camlzip (1.01-11) unstable; urgency=low
+
+  * Fixed META installation using ocamlc -where instead of ocamlc -version.
+    (Closes: #229307)
+  * Dpatchification.
+
+ -- Sven Luther <luther@debian.org>  Sat, 24 Jan 2004 10:32:32 +0100
+
+camlzip (1.01-10) unstable; urgency=low
+
+  * Rebuilt for ocaml 3.07.
+
+ -- Sven Luther <luther@debian.org>  Wed,  1 Oct 2003 17:31:51 +0200
+
+camlzip (1.01-9) unstable; urgency=low
+
+  * Changed control file, since the buildd don't seem to like virtual packages
+    in build dependencies. Thanks to James for noticing this.
+
+ -- Sven Luther <luther@debian.org>  Mon, 06 Jan 2003 11:49:22 +0100
+
+camlzip (1.01-8) unstable; urgency=low
+
+  * Added META file for findlib, thanks to Stefano Zacchiroli for providing
+    it. (Closes: #173568)
+
+ -- Sven Luther <luther@debian.org>  Wed, 18 Dec 2002 17:09:55 +0100
+
+camlzip (1.01-7) unstable; urgency=low
+
+  * Rebuilt for ocaml 3.06-13 and the libdir migration.
+  * Added a plain_uncompress binding.
+
+ -- Sven Luther <luther@debian.org>  Sat, 14 Dec 2002 22:48:42 +0100
+
+camlzip (1.01-6) unstable; urgency=low
+
+  * Rebuilt for ocaml 3.06.
+
+ -- Sven Luther <luther@debian.org>  Thu, 22 Aug 2002 11:10:42 +0200
+
+camlzip (1.01-5) unstable; urgency=low
+
+  * Rebuilt with zlib1g-dev 1.1.4-1, to fix the double-free security bug.
+
+ -- Sven Luther <luther@debian.org>  Mon, 18 Mar 2002 16:42:51 +0100
+
+camlzip (1.01-4) unstable; urgency=low
+
+  * Added a provide camlzip to libzip-ocaml-dev.
+
+ -- Sven Luther <luther@debian.org>  Sat, 23 Feb 2002 08:49:49 +0100
+
+camlzip (1.01-3) unstable; urgency=low
+
+  * Added a versioned conflict to libzip-ocaml.
+
+ -- Sven Luther <luther@debian.org>  Sat, 23 Feb 2002 08:49:49 +0100
+
+camlzip (1.01-2) unstable; urgency=low
+
+  * Added dh_shlibdep library dependencies.
+
+ -- Sven Luther <luther@debian.org>  Fri, 22 Feb 2002 18:13:57 +0100
+
+camlzip (1.01-1) unstable; urgency=low
+
+  * New upstream release, adapted to ocaml 3.04.
+  * Package was split in libzip-ocaml and libzip-ocaml-dev.
+
+ -- Sven Luther <luther@debian.org>  Thu, 21 Feb 2002 11:34:56 +0100
+
+camlzip (1.00-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Sven Luther <luther@debian.org>  Thu, 30 Aug 2001 10:45:01 +0200
--- camlzip-1.04.orig/debian/copyright
+++ camlzip-1.04/debian/copyright
@@ -0,0 +1,24 @@
+This package was debianized by Sven Luther <luther@debian.org> on
+Thu, 30 Aug 2001 10:45:01 +0200.
+
+It was downloaded from http://caml.inria.fr/distrib/bazar-ocaml/
+
+Upstream Author: Xavier Leroy <Xavier.Leroy@inria.fr>
+
+Copyright (c) 2001-2007 Xavier Leroy.
+
+Camlzip is distributed under the terms the LGPL 2.1 (or above) licence,
+which can be found in the /usr/share/common-licenses/LGPL-2.1 file on Debian
+systems.
+
+As a special exception to the GNU Library General Public License, you may link,
+statically or dynamically, a "work that uses the Library" with a publicly
+distributed version of the Library to produce an executable file containing
+portions of the Library, and distribute that executable file under terms of
+your choice, without any of the additional requirements listed in clause 6 of
+the GNU Library General Public License.  By "a publicly distributed version of
+the Library", we mean either the unmodified Library as distributed by INRIA, or
+a modified version of the Library that is distributed under the conditions
+defined in clause 3 of the GNU Library General Public License.  This exception
+does not however invalidate any other reasons why the executable file might be
+covered by the GNU Library General Public License.
--- camlzip-1.04.orig/debian/watch
+++ camlzip-1.04/debian/watch
@@ -0,0 +1,2 @@
+version=2
+http://caml.inria.fr/distrib/bazar-ocaml/camlzip-([0-9\.]*)\.tar\.gz 
--- camlzip-1.04.orig/debian/control
+++ camlzip-1.04/debian/control
@@ -0,0 +1,55 @@
+Source: camlzip
+Section: ocaml
+Priority: optional
+Maintainer: Debian OCaml Maintainers <debian-ocaml-maint@lists.debian.org>
+Uploaders:
+ Sven Luther <luther@debian.org>,
+ Stefano Zacchiroli <zack@debian.org>,
+ Samuel Mimram <smimram@debian.org>,
+ Sylvain Le Gall <gildor@debian.org>,
+ Ralf Treinen <treinen@debian.org>,
+ Stéphane Glondu <glondu@debian.org>
+Build-Depends:
+ debhelper (>= 7.0.50~),
+ quilt (>= 0.46-7~),
+ zlib1g-dev (>> 1.1.4),
+ ocaml-nox (>= 3.11.1-3~),
+ dpkg-dev (>= 1.13.19),
+ dh-ocaml (>= 0.9)
+Homepage: http://pauillac.inria.fr/~xleroy/software.html#camlzip
+Standards-Version: 3.8.3
+Vcs-Git: git://git.debian.org/git/pkg-ocaml-maint/packages/camlzip.git
+Vcs-Browser: http://git.debian.org/?p=pkg-ocaml-maint/packages/camlzip.git
+
+Package: libzip-ocaml
+Architecture: any
+Depends:
+ ${ocaml:Depends},
+ ${shlibs:Depends},
+ ${misc:Depends}
+Provides: ${ocaml:Provides}
+Conflicts: libzip-ocaml-dev (<< 1.04-4)
+Replaces: libzip-ocaml-dev (<< 1.04-4)
+Description: OCaml compression libraries (runtime libraries)
+ This Objective Caml library provides easy access to compressed files in ZIP
+ and GZIP format, as well as to Java JAR files.  It provides functions
+ for reading from and writing to compressed files in these formats.
+ .
+ This package contains only the shared runtime stub libraries.
+
+Package: libzip-ocaml-dev
+Architecture: any
+Depends:
+ zlib1g-dev (>> 1.1.4),
+ ${ocaml:Depends},
+ ${shlibs:Depends},
+ ${misc:Depends}
+Conflicts: camlzip
+Replaces: camlzip
+Provides: camlzip, ${ocaml:Provides}
+Description: OCaml compression libraries (development files)
+ This Objective Caml library provides easy access to compressed files in ZIP
+ and GZIP format, as well as to Java JAR files.  It provides functions
+ for reading from and writing to compressed files in these formats.
+ .
+ This package contains the developpment part of the camlzip package.
--- camlzip-1.04.orig/debian/libzip-ocaml-dev.docs
+++ camlzip-1.04/debian/libzip-ocaml-dev.docs
@@ -0,0 +1 @@
+README
--- camlzip-1.04.orig/debian/gbp.conf
+++ camlzip-1.04/debian/gbp.conf
@@ -0,0 +1,2 @@
+[DEFAULT]
+pristine-tar = True
--- camlzip-1.04.orig/debian/Makefile.test.Debian
+++ camlzip-1.04/debian/Makefile.test.Debian
@@ -0,0 +1,14 @@
+all: minizip minigzip
+
+minigzip: minigzip.ml
+	ocamlc -ccopt -g -g -I +zip  -o minigzip zip.cma minigzip.ml
+
+minizip: minizip.ml
+	ocamlc -ccopt -g -g -I +zip -o minizip unix.cma zip.cma minizip.ml
+
+testzlib: ../zip.cma testzlib.ml
+	ocamlc -g -I +zip -o testzlib zip.cma testzlib.ml
+
+clean:
+	rm -f *.cm*
+	rm -f minigzip minizip testzlib
--- camlzip-1.04.orig/debian/rules
+++ camlzip-1.04/debian/rules
@@ -0,0 +1,28 @@
+#!/usr/bin/make -f
+
+include /usr/share/ocaml/ocamlvars.mk
+
+INSTALLDIR := $(CURDIR)/debian/tmp/$(OCAML_STDLIB_DIR)/zip
+VERSION := $(shell head -n1 debian/changelog | awk -F'[ ()-]+' '{print $$2}')
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+	dh --with ocaml --with quilt $@
+
+.PHONY: override_dh_auto_build
+override_dh_auto_build:
+	$(MAKE)
+ifneq ($(OCAML_OPT_ARCH),)
+	$(MAKE) allopt
+	ocamlopt -I . -shared -linkall -o zip.cmxs zip.cmxa
+endif
+
+.PHONY: override_dh_auto_install
+override_dh_auto_install:
+	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
+ifneq ($(OCAML_OPT_ARCH),)
+	$(MAKE) installopt DESTDIR=$(CURDIR)/debian/tmp
+endif
+	sed 's/@VERSION@/$(VERSION)/' debian/META.in > $(INSTALLDIR)/META
--- camlzip-1.04.orig/debian/libzip-ocaml.install.in
+++ camlzip-1.04/debian/libzip-ocaml.install.in
@@ -0,0 +1,4 @@
+@OCamlStdlibDir@/zip/META
+@OCamlStdlibDir@/zip/zip.cma
+@OCamlDllDir@/dllcamlzip.so
+OPT: zip.cmxs @OCamlStdlibDir@/zip
--- camlzip-1.04.orig/debian/libzip-ocaml-dev.install.in
+++ camlzip-1.04/debian/libzip-ocaml-dev.install.in
@@ -0,0 +1,6 @@
+@OCamlStdlibDir@/zip/lib*.a
+@OCamlStdlibDir@/zip/*.cmi
+@OCamlStdlibDir@/zip/*.ml*
+OPT: @OCamlStdlibDir@/zip/*.cmx
+OPT: @OCamlStdlibDir@/zip/zip.cmxa
+OPT: @OCamlStdlibDir@/zip/zip.a
--- camlzip-1.04.orig/debian/compat
+++ camlzip-1.04/debian/compat
@@ -0,0 +1 @@
+7
--- camlzip-1.04.orig/debian/libzip-ocaml.docs
+++ camlzip-1.04/debian/libzip-ocaml.docs
@@ -0,0 +1 @@
+README
--- camlzip-1.04.orig/debian/clean
+++ camlzip-1.04/debian/clean
@@ -0,0 +1 @@
+debian/libzip-ocaml-dev.doc-base.ocamldoc-apiref
--- camlzip-1.04.orig/debian/patches/0002-Use-an-installed-camlzip-for-tests.patch
+++ camlzip-1.04/debian/patches/0002-Use-an-installed-camlzip-for-tests.patch
@@ -0,0 +1,34 @@
+From: Samuel Mimram <smimram@debian.org>
+Date: Tue, 29 Sep 2009 09:42:17 +0200
+Subject: [PATCH] Use an installed camlzip for tests
+
+Signed-off-by: Samuel Mimram <smimram@debian.org>
+Signed-off-by: Stephane Glondu <steph@glondu.net>
+---
+ test/Makefile |   10 +++++-----
+ 1 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/test/Makefile b/test/Makefile
+index d10106b..77b4da3 100644
+--- a/test/Makefile
++++ b/test/Makefile
+@@ -1,13 +1,13 @@
+ all: minizip minigzip
+ 
+-minigzip: ../zip.cma minigzip.ml
+-	ocamlc -ccopt -g -g -I .. -o minigzip ../zip.cma minigzip.ml
++minigzip: minigzip.ml
++	ocamlc -ccopt -g -g -I +zip  -o minigzip zip.cma minigzip.ml
+ 
+-minizip: ../zip.cma minizip.ml
+-	ocamlc -ccopt -g -g -I .. -o minizip unix.cma ../zip.cma minizip.ml
++minizip: minizip.ml
++	ocamlc -ccopt -g -g -I +zip -o minizip unix.cma zip.cma minizip.ml
+ 
+ testzlib: ../zip.cma testzlib.ml
+-	ocamlc -g -I .. -o testzlib ../zip.cma testzlib.ml
++	ocamlc -g -I +zip -o testzlib zip.cma testzlib.ml
+ 
+ clean:
+ 	rm -f *.cm*
+-- 
--- camlzip-1.04.orig/debian/patches/series
+++ camlzip-1.04/debian/patches/series
@@ -0,0 +1,3 @@
+0001-Build-system-for-Debian.patch
+0002-Use-an-installed-camlzip-for-tests.patch
+0003-Add-plain_uncompress.patch
--- camlzip-1.04.orig/debian/patches/0003-Add-plain_uncompress.patch
+++ camlzip-1.04/debian/patches/0003-Add-plain_uncompress.patch
@@ -0,0 +1,59 @@
+From: Sven Luther <luther@debian.org>
+Date: Tue, 29 Sep 2009 09:43:51 +0200
+Subject: [PATCH] Add plain_uncompress
+
+Add a plain_uncompress function which is a direct binding to zlib's
+uncompress function.
+
+Signed-off-by: Sven Luther <luther@debian.org>
+---
+ zlib.ml     |    2 ++
+ zlib.mli    |    2 ++
+ zlibstubs.c |   10 ++++++++++
+ 3 files changed, 14 insertions(+), 0 deletions(-)
+
+diff --git a/zlib.ml b/zlib.ml
+index 6722a7c..a0e75cc 100644
+--- a/zlib.ml
++++ b/zlib.ml
+@@ -87,6 +87,8 @@ let compress_direct  ?(level = 6) ?(header = true) flush =
+   in
+   compr, compr_finish
+ 
++external plain_uncompress: string -> int -> string -> int -> bool = "camlzip_uncompress"
++
+ let uncompress ?(header = true) refill flush =
+   let inbuf = String.create buffer_size
+   and outbuf = String.create buffer_size in
+diff --git a/zlib.mli b/zlib.mli
+index 0ee18da..44faa2e 100644
+--- a/zlib.mli
++++ b/zlib.mli
+@@ -26,6 +26,8 @@ val compress_direct:
+ val uncompress:
+   ?header: bool -> (string -> int) -> (string -> int -> unit) -> unit
+ 
++val plain_uncompress: string -> int -> string -> int -> bool
++
+ type stream
+ 
+ type flush_command =
+diff --git a/zlibstubs.c b/zlibstubs.c
+index 7d91237..8e6b2f6 100644
+--- a/zlibstubs.c
++++ b/zlibstubs.c
+@@ -173,3 +173,13 @@ value camlzip_update_crc32(value crc, value buf, value pos, value len)
+                           Long_val(len)));
+ }
+ 
++
++value camlzip_uncompress(value dest, value destlen, value src, value srclen)
++{
++  unsigned long destlenc = Int_val(destlen);
++  unsigned long srclenc = Int_val(srclen);
++  int status;
++  status = uncompress (String_val(dest), &destlenc, String_val(src), srclenc);
++  if (status == Z_OK) return Val_true;
++  else return Val_false;
++}
+-- 
--- camlzip-1.04.orig/debian/patches/0001-Build-system-for-Debian.patch
+++ camlzip-1.04/debian/patches/0001-Build-system-for-Debian.patch
@@ -0,0 +1,59 @@
+From: Sven Luther <luther@debian.org>
+Date: Tue, 29 Sep 2009 09:41:07 +0200
+Subject: [PATCH] Build system for Debian
+
+Makefiles, configure scripts and other build stuff adapted for Debian
+package creation
+
+Signed-off-by: Sven Luther <luther@debian.org>
+---
+ Makefile |   25 ++++++++++++++++---------
+ 1 files changed, 16 insertions(+), 9 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index f3ce064..321fb34 100644
+--- a/Makefile
++++ b/Makefile
+@@ -11,7 +11,10 @@ ZLIB_INCLUDE=/usr/local/include
+ 
+ # Where to install the library.  By default: sub-directory 'zip' of
+ # OCaml's standard library directory.
+-INSTALLDIR=`$(OCAMLC) -where`/zip
++#INSTALLDIR=`$(OCAMLC) -where`/zip
++OCAMLLIBDIR=$(DESTDIR)`$(OCAMLC) -where`
++INSTALLDIR=$(OCAMLLIBDIR)/zip
++STUBLIBSDIR=$(OCAMLLIBDIR)/stublibs
+ 
+ ### End of configuration section
+ 
+@@ -53,17 +56,21 @@ libcamlzip.a: $(C_OBJS)
+ clean:
+ 	rm -f *.cm*
+ 	rm -f *.o *.a
++	rm -f dllcamlzip.so
+ 
+ install:
+ 	mkdir -p $(INSTALLDIR)
+-	cp zip.cma zip.cmi gzip.cmi zip.mli gzip.mli libcamlzip.a $(INSTALLDIR)
+-	if test -f dllcamlzip.so; then \
+-	  cp dllcamlzip.so $(INSTALLDIR); \
+-          ldconf=`$(OCAMLC) -where`/ld.conf; \
+-          installdir=$(INSTALLDIR); \
+-          if test `grep -s -c $$installdir'$$' $$ldconf || :` = 0; \
+-          then echo $$installdir >> $$ldconf; fi \
+-        fi
++	mkdir -p $(STUBLIBSDIR)
++	cp zip.cma zip.cmi gzip.cmi zip.mli gzip.mli zlib.mli zlib.cmi libcamlzip.a $(INSTALLDIR)
++	cp dllcamlzip.so $(STUBLIBSDIR)
++# Let us handle this the debian way
++#	if test -f dllcamlzip.so; then \
++#	  cp dllcamlzip.so $(INSTALLDIR); \
++#          ldconf=`$(OCAMLC) -where`/ld.conf; \
++#          installdir=$(INSTALLDIR); \
++#          if test `grep -s -c $$installdir'$$' $$ldconf || :` = 0; \
++#          then echo $$installdir >> $$ldconf; fi \
++#        fi
+ 
+ installopt:
+ 	cp zip.cmxa zip.a zip.cmx gzip.cmx $(INSTALLDIR)
+-- 
