1.\" $NetBSD: makemandb.8,v 1.11 2022/09/11 20:32:37 gutteridge 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 June 18, 2016 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 48.Xr mandoc 3 49and builds an SQLite database 50to support full text searches by 51.Xr apropos 1 . 52It obtains the list of directories to traverse using the 53.Fl p 54option 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 faster search by 73.Xr apropos 1 74and also to significantly reduce disk space usage. 75This is an expensive I/O operation. 76.It Fl Q 77Print only fatal error messages (i.e., when the database is left in 78an inconsistent state and needs manual intervention). 79.It Fl q 80Print only warnings and error messages but no status updates. 81.It Fl v 82Enable verbose output. 83This prints the name of every file being parsed 84and a summary at the end of the index update. 85.El 86.Pp 87The index generated by 88.Nm 89is also used by the 90.Xr whatis 1 91program, replacing the old 92.Dq makewhatis 93program. 94.Ss DATABASE SCHEMA 95The name of the FTS table is mandb and its schema is as follows: 96.Bl -column -offset indent "Column Name" "Column Description" 97.It Li section Ta The section number of the page 98.It Li name Ta The name of the page from the NAME section. 99.It Li name_desc Ta The one line description from the NAME section. 100.It Li desc Ta The DESCRIPTION section. 101.It Li lib Ta The LIBRARY section. 102.It Li return_vals Ta The RETURN VALUES section. 103.It Li env Ta The ENVIRONMENT section. 104.It Li files Ta The FILES section. 105.It Li exit_status Ta The EXIT STATUS section. 106.It Li diagnostics Ta The DIAGNOSTICS section. 107.It Li errors Ta The ERRORS section. 108.It Li md5_hash Ta MD5 checksum of the man page. 109.It Li machine Ta The machine architecture (if any) for which the man 110page is relevant. 111.El 112.Sh FILES 113.Bl -hang -width /etc/man.conf -compact 114.It Pa /etc/man.conf 115The location of the SQLite FTS database can be configured using the 116.Cd _mandb 117tag. 118.El 119.Sh SEE ALSO 120.Xr apropos 1 , 121.Xr man 1 , 122.Xr whatis 1 , 123.Xr mandoc 3 , 124.Xr man.conf 5 125.Sh AUTHORS 126.An Abhinav Upadhyay 127