  all: man$(EXEEXT) man.conf apropos whatis makewhatis
  
  MANOBJS = man.o manfile.o manpath.o man-config.o man-getopt.o \
-diff -up man-1.6g/src/man.conf.in.orig man-1.6g/src/man.conf.in
---- man-1.6g/src/man.conf.in.orig	2010-10-25 18:22:24.008388608 -0600
-+++ man-1.6g/src/man.conf.in	2012-05-02 21:57:49.699400192 -0600
-@@ -36,11 +36,14 @@
+diff -ur man-1.6g.orig/src/man.conf.in man-1.6g/src/man.conf.in
+--- man-1.6g.orig/src/man.conf.in	2010-10-26 02:22:24.006553600 +0200
++++ man-1.6g/src/man.conf.in	2013-04-24 14:34:03.149946368 +0200
+@@ -36,11 +36,11 @@
  #
  # Every automatically generated MANPATH includes these fields
  #

-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
 #
 # Uncomment if you want to include one of these by default
 #
@@ -58,15 +61,9 @@ MANPATH	/usr/X11R6/man
 # in the mandatory manpath already, but will keep man from statting
 # lots of other nearby files and directories.
 #

diff -ur man-1.6g.orig/configure man-1.6g/configure
--- man-1.6g.orig/configure	2010-12-31 21:28:46.004194304 +0100
+++ man-1.6g/configure	2013-04-24 15:24:06.851968000 +0200
@@ -411,7 +411,7 @@
     do
       if test -f $j/$i
       then
-	eval F$i=$j/$i
+	eval F$i=$i
 	break
       fi
     done
@@ -455,7 +455,7 @@
     do
       if test -f $j/$i
       then
-	eval F$i=$j/$i
+	eval F$i=$i
 	break
       fi
     done
@@ -468,7 +468,7 @@
       do
         if test -f $j/$i
         then
-	  eval Fg$i=$j/$i
+	  eval Fg$i=$i
 	  break
         fi
       done
@@ -1026,7 +1026,7 @@
       do
         if test -f $j/$i
         then
-	  eval F$i=$j/$i
+	  eval F$i=$i
 	  if [ x$compress = x ]; then compress=$j/$i; fi
 	  break
         fi
@@ -1124,7 +1124,7 @@
   do
     if test -f $j/$i
     then
-      eval F$i=$j/$i
+      eval F$i=$i
       break
     fi
   done
@@ -1368,6 +1368,11 @@
 s,@man_config_file@,$man_config_file,
 s,@manpathoption@,$manpathoption,
 s/@sections@/$sections/
+s,@haikuSystemManDir@,`finddir B_SYSTEM_DOCUMENTATION_DIRECTORY`/man,
+s,@haikuCommonManDir@,`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man,
+s,@haikuCommonNonPackagedManDir@,`finddir B_COMMON_NONPACKAGED_DOCUMENTATION_DIRECTORY`/man,
+s,@haikuUserManDir@,`finddir B_USER_DOCUMENTATION_DIRECTORY`/man,
+s,@haikuUserNonPackagedManDir@,`finddir B_USER_NONPACKAGED_DOCUMENTATION_DIRECTORY`/man,
 ' $infile.in >> $infile
 done
 EOS
diff -ur man-1.6g.orig/man2html/Makefile.in man-1.6g/man2html/Makefile.in
--- man-1.6g.orig/man2html/Makefile.in	2010-12-31 21:28:46.008912896 +0100
+++ man-1.6g/man2html/Makefile.in	2013-04-24 15:25:28.619970560 +0200
@@ -2,8 +2,8 @@
 CFLAGS += -Wall -Wstrict-prototypes -Wmissing-prototypes
 OBJECTS = man2html.o cgibase.o abbrev.o strdefs.o
 EXEEXT = @EXEEXT@
-bindir = $(DESTDIR)$(PREFIX)/usr/bin
-mandir = $(DESTDIR)$(PREFIX)@mandir@
+bindir = $(DESTDIR)@bindir@
+mandir = $(DESTDIR)@mandir@
 vardir = $(DESTDIR)$(PREFIX)/var
 httpdir = $(DESTDIR)$(PREFIX)/home/httpd
 cgiowner = nobody
diff -ur man-1.6g.orig/src/Makefile.in man-1.6g/src/Makefile.in
--- man-1.6g.orig/src/Makefile.in	2010-12-31 21:28:46.004718592 +0100
+++ man-1.6g/src/Makefile.in	2013-04-24 13:18:00.114032640 +0200
@@ -30,6 +30,8 @@
 
 LIBOBJS = @LIBOBJS@
 
