diff --git a/config/Makefile-am-eg b/config/Makefile-am-eg
new file mode 100644
index 0000000000000000000000000000000000000000..515e370c3c0790720ca5ff7da925273ec41828fb
--- /dev/null
+++ b/config/Makefile-am-eg
@@ -0,0 +1,21 @@
+### Makefile.am for the qhull package (eg)
+### Author: Rafael Laboissiere <rafael@debian.org>
+### Created: Mon Dec  3 21:36:21 CET 2001
+
+### Documentation files
+
+# to:
+docdir = $(prefix)/share/doc/$(PACKAGE)
+examplesdir = $(docdir)/examples
+
+# which:
+examples_DATA = \
+  q_eg          \
+  q_egtest      \
+  q_test        \
+  Qhull-go.bat  \
+  q_test.bat
+
+### Extra files to be included in the tarball
+
+EXTRA_DIST = $(examples_DATA)
diff --git a/config/Makefile-am-html b/config/Makefile-am-html
new file mode 100644
index 0000000000000000000000000000000000000000..0da6a3fe828259880457d849cafa7204bc41ca32
--- /dev/null
+++ b/config/Makefile-am-html
@@ -0,0 +1,56 @@
+### Makefile.am for the qhull package (html)
+### Author: Rafael Laboissiere <rafael@debian.org>
+### Created: Mon Dec  3 21:36:21 CET 2001
+
+### Man pages (trick to get around .man extension)
+
+%.1: %.man
+	cp $< $@
+CLEANFILES = *.1
+man_MANS = rbox.1 qhull.1
+
+### Documentation files
+
+# to:
+docdir = $(prefix)/share/doc/$(PACKAGE)
+htmldir = $(docdir)/html
+
+# which:
+html_DATA =    \
+  index.htm    \
+  qconvex.htm  \
+  qdelau_f.htm \
+  qdelaun.htm  \
+  qh--4d.gif   \
+  qh--cone.gif \
+  qh--dt.gif   \
+  qh--geom.gif \
+  qh--half.gif \
+  qh--rand.gif \
+  qh-eg.htm    \
+  qh-faq.htm   \
+  qh-get.htm   \
+  qh-impre.htm \
+  qh-in.htm    \
+  qh-optc.htm  \
+  qh-optf.htm  \
+  qh-optg.htm  \
+  qh-opto.htm  \
+  qh-optp.htm  \
+  qh-optq.htm  \
+  qh-optt.htm  \
+  qh-quick.htm \
+  qhalf.htm    \
+  qhull.htm    \
+  qvoron_f.htm \
+  qvoronoi.htm \
+  rbox.htm
+
+### Extra files to be included in the tarball
+
+EXTRA_DIST =   \
+  $(html_DATA) \
+  qhull.man    \
+  qhull.txt    \
+  rbox.man     \
+  rbox.txt
diff --git a/config/Makefile-am-main b/config/Makefile-am-main
new file mode 100644
index 0000000000000000000000000000000000000000..a33d7f056b8725dae7c1d1a24ab7bb0d9e92ae4c
--- /dev/null
+++ b/config/Makefile-am-main
@@ -0,0 +1,27 @@
+### Makefile.am for the qhull package (main)
+### Author: Rafael Laboissiere <rafael@debian.org>
+### Created: Mon Dec  3 21:36:21 CET 2001
+
+### Documentation files
+
+# to:
+docdir = $(prefix)/share/doc/$(PACKAGE)
+
+# which:
+doc_DATA =     \
+  index.htm    \
+  Announce.txt \
+  COPYING.txt  \
+  README.txt   \
+  REGISTER.txt
+
+### Extra files to be included in the tarball
+
+EXTRA_DIST =   \
+  $(doc_DATA)  \
+  File_id.diz  \
+  QHULL-GO.pif
+
+### Subdirectories for Automaking
+
+SUBDIRS = src html eg config
diff --git a/config/Makefile-am-src b/config/Makefile-am-src
new file mode 100644
index 0000000000000000000000000000000000000000..47d8dcde765bb771d56148b137660b44e8ae5ced
--- /dev/null
+++ b/config/Makefile-am-src
@@ -0,0 +1,97 @@
+### Makefile.am for the qhull package (src)
+### Author: Rafael Laboissiere <rafael@debian.org>
+### Created: Mon Dec  3 21:36:21 CET 2001
+
+### Shared Library
+
+# to:
+lib_LTLIBRARIES = libqhull.la
+
+# from:
+libqhull_la_SOURCES = \
+  user.c              \
+  global.c            \
+  stat.c              \
+  io.c                \
+  geom2.c             \
+  poly2.c             \
+  merge.c             \
+  qhull.c             \
+  geom.c              \
+  poly.c              \
+  qset.c              \
+  mem.c
+
+# how:
+libqhull_la_LDFLAGS = -version-info 5:0:0 -lm
+
+### Utility programs
+
+# to:
+bin_PROGRAMS = qhull rbox qconvex qdelaunay qvoronoi qhalf
+
+# from:
+qhull_SOURCES = unix.c
+rbox_SOURCES = rbox.c
+qconvex_SOURCES = qconvex.c
+qdelaunay_SOURCES = qdelaun.c
+qvoronoi_SOURCES = qvoronoi.c
+qhalf_SOURCES = qhalf.c
+
+# how:
+qhull_LDADD = libqhull.la
+rbox_LDADD = libqhull.la
+qconvex_LDADD = libqhull.la
+qdelaunay_LDADD = libqhull.la
+qvoronoi_LDADD = libqhull.la
+qhalf_LDADD = libqhull.la
+
+### Include files
+
+pkginclude_HEADERS = \
+  geom.h             \
+  mem.h              \
+  poly.h             \
+  qhull_a.h          \
+  stat.h             \
+  io.h               \
+  merge.h            \
+  qhull.h            \
+  qset.h             \
+  user.h
+
+
+### Example programs
+
+# to:
+docdir = $(prefix)/share/doc/$(PACKAGE)
+examplesdir = $(docdir)/examples
+
+# which:
+examples_DATA =       \
+  user_eg.c           \
+  user_eg2.c          \
+  qhull_interface.cpp \
+  Makefile.txt        \
+  Mborland
+
+doc_DATA =     \
+  Changes.txt  \
+  index.htm    \
+  qh-geom.htm  \
+  qh-globa.htm \
+  qh-io.htm    \
+  qh-mem.htm   \
+  qh-merge.htm \
+  qh-poly.htm  \
+  qh-qhull.htm \
+  qh-set.htm   \
+  qh-stat.htm  \
+  qh-user.htm
+
+
+### Extra files to be included in the tarball
+
+EXTRA_DIST =       \
+  $(doc_DATA)      \
+  $(examples_DATA)
diff --git a/config/Makefile.am b/config/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..f4792ca9be5714e0fb8ff312deb0d01f97d183d5
--- /dev/null
+++ b/config/Makefile.am
@@ -0,0 +1,14 @@
+### Makefile.am for the qhull package (config)
+### Author: Rafael Laboissiere <rafael@debian.org>
+### Created: Mon Dec  3 21:36:21 CET 2001
+
+### Extra files to be included in the tarball
+
+EXTRA_DIST =       \
+  README           \
+  bootstrap.sh     \
+  Makefile-am-main \
+  Makefile-am-eg   \
+  Makefile-am-html \
+  Makefile-am-src
+
diff --git a/config/README b/config/README
new file mode 100644
index 0000000000000000000000000000000000000000..18e698e08b00679133e91f0fc1dfe4766f3d9c61
--- /dev/null
+++ b/config/README
@@ -0,0 +1,19 @@
+Autotools configuration for Qhull
+---------------------------------
+
+This directory contains all the files needed to bootstrap the Qhull package
+for using Autoconf, Automake, and Libtool.
+
+Go to the top source dir and type:
+
+    config/bootstrap.sh
+    
+And then the usual:
+
+    ./configure --prefix=/your/preferred/path/here
+    make
+    make install
+
+
+ -- Rafael Laboissiere <rafael@debian.org>, Sun Feb  1 13:43:54 CET 2004
+
diff --git a/config/bootstrap.sh b/config/bootstrap.sh
new file mode 100644
index 0000000000000000000000000000000000000000..8273529a678e075d6772d7fc6a8a7ed984f1cd0d
--- /dev/null
+++ b/config/bootstrap.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+run () {
+  echo -n Running `$1 --version | sed q`...
+  $* > /dev/null
+  echo " done"
+}
+
+
+if test ! -f config/configure.ac ; then
+  echo "$0: This script must be run from the Qhull top directory."
+  exit 1
+fi
+
+echo -n Copying autoconf and automake files...
+cp config/configure.ac .
+cp config/Makefile-am-main Makefile.am
+for d in src html eg ; do
+  cp config/Makefile-am-$d $d/Makefile.am
+done
+echo " done"
+
+run aclocal \
+  && run libtoolize --force --copy \
+  && run automake --foreign --add-missing --force-missing --copy \
+  && run autoconf
diff --git a/config/configure.ac b/config/configure.ac
new file mode 100644
index 0000000000000000000000000000000000000000..96726884586bcd9991eb7d54a53c5e897439cc48
--- /dev/null
+++ b/config/configure.ac
@@ -0,0 +1,24 @@
+dnl configure.ac for the qhull package
+dnl Author: Rafael Laboissiere <rafael@debian.org>
+dnl Created: Mon Dec  3 21:36:21 CET 2001
+
+AC_INIT(qhull, 2009.1)
+AC_CONFIG_SRCDIR(src/qhull.c)
+
+AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_MACRO_DIR(config)
+
+AM_INIT_AUTOMAKE
+
+AC_PROG_CC
+AC_PROG_LIBTOOL
+
+AC_CONFIG_FILES([
+  Makefile 
+  src/Makefile 
+  html/Makefile 
+  eg/Makefile
+  config/Makefile
+])
+
+AC_OUTPUT
diff --git a/project/debian/README.Debian b/project/debian/README.Debian
new file mode 100644
index 0000000000000000000000000000000000000000..8ba1170d40ec26218c00b07995334eac4c800236
--- /dev/null
+++ b/project/debian/README.Debian
@@ -0,0 +1,30 @@
+qhull for Debian
+================
+
+Usage
+-----
+
+The library's functionality can be accessed from the command line
+using the executable "qhull".  Random distributions of points can be
+drawn for testing and experimentation using "rbox".
+
+
+Registering
+-----------
+
+The upstream authors would like to find out how you are using their
+software.  Look at /usr/share/doc/qhull/REGISTER.txt to know how to send
+them feedback.
+
+
+Documentation
+-------------
+
+Documentation in HTML format is available starting in the file
+/usr/share/doc/qhull/qh-man.htm.  There are also some exemples in the
+directory /usr/share/doc/qhull/examples.
+
+
+
+ -- Rafael Laboissiere <rafael@debian.org>, Mon Dec  3 20:20:07 CET 2001
+
diff --git a/project/debian/TODO b/project/debian/TODO
new file mode 100644
index 0000000000000000000000000000000000000000..912892fc5ad7da128c1ef661b6c7ae077a91338b
--- /dev/null
+++ b/project/debian/TODO
@@ -0,0 +1,14 @@
+[This file was originally written by Barak Pearlmutter <bap@cs.unm.edu>]
+
+The random number generator in src/geom2.c makes me suspicious.
+Maybe it would be better to switch to random(3).
+
+The include files used in user code have lots of stuff in them that
+really only the library needs.  These could be split out.
+
+Hook into that debian library-switches gizmo.
+
+Separate versions of all functions for various floating point
+precisions.  Perhaps via multiple #include's.
+
+Convert executables to getopt and --help, and stop using isatty.
diff --git a/project/debian/changelog b/project/debian/changelog
new file mode 100644
index 0000000000000000000000000000000000000000..d2b75d13b918096af705bb6b8b3237c04ac05745
--- /dev/null
+++ b/project/debian/changelog
@@ -0,0 +1,92 @@
+qhull (2003.1-1) unstable; urgency=low
+
+  * New upstream release.  There are backward incompatibilities in the code
+    and the soversion was bumped to libqhull5.
+  * debian/rules:
+    - Major rewrite of build and install rules, since we are using now the
+      upstream tarball generated with "make dist".
+    - Added config rule.
+    - Use dpatch to patch src/user.h (enable qh_QHpointer).
+  * debian/control:
+    - Removed build-dependencies on autoconf, automake, and libtool.
+    - Build-depends on dpatch.
+    - Changed section of libqhull-dev package to libdevel.
+  * debian/libqhull-dev.files: Added usr/share/doc/libqhull5/src
+    directory.
+
+ -- Rafael Laboissiere <rafael@debian.org>  Sun,  1 Feb 2004 01:14:13 +0100
+
+qhull (2002.1-4) unstable; urgency=low
+
+  * src/Make-config.sh: Patched upstream file for proper initialization of
+    the Autotools.
+  * debian/install-src-html.sh: Added script for including src/*.htm
+    source documentation files into html doc dir.
+  * debian/control:
+    - Bumped Standards-Version to 3.6.1 (no changes needed).
+    - Changed build-dependencies to autoconf and automake1.7 (instead of
+      autoconf2.13 and automake1.6).  Added eperl.
+  * debian/libqhull-dev.files: Added dir usr/share/doc/libqhull4/src.
+  * debian/manpage.in: Added template for missing man pages.
+  * debian/rules:
+    - Call debian/install-src-html.sh.
+    - Generate manpages for qconvex, qdelaunay, qhalf, and qvoronoi
+      commands. Lintian is happy now.
+
+ -- Rafael Laboissiere <rafael@debian.org>  Thu, 18 Dec 2003 21:20:14 +0100
+
+qhull (2002.1-3) unstable; urgency=low
+
+  * New maintainer (as per http://lists.debian.org/debian-devel/1999
+    /debian-devel-199911/msg01061.html).
+  * debian/rules: Use the upstream script Make-config.sh, which sets up
+    the autoconf/automake/libtool files.  Also, clean up all the generated
+    files in the clean rule.
+  * debian/control: Bumped Standards-Version to 3.5.7.  Added
+    Build-Dependencies to autoconf/automake/libtool.
+
+ -- Rafael Laboissiere <rafael@debian.org>  Wed, 25 Sep 2002 10:39:30 +0200
+
+qhull (2002.1-2) unstable; urgency=low
+
+  * use shared char* qh_version in library
+
+ -- Barak Pearlmutter <bap@cs.unm.edu>  Sat,  7 Sep 2002 10:34:13 -0600
+
+qhull (2002.1-1) unstable; urgency=low
+
+  * new upstream source
+
+ -- Barak Pearlmutter <bap@cs.unm.edu>  Thu,  5 Sep 2002 20:51:10 -0600
+
+qhull (3.1-5) unstable; urgency=low
+
+  * rephrase descriptions (closes: #141027)
+
+ -- Barak Pearlmutter <bap@cs.unm.edu>  Thu, 11 Apr 2002 22:12:33 -0600
+
+qhull (3.1-4) unstable; urgency=low
+
+  * include executables qconvex, qhalf, qvoronoi, qdelaunay
+  * break executables out into separate package qhull-bin
+
+ -- Barak Pearlmutter <bap@cs.unm.edu>  Wed, 27 Mar 2002 20:26:44 -0700
+
+qhull (3.1-3) unstable; urgency=low
+
+  * rename executable qhull-rbox back to rbox
+
+ -- Barak Pearlmutter <bap@cs.unm.edu>  Mon, 25 Mar 2002 09:13:57 -0700
+
+qhull (3.1-2) unstable; urgency=low
+
+  * src/qconvex.c did not belong in the library
+  * qh_version was multiply defined, now defined only in qhull.c
+
+ -- Barak Pearlmutter <bap@cs.unm.edu>  Mon, 25 Mar 2002 08:55:45 -0700
+
+qhull (3.1-1) unstable; urgency=low
+
+  * Initial Release.  (closes: #108115)
+
+ -- Barak Pearlmutter <bap@cs.unm.edu>  Sun, 24 Mar 2002 21:53:13 -0700
diff --git a/project/debian/control b/project/debian/control
new file mode 100644
index 0000000000000000000000000000000000000000..462bbe3f45443e920b6090903bdcdaba4782dff8
--- /dev/null
+++ b/project/debian/control
@@ -0,0 +1,56 @@
+Source: qhull
+Section: math
+Priority: optional
+Maintainer: Rafael Laboissiere <rafael@debian.org>
+Standards-Version: 3.6.1
+Build-Depends: debhelper (>= 4), docbook-utils, eperl, dpatch
+
+Package: libqhull5
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Calculate convex hulls and related structures (shared library)
+ Qhull computes convex hulls, Delaunay triangulations, halfspace
+ intersections about a point, Voronoi diagrams, furthest-site
+ Delaunay triangulations, and furthest-site Voronoi diagrams. It
+ runs in 2-d, 3-d, 4-d, and higher dimensions.
+ .
+ This package contain the shared C library.
+ .
+ Homepage: http://www.qhull.org
+
+Package: libqhull-dev
+Section: libdevel
+Architecture: any
+Depends: libqhull5 (= ${Source-Version}), libc6-dev
+Description: Calculate convex hulls and related structures (development files)
+ Qhull computes convex hulls, Delaunay triangulations, halfspace
+ intersections about a point, Voronoi diagrams, furthest-site
+ Delaunay triangulations, and furthest-site Voronoi diagrams. It
+ runs in 2-d, 3-d, 4-d, and higher dimensions.
+ .
+ This package contains the files necessary for development (headers and
+ libraries), as well as the library documentation in HTML format.
+ .
+ Homepage: http://www.qhull.org
+
+Package: qhull-bin
+Section: math
+Architecture: any
+Depends: libqhull5 (= ${Source-Version})
+Suggests: geomview
+Description: Calculate convex hulls and related structures (utilities)
+ Qhull computes convex hulls, Delaunay triangulations, halfspace
+ intersections about a point, Voronoi diagrams, furthest-site
+ Delaunay triangulations, and furthest-site Voronoi diagrams. It
+ runs in 2-d, 3-d, 4-d, and higher dimensions.
+ .
+ This package contains the qhull executable that gives a pipe interface to
+ some of the functionality of the library.  Also included is rbox is a
+ useful tool in generating input for Qhull; it generates hypercubes,
+ diamonds, cones, circles, simplices, spirals, lattices, and random points.
+ .
+ Qhull produces graphical output for Geomview.  This helps with
+ understanding the output (http://www.geomview.org).
+ .
+ Homepage: http://www.qhull.org
diff --git a/project/debian/copyright b/project/debian/copyright
new file mode 100644
index 0000000000000000000000000000000000000000..03c6b3c2aa0d8b0051160d6025d76ed745c4544b
--- /dev/null
+++ b/project/debian/copyright
@@ -0,0 +1,56 @@
+This package was debianized by Rafael Laboissiere <rafael@debian.org> on
+Mon Mar  1 00:28:18 CET 2004
+
+It was downloaded from:
+
+    http://www.qhull.org/download/qhull-2003.1.tar.gz
+
+Upstream Authors:
+
+    C. Bradford Barber <bradb@qhull.org>
+    Hannu Huhdanpaa <hannu@qhull.org>
+
+    c/o The Geometry Center
+    University of Minnesota
+    400 Lind Hall
+    207 Church Street S.E.
+    Minneapolis, MN  55455
+
+Copyright:
+
+ The formal license is in the source file COPYING.txt
+
+                    Qhull, Copyright (c) 1993-2003
+
+       The National Science and Technology Research Center for
+        Computation and Visualization of Geometric Structures
+                        (The Geometry Center)
+                       University of Minnesota
+
+                       email: qhull@qhull.org
+
+This software includes Qhull from The Geometry Center.  Qhull is 
+copyrighted as noted above.  Qhull is free software and may be obtained 
+via http from www.qhull.org.  It may be freely copied, modified, 
+and redistributed under the following conditions:
+
+1. All copyright notices must remain intact in all files.
+
+2. A copy of this text file must be distributed along with any copies 
+   of Qhull that you redistribute; this includes copies that you have 
+   modified, or copies of programs or other software products that 
+   include Qhull.
+
+3. If you modify Qhull, you must include a notice giving the
+   name of the person performing the modification, the date of
+   modification, and the reason for such modification.
+
+4. When distributing modified versions of Qhull, or other software 
+   products that include Qhull, you must provide notice that the original 
+   source code may be obtained as noted above.
+
+5. There is no warranty or other guarantee of fitness for Qhull, it is 
+   provided solely "as is".  Bug reports or fixes may be sent to 
+   qhull_bug@qhull.org; the authors may or may not act on them as 
+   they desire.
+
diff --git a/project/debian/install-src-html.sh b/project/debian/install-src-html.sh
new file mode 100644
index 0000000000000000000000000000000000000000..1633c7d834655dcc1743bb83719de046288d2b20
--- /dev/null
+++ b/project/debian/install-src-html.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+html=htm
+dir=$1
+mkdir -p $1
+src= \
+
+for i in geom.h     \
+         mem.h      \
+         merge.h    \
+         poly.h     \
+         io.h       \
+         qhull_a.h  \
+         qhull.h    \
+         qset.h     \
+         stat.h     \
+         user.h     \
+         geom2.c    \
+         geom.c     \
+         global.c   \
+         io.c       \
+         mem.c      \
+         merge.c    \
+         poly2.c    \
+         poly.c     \
+         qconvex.c  \
+         qdelaun.c  \
+         qhalf.c    \
+         qhull.c    \
+         qset.c     \
+         qvoronoi.c \
+         stat.c     \
+         unix.c     \
+         user.c     \
+         user_eg.c ; do
+
+    cp src/$i $dir/$i.$html
+    perl -pi -e 'BEGIN{$f=1} if ($f) {s:^/\*::; $f=0}' $dir/$i.$html
+
+done
+
+for i in index.htm    \
+         qh-geom.htm  \
+         qh-globa.htm \
+         qh-io.htm    \
+         qh-mem.htm   \
+         qh-merge.htm \
+         qh-poly.htm  \
+         qh-qhull.htm \
+         qh-set.htm   \
+         qh-stat.htm  \
+         qh-user.htm ; do
+
+    cp src/$i $dir
+
+done
+
+for i in $dir/*.htm ; do
+
+    perl -pi -e 's/(href="[a-z2_]+.)(c|h)/$1$2.'$html'/' $i
+
+done
diff --git a/project/debian/libqhull-dev.doc-base b/project/debian/libqhull-dev.doc-base
new file mode 100644
index 0000000000000000000000000000000000000000..cbd01a3855bdc5270728d1a598e8a971fcbe7c4d
--- /dev/null
+++ b/project/debian/libqhull-dev.doc-base
@@ -0,0 +1,13 @@
+Document: qhull
+Title: QHull Manual
+Author: C. Bradford Barber
+Abstract: This manual describes Qhull, a general dimension convex hull
+ program that reads a set of points from stdin, and outputs the smallest
+ convex set that contains the points to stdout.  It also generates Delaunay
+ triangulations, Voronoi diagrams, furthest-site Voronoi diagrams, and
+ halfspace intersections about a point.
+Section: math
+
+Format: HTML
+Index: /usr/share/doc/libqhull5/html/qh-man.htm
+Files: /usr/share/doc/libqhull5/html/*.htm
diff --git a/project/debian/libqhull-dev.files b/project/debian/libqhull-dev.files
new file mode 100644
index 0000000000000000000000000000000000000000..71158c426c90c881d99daafc6a2f0946acddcec5
--- /dev/null
+++ b/project/debian/libqhull-dev.files
@@ -0,0 +1,8 @@
+usr/lib/libqhull.a
+usr/lib/libqhull.la
+usr/lib/libqhull.so
+usr/include
+usr/share/doc/libqhull5/examples
+usr/share/doc/libqhull5/*htm*
+usr/share/doc/libqhull5/src
+usr/share/doc/libqhull5/*.txt
diff --git a/project/debian/libqhull5.files b/project/debian/libqhull5.files
new file mode 100644
index 0000000000000000000000000000000000000000..73752c9aeaacb6161fbc5c9c9db90d67cb8b19a8
--- /dev/null
+++ b/project/debian/libqhull5.files
@@ -0,0 +1 @@
+usr
diff --git a/project/debian/manpage.in b/project/debian/manpage.in
new file mode 100644
index 0000000000000000000000000000000000000000..bb5155ef315684f427e4895620582e680dbbc585
--- /dev/null
+++ b/project/debian/manpage.in
@@ -0,0 +1,109 @@
+<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+     page: `docbook-to-man manpage.sgml > manpage.1'.  You may view
+     the manual page with: `docbook-to-man manpage.sgml | nroff -man |
+     less'.  A typical entry in a Makefile or Makefile.am is:
+
+manpage.1: manpage.sgml
+	docbook-to-man $< > $@
+
+
+	The docbook-to-man binary is found in the docbook-to-man package.
+	Please remember that if you create the nroff version in one of the
+	debian/rules file targets (such as build), you will need to include
+	docbook-to-man in your Build-Depends control field.
+
+  -->
+
+  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
+  <!ENTITY dhfirstname "<firstname>Rafael</firstname>">
+  <!ENTITY dhsurname   "<surname>Laboissiere</surname>">
+  <!-- Please adjust the date whenever revising the manpage. -->
+  <!ENTITY dhdate      "<date>2004-02-06</date>">
+  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+       allowed: see man(7), man(1). -->
+  <!ENTITY dhsection   "<manvolnum>1</manvolnum>">
+  <!ENTITY dhemail     "<email>rafael@debian.org</email>">
+  <!ENTITY dhusername  "Rafael Laboissiere">
+  <!ENTITY dhucpackage "<refentrytitle><:=$command:></refentrytitle>">
+  <!ENTITY dhpackage   "<:=$command:>">
+
+  <!ENTITY debian      "<productname>Debian</productname>">
+  <!ENTITY gnu         "<acronym>GNU</acronym>">
+  <!ENTITY gpl         "&gnu; <acronym>GPL</acronym>">
+]>
+
+<refentry>
+  <refentryinfo>
+    <address>
+      &dhemail;
+    </address>
+    <author>
+      &dhfirstname;
+      &dhsurname;
+    </author>
+    <copyright>
+      <year>2003</year>
+      <holder>&dhusername;</holder>
+    </copyright>
+    &dhdate;
+  </refentryinfo>
+  <refmeta>
+    &dhucpackage;
+
+    &dhsection;
+  </refmeta>
+  <refnamediv>
+    <refname>&dhpackage;</refname>
+
+    <refpurpose><:=$purpose:></refpurpose>
+  </refnamediv>
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>&dhpackage;</command>
+      <arg><option><replaceable>options</replaceable></option></arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+  <refsect1>
+    <title>DESCRIPTION</title>
+
+    <para>
+      This manual page was written for the &debian; distribution
+      because the original program does not have a manual page.
+    </para>
+
+    <para>
+      This program is documented fully in <ulink
+      url="file:///usr/share/doc/<:=$soname:>/html/<:=$command:>.htm">HTML
+      format</ulink>, available in the <:=$soname:>-dev package.
+  </refsect1>
+  <refsect1>
+    <title>AUTHOR</title>
+
+    <para>
+      This manual page was written by &dhusername; &dhemail; for the
+      &debian; system (but may be used by others withouth any
+      restrictions).
+
+  </refsect1>
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:2
+sgml-indent-data:t
+sgml-parent-document:nil
+sgml-default-dtd-file:nil
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->
+
+
diff --git a/project/debian/patches/00list b/project/debian/patches/00list
new file mode 100644
index 0000000000000000000000000000000000000000..895e71430a0cc99da8dabb04cb397961d14ebadd
--- /dev/null
+++ b/project/debian/patches/00list
@@ -0,0 +1,2 @@
+QHpointer.dpatch
+make-new-msg.dpatch
diff --git a/project/debian/patches/QHpointer.dpatch b/project/debian/patches/QHpointer.dpatch
new file mode 100644
index 0000000000000000000000000000000000000000..16f04f5eaf0dc232040625f8fc2b2772bbb101da
--- /dev/null
+++ b/project/debian/patches/QHpointer.dpatch
@@ -0,0 +1,35 @@
+#! /bin/sh -e
+## QHpointer.dpatch by Rafael Laboissiere <rafael@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Access Qhull globals via a pointer to allocated memory
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+if [ $# -ne 1 ]; then
+  echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+  exit 1
+fi
+case "$1" in
+  -patch)
+    patch $patch_opts -p1 < $0;;
+  -unpatch)
+    patch $patch_opts -p1 -R < $0;;
+  *)
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1;;
+esac
+
+exit 0
+--- qhull-orig/src/user.h	2002-04-29 11:01:46.000000000 +0200
++++ qhull/src/user.h	2004-02-02 11:04:47.000000000 +0100
+@@ -509,7 +509,7 @@
+   see:
+     user_eg.c for an example
+ */
+-#define qh_QHpointer 0
++#define qh_QHpointer 1
+ #if 0  /* sample code */
+     qhT *oldqhA, *oldqhB;
+ 
diff --git a/project/debian/patches/make-new-msg.dpatch b/project/debian/patches/make-new-msg.dpatch
new file mode 100644
index 0000000000000000000000000000000000000000..8cb77cccdf91edb09d22efbe5644078e6e325b00
--- /dev/null
+++ b/project/debian/patches/make-new-msg.dpatch
@@ -0,0 +1,40 @@
+#! /bin/sh -e
+## QHpointer.dpatch by Rafael Laboissiere <rafael@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Access Qhull globals via a pointer to allocated memory
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+if [ $# -ne 1 ]; then
+  echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+  exit 1
+fi
+case "$1" in
+  -patch)
+    patch $patch_opts -p1 < $0;;
+  -unpatch)
+    patch $patch_opts -p1 -R < $0;;
+  *)
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1;;
+esac
+
+exit 0
+--- qhull-orig/src/io.c	2004-01-31 12:00:15.000000000 +0100
++++ qhull/src/io.c	2004-02-06 09:54:18.000000000 +0100
+@@ -4017,11 +4017,8 @@
+     qh rbox_command[strlen(qh rbox_command)-1]= '\0';
+     if (!strcmp (qh rbox_command, "./rbox D4")) 
+       fprintf (qh ferr, "\n\
+-This is the qhull test case.  If any errors or core dumps occur,\n\
+-recompile qhull with 'make new'.  If errors still occur, there is\n\
+-an incompatibility.  You should try a different compiler.  You can also\n\
+-change the choices in user.h.  If you discover the source of the problem,\n\
+-please send mail to qhull_bug@qhull.org.\n\
++This is the qhull test case.  If any errors or core dumps occur,\n\
++fill a bug report against the libqhull<soversion> Debian package.\n\
+ \n\
+ Type 'qhull' for a short list of options.\n");
+   }
diff --git a/project/debian/qhull-bin.files b/project/debian/qhull-bin.files
new file mode 100644
index 0000000000000000000000000000000000000000..a65408f7ad114e94d1a0ba87ae557e5ccc5896ed
--- /dev/null
+++ b/project/debian/qhull-bin.files
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/man
diff --git a/project/debian/rules b/project/debian/rules
new file mode 100644
index 0000000000000000000000000000000000000000..1bee78bb39f8c854d3ca9e175c263014ce3aeb81
--- /dev/null
+++ b/project/debian/rules
@@ -0,0 +1,104 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# This is the debhelper compatibility version to use.
+export DH_COMPAT=4
+
+PACKAGE := qhull
+
+soversion  := 5
+soname     := libqhull$(soversion)
+instdir    := debian/$(soname)
+destdir    := $(shell pwd)/debian/tmp
+debdoc     := $(destdir)/usr/share/doc
+debdoclib  := $(destdir)/usr/share/doc/$(soname)
+
+include /usr/share/dpatch/dpatch.make
+
+config: config-stamp
+config-stamp:
+	dh_testdir
+	./configure --prefix=/usr --mandir=/usr/share/man
+	touch config-stamp
+
+build: build-stamp
+build-stamp: patch config
+	dh_testdir
+
+	$(MAKE)
+
+	( cd debian ; \
+	  for info in "qconvex:compute the convex hull" \
+	              "qdelaunay:compute the Delaunay triangulation" \
+	              "qhalf:halfspace intersection about a point" \
+	              "qvoronoi:compute the Voronoi diagram" ; do \
+	    comm=`echo  $$info | cut -d: -f1` ; \
+	    purp=`echo  $$info | cut -d: -f2` ; \
+	    eperl -d command=$$comm -d purpose="$$purp" -d soname=$(soname) \
+	      manpage.in > $$comm.sgml ; \
+	    docbook2man $$comm.sgml ; \
+	  done )
+
+	touch build-stamp
+
+clean: unpatch
+	dh_testdir
+	dh_testroot
+
+	-$(MAKE) distclean
+	( cd debian ; rm -rf *.sgml *.1 manpage.links manpage.refs )
+
+	rm -f install-stamp build-stamp config-stamp patch-stamp
+
+	dh_clean
+
+install: install-stamp
+install-stamp: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	$(MAKE) install DESTDIR=$(destdir)
+	rm -f $(debdoc)/qhull/COPYING.txt
+	mv $(debdoc)/qhull/Changes.txt $(debdoc)/qhull/changelog
+
+	mv $(debdoc)/qhull $(debdoclib)
+	for i in libqhull-dev qhull-bin ; do \
+	  mkdir -p debian/$$i/usr/share/doc ; \
+	  ln -s $(soname) debian/$$i/usr/share/doc/$$i ; \
+	done
+
+	chmod +x debian/install-src-html.sh
+	debian/install-src-html.sh $(debdoclib)/src
+
+	dh_movefiles --no-package=$(soname)
+	dh_movefiles --package=$(soname)
+
+	dh_installman --package=qhull-bin debian/*.1
+
+	touch install-stamp
+
+# Build architecture-independent files here.
+binary-indep:
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installdocs -p$(soname) debian/copyright
+	dh_installchangelogs -p$(soname)
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install config \
+        patch unpatch