xref: /netbsd-src/usr.sbin/makemandb/makemandb.8 (revision 82ad575716605df31379cf04a2f3efbc97b8a6f5)
1.\" $NetBSD: makemandb.8,v 1.6 2012/10/06 15:33:59 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 October 5, 2012
33.Dt MAKEMANDB 8
34.Os
35.Sh NAME
36.Nm makemandb
37.Nd parse the manual pages and build a search index over them
38.Sh SYNOPSIS
39.Nm
40.Op Fl floQqv
41.Op Fl C Ar path
42.Sh DESCRIPTION
43The
44.Nm
45utility traverses the directories containing man pages, parses the manual
46pages with the help of libmandoc and builds an Sqlite database
47.Pa man.db
48to support full text searches.
49It obtains the list of directories to traverse using the
50.Fl Ar path
51and
52.Fl p
53options of
54.Xr man 1 .
55.Pp
56It supports the following options:
57.Bl -tag -width indent
58.It Fl C Ar path
59Use different
60.Xr man 1
61configuration file than the default,
62.Pa /etc/man.conf .
63.It Fl f
64Force rebuilding the index from scratch, pruning the existing one.
65.It Fl l
66Limit the parsing to only the NAME section of the pages.
67This option can be used to mimic the behavior of the classic
68.Xr apropos 1
69and also to substantially save disk space.
70.It Fl o
71Use this option to optimize the index for speed and also
72to significantly reduce disk space usage.
73This is a somewhat expensive operation.
74.It Fl Q
75Print only fatal error messages (i.e., when the database is left in
76an inconsistent state and needs manual intervention).
77.It Fl q
78Print only warnings and error messages but no status updates.
79.It Fl v
80Enable verbose output.
81This prints the name of every file being parsed
82and a summary at the end of the index update.
83.El
84.Pp
85.Nm .
86.Ss DATABASE SCHEMA
87The name of the FTS table is mandb and its schema is as follows:
88.Bl -column -offset indent "Column Name" "Column Description"
89.It Li section Ta The section number of the page
90.It Li name Ta The name of the page from the NAME section.
91.It Li name_desc Ta The one line description from the NAME section.
92.It Li desc Ta The DESCRIPTION section.
93.It Li lib Ta The LIBRARY section.
94.It Li return_vals Ta The RETURN VALUES section.
95.It Li env Ta The ENVIRONMENT section.
96.It Li files Ta The FILES section.
97.It Li exit_status Ta The EXIT STATUS section.
98.It Li diagnostics Ta The DIAGNOSTICS section.
99.It Li errors Ta The ERRORS section.
100.It Li md5_hash Ta  MD5 checksum of the man page.
101.It Li machine Ta The machine architecture (if any) for which the man
102page is relevant.
103.El
104.Sh FILES
105.Bl -hang -width /etc/man.conf -compact
106.It Pa /etc/man.conf
107The location of the Sqlite FTS database can be configured using the
108.Cd _mandb
109tag.
110.El
111.Sh SEE ALSO
112.Xr apropos 1 ,
113.Xr man 1 ,
114.Xr whatis 1 ,
115.Xr man.conf 5
116.Sh AUTHORS
117.An Abhinav Upadhyay
118