From 6cf4a0ec87d16e849eb8b2ec9563f75e5ef0c802 Mon Sep 17 00:00:00 2001
From: Ingo Weinhold <ingo_weinhold@gmx.de>
Date: Thu, 3 Oct 2013 02:20:36 +0200
Subject: Set correct default man page search paths


diff --git a/configure b/configure
index 4928ae0..72f37a5 100755
--- a/configure
+++ b/configure
@@ -1368,6 +1368,10 @@ s,@man_config_dir@,$man_config_dir,
 s,@man_config_file@,$man_config_file,
 s,@manpathoption@,$manpathoption,
 s/@sections@/$sections/
+s,@haikuSystemManDir@,`finddir B_SYSTEM_DOCUMENTATION_DIRECTORY`/man,
+s,@haikuSystemNonPackagedManDir@,`finddir B_SYSTEM_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 --git a/src/man.conf.in b/src/man.conf.in
index ce73ffc..346230f 100644
--- a/src/man.conf.in
+++ b/src/man.conf.in
@@ -36,11 +36,10 @@
 #
 # Every automatically generated MANPATH includes these fields
 #
-MANPATH	/usr/man
-MANPATH	/usr/share/man
-MANPATH	/usr/local/man
-MANPATH	/usr/local/share/man
-MANPATH	/usr/X11R6/man
+MANPATH	@haikuUserNonPackagedManDir@
+MANPATH	@haikuUserManDir@
+MANPATH	@haikuSystemNonPackagedManDir@
+MANPATH	@haikuSystemManDir@
 #
 # Uncomment if you want to include one of these by default
 #
@@ -58,15 +57,7 @@ MANPATH	/usr/X11R6/man
 # in the mandatory manpath already, but will keep man from statting
 # lots of other nearby files and directories.
 #
-MANPATH_MAP	/bin			/usr/share/man
-MANPATH_MAP	/sbin			/usr/share/man
-MANPATH_MAP	/usr/bin		/usr/share/man
-MANPATH_MAP	/usr/sbin		/usr/share/man
-MANPATH_MAP	/usr/local/bin		/usr/local/share/man
-MANPATH_MAP	/usr/local/sbin		/usr/local/share/man
-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.
-- 
1.8.3.4


From 9e1bfb921e27bbe735ad965c72de53c2f5183d0d Mon Sep 17 00:00:00 2001
From: Ingo Weinhold <ingo_weinhold@gmx.de>
Date: Thu, 3 Oct 2013 02:21:37 +0200
Subject: src/Makefile.in: Add missing LIBS


diff --git a/src/Makefile.in b/src/Makefile.in
index 0b08305..4df0661 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -30,6 +30,8 @@ LDFLAGS ?= -s
 
 LIBOBJS = @LIBOBJS@
 
+LIBS = @LIBS@
+
 all: man$(EXEEXT) man.conf apropos whatis makewhatis
 
 MANOBJS = man.o manfile.o manpath.o man-config.o man-getopt.o \
-- 
1.8.3.4


From 7444be20edf578bb159e26e1e808470377709802 Mon Sep 17 00:00:00 2001
From: Ingo Weinhold <ingo_weinhold@gmx.de>
Date: Thu, 3 Oct 2013 02:22:08 +0200
Subject: man2html/Makefile.in: Fix mandir and bindir


diff --git a/man2html/Makefile.in b/man2html/Makefile.in
index b41eaba..0c87919 100644
--- a/man2html/Makefile.in
+++ b/man2html/Makefile.in
@@ -2,8 +2,8 @@ CC = @CC@
 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
-- 
1.8.3.4


From 914beae0b7420f8bddf3b2b89883c3a561c9c30e Mon Sep 17 00:00:00 2001
From: Ingo Weinhold <ingo_weinhold@gmx.de>
Date: Thu, 3 Oct 2013 02:22:33 +0200
Subject: configure: Support presetting env vars for commands


diff --git a/configure b/configure
index 72f37a5..c838d25 100755
--- a/configure
+++ b/configure
@@ -406,6 +406,11 @@ if test "$ans" = "false"
 then
   for i in more less cmp cat awk gawk mawk
   do
+    if eval "test \"x\$$i\" != x"
+    then
+      eval F$i=\$$i
+      continue
+    fi
     eval F$i="missing"
     for j in $DEFPATH
     do
@@ -450,6 +455,11 @@ then
 else
   for i in nroff groff geqn gtbl col vgrind grefer grap gpic more less lynx cmp cat awk gawk mawk
   do
+    if eval "test \"x\$$i\" != x"
+    then
+      eval F$i=\$$i
+      continue
+    fi
     eval F$i="missing"
     for j in $DEFPATH
     do
@@ -464,6 +474,11 @@ else
   do
     if test `eval echo \\$Fg$i` = "missing"
     then
+      if eval "test \"x\$$i\" != x"
+      then
+        eval Fg$i=\$$i
+        continue
+      fi
       for j in $DEFPATH
       do
         if test -f $j/$i
@@ -1021,6 +1036,12 @@ then
     compress=
     for i in xz lzma bzip2 gzip bzip tzip pack compress freeze yabba
     do
+      if eval "test \"x\$$i\" != x"
+      then
+        eval F$i=\$$i
+        if [ x$compress = x ]; then eval compress=\$$i; fi
+        continue
+      fi
       eval F$i=missing
       for j in $DEFPATH
       do
@@ -1119,6 +1140,11 @@ fi
 UNCOMPRESSORS="unxz unlzma gunzip bzip2 pcat zcat fcat unyabba"
 for i in $UNCOMPRESSORS
 do
+  if eval "test \"x\$$i\" != x"
+  then
+    eval F$i=\$$i
+    continue
+  fi
   eval F$i=missing
   for j in $DEFPATH
   do
-- 
1.8.3.4

From ccf2eb07650cdeb9dbcc91d5bb271ee95a8da4ac Mon Sep 17 00:00:00 2001
From: Jonathan Schleifer <js@webkeks.org>
Date: Thu, 27 Mar 2014 21:56:39 +0100
Subject: [PATCH] Add -R to less options to fix formattings

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index c838d25..2bf534e 100755
--- a/configure
+++ b/configure
@@ -26,7 +26,7 @@ LANGOPT="+lang {$LANGUAGES|all|none}"
 # (Indeed, -r may cause the terminal to get into funny states.
 # Very inconvenient. For viewing pages in strange locales, set LC_*.)
 #
-DEFAULTLESSOPT="-is"
+DEFAULTLESSOPT="-isR"
 #
 # Note that not creating any cat directories (/var/cache/man or so)
 # and not making man suid or sgid is recommended.
-- 
Jonathan

