6.42. Man-1.6f

The Man package contains programs for finding and viewing man pages.

6.42.1. Environment Settings

This package requires compiler variables to be set for the target in the environment.

export CC="${CLFS_TARGET}-gcc"
export CXX="${CLFS_TARGET}-g++"
export AR="${CLFS_TARGET}-ar"
export AS="${CLFS_TARGET}-as"
export RANLIB="${CLFS_TARGET}-ranlib"
export LD="${CLFS_TARGET}-ld"
export STRIP="${CLFS_TARGET}-strip"

6.42.2. Installation of Man

This patch adds support for Internationalization:

patch -Np1 -i ../man-1.6f-i18n-1.patch

The following patch will add support for new compressors like XZ Utils:

patch -Np1 -i ../man-1.6f-new_compressors-1.patch

A few adjustments need to be made to the sources of Man.

First, a sed substitution is needed to modify configure's default search path for executables. It cycles through the values in PREPATH until it finds the program it is looking for. The -R switch is also added to the PAGER variable so that escape sequences are properly handled by Less:

cp configure{,.orig}
sed -e "/PREPATH=/s@=.*@=\"$(eval echo ${CLFS}/{,usr/}{sbin,bin})\"@g" \
    -e 's@-is@&R@g' configure.orig > configure

Another couple of sed substitutions comment out the “MANPATH /usr/man” and “MANPATH /usr/local/man” lines in the man.conf file to prevent redundant results when using programs such as whatis:

cp src/man.conf.in{,.orig}
sed -e 's@MANPATH./usr/man@#&@g' \
    -e 's@MANPATH./usr/local/man@#&@g' \
    src/man.conf.in.orig > src/man.conf.in

Prepare Man for compilation:

./configure -confdir=/etc

The meaning of the configure options:

-confdir=/etc

This tells the man program to look for the man.conf configuration file in the /etc directory.

Configure was modified to look in ${CLFS} for the paths of helper programs. Right now all of the programs have ${CLFS} as a prefix. Remove that prefix with the following command:

cp conf_script{,.orig}
sed "s@${CLFS}@@" conf_script.orig > conf_script

The makemsg program, in Man's source, is executed during the build. Compile it using the host's gcc:

gcc src/makemsg.c -o src/makemsg

Compile the package:

make

Install the package:

make DESTDIR=${CLFS} install
[Note]

Note

If you will be working on a terminal that does not support text attributes such as color and bold, you can disable Select Graphic Rendition (SGR) escape sequences by editing the man.conf file and adding the -c option to the NROFF variable. If you use multiple terminal types for one computer it may be better to selectively add the GROFF_NO_SGR environment variable for the terminals that do not support SGR.

If the character set of the locale uses 8-bit characters, search for the line beginning with “NROFF” in /etc/man.conf, and verify that it matches the following:

NROFF /usr/bin/nroff -Tlatin1 -mandoc

Note that “latin1” should be used even if it is not the character set of the locale. The reason is that, according to the specification, groff has no means of typesetting characters outside International Organization for Standards (ISO) 8859-1 without some strange escape codes. When formatting man pages, groff thinks that they are in the ISO 8859-1 encoding and this -Tlatin1 switch tells groff to use the same encoding for output. Since groff does no recoding of input characters, the f ormatted result is really in the same encoding as input, and therefore it is usable as the input for a pager.

This does not solve the problem of a non-working man2dvi program for localized man pages in non-ISO 8859-1 locales. Also, it does not work with multibyte character sets. The first problem does not currently have a solution. The second issue is not of concern because the CLFS installation does not support multibyte character sets.

6.42.3. Contents of Man

Installed programs: apropos, makewhatis, man, man2dvi, man2html, and whatis

Short Descriptions

apropos

Searches the whatis database and displays the short descriptions of system commands that contain a given string

makewhatis

Builds the whatis database; it reads all the man pages in the MANPATH and writes the name and a short description in the whatis database for each page

man

Formats and displays the requested on-line man page

man2dvi

Converts a man page into dvi format

man2html

Converts a man page into HTML

whatis

Searches the whatis database and displays the short descriptions of system commands that contain the given keyword as a separate word