--- orig/dh_haskell_build	2007-09-23 10:26:00.000000000 -0700
+++ mod/dh_haskell_build	2007-11-21 16:37:38.000000000 -0800
@@ -147,7 +147,14 @@
 	    if (is_profiling_enabled($package,$dh{DOPACKAGES})) {
 		$profiling_option = " --enable-library-profiling ";
 	    }
-            safesystem("./setup configure " . $profiling_option . " --prefix=" . getcabalbasepath($pkgtype)
+	    my $doc_path_option = "";
+	    my $docpkg = `dh_listpackages | grep -e -doc | head -n1 | tr -d '\n'`;
+	    if (!($docpkg eq "")) {
+		$doc_path_option = " --docdir=/usr/share/doc/" . $docpkg;
+		# . " --htmldir=/usr/share/doc/" . $docpkg . "/html " .
+		#    " --interfacedir=/usr/share/doc/" . $docpkg . "/html " ;
+	    }
+            safesystem("./setup configure " . $profiling_option . $doc_path_option . " --prefix=" . getcabalbasepath($pkgtype)
                        . " --with-compiler=/usr/bin/$pkgtype");
             safesystem("./setup build");
         }
