xref: /netbsd/usr.bin/man/man.conf.5 (revision bf9ec67e)
1.\"	$NetBSD: man.conf.5,v 1.14 2002/03/08 22:18:04 wiz Exp $
2.\"
3.\" Copyright (c) 1989, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"	@(#)man.conf.5	8.5 (Berkeley) 1/2/94
35.\"
36.Dd June 26, 2001
37.Dt MAN.CONF 5
38.Os
39.Sh NAME
40.Nm man.conf
41.Nd configuration file for
42.Xr man 1
43.Sh DESCRIPTION
44The
45.Xr man 1 ,
46.Xr apropos 1 ,
47.Xr whatis 1
48and
49.Xr makewhatis 8
50commands
51search for manual pages or their database files as specified by the
52.Nm
53file.
54Manual pages are normally expected to be preformatted (see
55.Xr nroff 1 )
56and named with a trailing ``.0''.
57.Pp
58The
59.Nm
60file contains two types of lines.
61.Pp
62The first type of line is a ``section'' line, which contains a
63section name followed by one or more directory paths.
64The directory paths may contain the normal shell globbing characters,
65including curly braces (``{}''); to escape a shell globbing character,
66precede it with a backslash (``\e'').
67Lines in this format specify that manual pages for the section
68may be found in the following directories.
69.Pp
70Section lines may contain either absolute directory paths or relative
71directory paths (but not both).  Relative directory paths are treated
72as a list of subdirectories to append to the current directory search
73path.  Section lines with absolute directory paths (starting with
74``/'') completely replace the current directory search path with their
75content.  Absolute directory paths named with a trailing slash
76character are expected to contain subdirectories of manual pages, (see
77the keyword ``_subdir'' below) instead of man pages.  These
78subdirectories are searched instead of the directory.
79.Pp
80Before searching any directory for a manual page, the
81.Xr man 1
82command always searches the subdirectory with the same name
83as the current machine type, if it exists.
84No specification of these subdirectories is necessary in the
85.Nm
86file.
87.Pp
88Section names are unrestricted except for the reserved words specified
89below; in general, you should avoid anything with a leading underscore
90(``_'') to avoid future incompatibilities.
91.Pp
92The section named ``_default'' is the list of directories that will
93be searched if no section is specified by the user.
94.Pp
95The second type of line is preceded with a ``keyword''.
96The possible keywords and their meanings are as follows:
97.Pp
98.Bl -tag -width "_version"
99.It _build
100Man file names, regardless of their format, are expected to end in
101a ``.*'' pattern, i.e. a ``.'' followed by some suffix.
102The first field of a _build line lists a suffix which indicates
103files which need to be reformatted or manipulated in some way before
104being displayed to the user.
105The suffix may contain the normal shell globbing characters (NOT
106including curly braces (``{}'')).
107The rest of the line must be a shell command line, the standard
108output of which is the manual page in a format which may be directly
109displayed to the user.
110Any occurrences of the string ``%s'' in the shell command line will
111be replaced by the name of the file which is being reformatted.
112.It _crunch
113The ``_crunch'' section is used by catman to know how to crunch cat pages
114which originally were compressed man pages: The first field lists a suffix
115which indicates what kind of compression were used to compress the man page.
116The rest of the line must be a shell command line, used to compress the
117formatted pages.
118.It _subdir
119The list (in search order) of subdirectories which will be searched in
120any directory named with a trailing slash (``/'') character.
121This list is also used when a path is specified to the
122.Xr man 1
123utility by the user, using the
124.Ev MANPATH
125environment variable or the
126.Fl M
127and
128.Fl m
129options.
130.It _suffix
131Man file names, regardless of their format are expected to end in
132a ``.*'' pattern, i.e. a ``.'' followed by some suffix.
133Each field of a _suffix line is a suffix which indicates
134files which do not need to be reformatted or manipulated
135in any way, but which may be directly displayed to the user.
136Each suffix may contain the normal shell globbing characters (NOT
137including curly braces (``{}'')).
138.It _version
139The version of the configuration file.
140.It _whatdb
141The full pathname (not just a directory path) for a database to be used
142by the
143.Xr apropos 1
144and
145.Xr whatis 1
146commands.
147The pathname may contain the normal shell globbing characters,
148including curly braces (``{}''); to escape a shell globbing character,
149precede it with a backslash (``\e'').
150.El
151.Pp
152Multiple specifications for all types of lines are cumulative and the
153entries are used in the order listed in the file; multiple entries may
154be listed per line, as well.
155.Pp
156Empty lines or lines whose first non-whitespace character is a hash
157mark (``#'') are ignored.
158.Sh FILES
159.Bl -tag -width /etc/man.conf -compact
160.It Pa /etc/man.conf
161Standard manual directory search path.
162.El
163.Sh EXAMPLES
164Given the following
165.Nm
166file:
167.Bd -literal -offset indent
168_version	BSD.2
169_subdir		cat[123]
170_suffix		.0
171_build		.[1-9]	nroff -man %s
172_build		.tbl	tbl %s | nroff -man
173_default	/usr/share/man/
174sect3		/usr/share/man/{old/,}cat3
175.Ed
176.Pp
177By default, the command
178.Dq Li man mktemp
179will search for
180``mktemp.\*[Lt]any_digit\*[Gt]'' and ``mktemp.tbl''
181in the directories
182.Dq Pa /usr/share/man/cat1 ,
183.Dq Pa /usr/share/man/cat2 ,
184and
185.Dq Pa /usr/share/man/cat3 .
186If on a machine of type ``vax'', the subdirectory ``vax'' in each
187directory would be searched as well, before the directory was
188searched.
189.Pp
190If ``mktemp.tbl'' was found first, the command
191.Dq Li tbl \*[Lt]manual page\*[Gt] | nroff -man
192would be run to build a man page for display to the user.
193.Pp
194The command
195.Dq Li man sect3 mktemp
196would search the directories
197.Dq Pa /usr/share/man/old/cat3
198and
199.Dq Pa /usr/share/man/cat3 ,
200in that order, for
201the mktemp manual page.
202If a subdirectory with the same name as the current machine type
203existed in any of them, it would be searched as well, before each
204of them were searched.
205.Sh SEE ALSO
206.Xr apropos 1 ,
207.Xr machine 1 ,
208.Xr man 1 ,
209.Xr whatis 1 ,
210.Xr whereis 1 ,
211.Xr fnmatch 3 ,
212.Xr glob 3 ,
213.Xr makewhatis 8
214