 -MANPATH	/usr/local/man
 -MANPATH	/usr/local/share/man
 -MANPATH	/usr/X11R6/man
-+MANPATH	/boot/common/man
-+MANPATH	/boot/common/share/man
-+MANPATH	/boot/home/config/man
-+MANPATH	/boot/home/config/share/man
-+MANPATH	/boot/common/*/man
-+MANPATH	/boot/common/*/share/man
-+MANPATH	/boot/home/config/*/man
-+MANPATH	/boot/home/config/*/share/man
++MANPATH	@haikuUserNonPackagedManDir@
++MANPATH	@haikuUserManDir@
++MANPATH	@haikuCommonNonPackagedManDir@
++MANPATH	@haikuCommonManDir@
++MANPATH	@haikuSystemManDir@
  #
  # Uncomment if you want to include one of these by default
  #
-@@ -58,15 +61,9 @@ MANPATH	/usr/X11R6/man
+@@ -58,15 +58,7 @@
  # in the mandatory manpath already, but will keep man from statting
  # lots of other nearby files and directories.
  #

diff -up man-1.6g/configure.orig man-1.6g/configure
--- man-1.6g/configure.orig	2010-12-31 13:28:46.006291456 -0700
+++ man-1.6g/configure	2012-05-02 21:57:49.683147264 -0600
@@ -287,6 +287,12 @@ if test -f /xenix; then
   esac
 fi
 
+echo checking for Haiku
+if test `uname` = "Haiku"; then
+  LIBS="$LIBS -L/boot/system/lib -llocale"
+  mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
+fi
+
 echo checking how to get alloca
 echo '
 #ifdef __GNUC__
diff -up man-1.6g/man2html/Makefile.in.orig man-1.6g/man2html/Makefile.in
--- man-1.6g/man2html/Makefile.in.orig	2010-12-31 13:28:46.010747904 -0700
+++ man-1.6g/man2html/Makefile.in	2012-05-02 21:58:50.621805568 -0600
@@ -2,7 +2,7 @@ CC = @CC@
 CFLAGS += -Wall -Wstrict-prototypes -Wmissing-prototypes
 OBJECTS = man2html.o cgibase.o abbrev.o strdefs.o
 EXEEXT = @EXEEXT@
-bindir = $(DESTDIR)$(PREFIX)/usr/bin
+bindir = $(DESTDIR)$(PREFIX)/bin
 mandir = $(DESTDIR)$(PREFIX)@mandir@
 vardir = $(DESTDIR)$(PREFIX)/var
 httpdir = $(DESTDIR)$(PREFIX)/home/httpd
diff -up man-1.6g/src/Makefile.in.orig man-1.6g/src/Makefile.in
--- man-1.6g/src/Makefile.in.orig	2010-12-31 13:28:46.006815744 -0700
+++ man-1.6g/src/Makefile.in	2012-05-02 21:59:22.845938688 -0600
@@ -30,6 +30,8 @@ LDFLAGS ?= -s
 
 LIBOBJS = @LIBOBJS@
 

-MANPATH_MAP	/usr/X11R6/bin		/usr/X11R6/man
-MANPATH_MAP	/usr/bin/X11		/usr/X11R6/man
-MANPATH_MAP	/usr/bin/mh		/usr/share/man
+MANPATH_MAP	/bin			@haikuSystemManDir@
 #
 # NOAUTOPATH keeps man from automatically adding directories that look like
 # manual page directories to the path.
