xref: /netbsd-src/usr.sbin/makemandb/makemandb.8 (revision dd255ccea4286b0c44fa8fd48a9a19a768afe8e1)
1.\" $NetBSD: makemandb.8,v 1.7 2013/11/29 23:58:23 wiz Exp $
2.\"
3.\" Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>
4.\" All rights reserved.
5.\"
6.\" This code was developed as part of Google's Summer of Code 2011 program.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in
16.\"    the documentation and/or other materials provided with the
17.\"    distribution.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
23.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
25.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.Dd November 23, 2013
33.Dt MAKEMANDB 8
34.Os
35.Sh NAME
36.Nm makemandb
37.Nd parse the manual pages and build a search index for
38.Xr apropos 1
39.Sh SYNOPSIS
40.Nm
41.Op Fl floQqv
42.Op Fl C Ar path
43.Sh DESCRIPTION
44The
45.Nm
46utility traverses the directories containing man pages, parses the manual
47pages with the help of libmandoc and builds an Sqlite database
48to support full text searches by
49.Xr apropos 1 .
50It obtains the list of directories to traverse using the
51.Fl Ar path
52and
53.Fl p
54options of
55.Xr man 1 .
56.Pp
57It supports the following options:
58.Bl -tag -width indent
59.It Fl C Ar path
60Use different
61.Xr man 1
62configuration file than the default,
63.Pa /etc/man.conf .
64.It Fl f
65Force rebuilding the index from scratch, pruning the existing one.
66.It Fl l
67Limit the parsing to only the NAME section of the pages.
68This option can be used to mimic the behavior of the classic
69.Xr apropos 1
70and also to substantially save disk space.
71.It Fl o
72Use this option to optimize the index for speed and also
73to significantly reduce disk space usage.
74This is a somewhat expensive operation.
75.It Fl Q
76Print only fatal error messages (i.e., when the database is left in
77an inconsistent state and needs manual intervention).
78.It Fl q
79Print only warnings and error messages but no status updates.
80.It Fl v
81Enable verbose output.
82This prints the name of every file being parsed
83and a summary at the end of the index update.
84.El
85.Pp
86.Nm .
87.Ss DATABASE SCHEMA
88The name of the FTS table is mandb and its schema is as follows:
89.Bl -column -offset indent "Column Name" "Column Description"
90.It Li section Ta The section number of the page
91.It Li name Ta The name of the page from the NAME section.
92.It Li name_desc Ta The one line description from the NAME section.
93.It Li desc Ta The DESCRIPTION section.
94.It Li lib Ta The LIBRARY section.
95.It Li return_vals Ta The RETURN VALUES section.
96.It Li env Ta The ENVIRONMENT section.
97.It Li files Ta The FILES section.
98.It Li exit_status Ta The EXIT STATUS section.
99.It Li diagnostics Ta The DIAGNOSTICS section.
100.It Li errors Ta The ERRORS section.
101.It Li md5_hash Ta  MD5 checksum of the man page.
102.It Li machine Ta The machine architecture (if any) for which the man
103page is relevant.
104.El
105.Sh FILES
106.Bl -hang -width /etc/man.conf -compact
107.It Pa /etc/man.conf
108The location of the Sqlite FTS database can be configured using the
109.Cd _mandb
110tag.
111.El
112.Sh SEE ALSO
113.Xr apropos 1 ,
114.Xr man 1 ,
115.Xr whatis 1 ,
116.Xr man.conf 5
117.Sh AUTHORS
118.An Abhinav Upadhyay
119