#!/bin/bash
cd /usr/src/man-[0-9]*/ ||exit

#make 3 adjustments:

#remove redundant /usr/man from MANPATH (giving eg redundant results for whatis):
sed -i 's@MANPATH./usr/man@#&@g' src/man.conf.in
sed -i 's@MANPATH./usr/local/man@#&@g' src/man.conf.in

#cause less to escape escape sequences correctly (?):
sed -i 's@-is@&R@g' configure



#-default: select a sensible set of default options (e.g. English only):
./configure -confdir=/etc && #-default
export MYCFLAGS=$CFLAGS &&
make CFLAGS='$(MYCFLAGS)' &&
make install


/usr/sbin/makewhatis

# Note: If you wish to disable SGR escape sequences, you should edit
# the man.conf file and add the -c argument to nroff.

#2do: You may want to also take a look at the BLFS page at
# [408]http://www.linuxfromscratch.org/blfs/view/cvs/postlfs/compressdoc
# .html which deals with formatting and compression issues for man pages.
