xref: /netbsd-src/usr.sbin/makemandb/makemandb.8 (revision 9ddb6ab554e70fb9bbd90c3d96b812bc57755a14)
1.\" $NetBSD: makemandb.8,v 1.2 2012/02/20 18:25:51 joerg 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 February 20, 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 C Ar path
41.Op Fl floqv
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 error messages and no status updates.
76.It Fl v
77Enable verbose output.
78This prints the name of every file being parsed.
79.El
80.Pp
81As the database file is stored under
82.Pa /var/db ,
83root privileges are required to run
84.Nm .
85.Ss DATABASE SCHEMA
86The name of the FTS table is mandb and its schema is as follows:
87.Bl -column -offset indent "Column Name" "Column Description"
88.It Li section Ta The section number of the page
89.It Li name Ta The name of the page from the NAME section.
90.It Li name_desc Ta The one line description from the NAME section.
91.It Li desc Ta The DESCRIPTION section.
92.It Li lib Ta The LIBRARY section.
93.It Li return_vals Ta The RETURN VALUES section.
94.It Li env Ta The ENVIRONMENT section.
95.It Li files Ta The FILES section.
96.It Li exit_status Ta The EXIT STATUS section.
97.It Li errors Ta The ERRORS section.
98.El
99.Sh FILES
100.Bl -hang -width /var/db/man.db -compact
101.It Pa /var/db/man.db
102The Sqlite FTS database which contains an index of the manual pages.
103.El
104.Sh SEE ALSO
105.Xr apropos 1 ,
106.Xr man 1 ,
107.Xr whatis 1 ,
108.Xr man.conf 5
109.Sh AUTHORS
110.An Abhinav Upadhyay
111