source: chapter06/man-db.xml@ 2df049de

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 2df049de was 2df049de, checked in by Ken Moffat <ken@…>, 18 years ago

More Berkeleyization for DB, thanks to Randy for advice.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7259 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 10.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-system-man-db" role="wrap">
7<title>Man-DB-&man-db-version;</title>
8<?dbhtml filename="man-db.html"?>
9
10<indexterm zone="ch-system-man-db"><primary sortas="a-Man-DB">Man-DB</primary></indexterm>
11
12<sect2 role="package"><title/>
13<para>The Man-DB package contains programs for finding and viewing man pages.</para>
14
15<segmentedlist>
16<segtitle>&buildtime;</segtitle>
17<segtitle>&diskspace;</segtitle>
18<seglistitem><seg>0.1 SBU</seg><seg>1.1 MB</seg></seglistitem>
19</segmentedlist>
20
21<segmentedlist>
22<segtitle>&dependencies;</segtitle>
23<seglistitem><seg>Bash, Berkeley DB, Binutils, Coreutils, Gawk, GCC,
24Gettext, Glibc, Grep, Make, and Sed</seg></seglistitem>
25</segmentedlist>
26</sect2>
27
28<sect2 role="installation">
29<title>Installation of Man-DB</title>
30
31<para>Three adjustments need to be made to the sources of Man-DB.</para>
32
33<para>The first one changes the location of translated manual pages that come
34with Man-DB, in order for them to be accessible in both traditional and
35UTF-8 locales:</para>
36
37<screen><userinput>mv man/de{_DE.88591,} &amp;&amp;
38mv man/es{_ES.88591,} &amp;&amp;
39mv man/it{_IT.88591,} &amp;&amp;
40mv man/ja{_JP.eucJP,} &amp;&amp;
41sed -i 's,\*_\*,??,' man/Makefile.in</userinput></screen>
42
43<para>The second change is a <command>sed</command> substitution to delete the
44<quote>/usr/man</quote> lines in the
45<filename>man_db.conf</filename> file to prevent redundant results when
46using programs such as <command>whatis</command>:</para>
47
48<screen><userinput>sed -i '/\t\/usr\/man/d' src/man_db.conf.in</userinput></screen>
49
50<para>The third change accounts for programs that Man-DB should be able
51to find at runtime, but that haven't been installed yet:</para>
52
53<screen><userinput>cat &gt;&gt;include/manconfig.h.in &lt;&lt;"EOF"
54<literal>#define WEB_BROWSER "exec /usr/bin/lynx"
55#define COL "/usr/bin/col"
56#define VGRIND "/usr/bin/vgrind"
57#define GRAP "/usr/bin/grap"</literal>
58EOF</userinput></screen>
59
60<para>The <command>col</command> program is a part of the Util-linux package,
61<command>lynx</command> is a text-based web browser
62(see BLFS for installation instructions),
63<command>vgrind</command> converts program sources to Groff input,
64and <command>grap</command> is useful for typesetting graphs in Groff documents.
65The <command>vgrind</command> and <command>grap</command> programs are
66not normally needed for viewing manual pages. They are
67not part of LFS or BLFS, but you should be able to install them yourself
68after finishing LFS if you wish to do so.</para>
69
70<para>Prepare Man-DB for compilation:</para>
71
72<screen><userinput>./configure --prefix=/usr --enable-mb-groff --disable-setuid</userinput></screen>
73
74<para>The meaning of the configure options:</para>
75
76<variablelist>
77<varlistentry>
78<term><parameter>--enable-mb-groff</parameter></term>
79<listitem><para>This tells the <command>man</command> program to
80use the <quote>ascii8</quote> and <quote>nippon</quote> Groff devices for formatting non-ISO-8859-1
81manual pages.</para></listitem>
82</varlistentry>
83<varlistentry>
84<term><parameter>--disable-setuid</parameter></term>
85<listitem><para>This disables making the <command>man</command> program
86setuid to user <quote>man</quote>.</para></listitem>
87</varlistentry>
88</variablelist>
89
90<para>Compile the package:</para>
91
92<screen><userinput>make</userinput></screen>
93
94<para>Install the package:</para>
95
96<screen><userinput>make install</userinput></screen>
97
98<para>Additional information regarding the compression of
99man and info pages can be found in the BLFS book at
100<ulink url="&blfs-root;view/cvs/postlfs/compressdoc.html"/>.</para>
101
102</sect2>
103
104<sect2><title>Non-English Manual Pages in LFS</title>
105
106<para>Linux distributions have different policies concerning the character
107encoding in which manual pages are stored in the filesystem. E.g., RedHat
108stores all manual pages in UTF-8, while Debian uses language-specific
109(mostly 8-bit) encodings. This leads to incompatibility of packages with
110manual pages designed for different distributions.</para>
111
112<para>LFS uses the same conventions as Debian. The relationship between
113language codes and the expected encoding of manual pages is listed below.
114Man-DB automatically converts them to the locale encoding while viewing.</para>
115
116<!-- Origin: man-db-2.4.3/src/encodings.c -->
117<table frame='all'><title>Expected character encoding of manual pages</title>
118<tgroup cols='2' align='center' colsep='1' rowsep='1'>
119<thead>
120<row><entry>Language (code)</entry><entry>Encoding</entry></row>
121</thead>
122<tbody>
123<row><entry>Danish (da)</entry><entry>ISO-8859-1</entry></row>
124<row><entry>German (de)</entry><entry>ISO-8859-1</entry></row>
125<row><entry>English (en)</entry><entry>ISO-8859-1</entry></row>
126<row><entry>Spanish (es)</entry><entry>ISO-8859-1</entry></row>
127<row><entry>Finnish (fi)</entry><entry>ISO-8859-1</entry></row>
128<row><entry>French (fr)</entry><entry>ISO-8859-1</entry></row>
129<row><entry>Irish (ga)</entry><entry>ISO-8859-1</entry></row>
130<row><entry>Galician (gl)</entry><entry>ISO-8859-1</entry></row>
131<row><entry>Indonesian (id)</entry><entry>ISO-8859-1</entry></row>
132<row><entry>Icelandic (is)</entry><entry>ISO-8859-1</entry></row>
133<row><entry>Italian (it)</entry><entry>ISO-8859-1</entry></row>
134<row><entry>Dutch (nl)</entry><entry>ISO-8859-1</entry></row>
135<!-- BUG: "no" is deprecated, should use "nb" or "nn" and symlinks -->
136<row><entry>Norwegian (no)</entry><entry>ISO-8859-1</entry></row>
137<!-- END BUG -->
138<row><entry>Portuguese (pt)</entry><entry>ISO-8859-1</entry></row>
139<row><entry>Swedish (sv)</entry><entry>ISO-8859-1</entry></row>
140<!-- Languages below require patched groff -->
141<row><entry>Czech (cs)</entry><entry>ISO-8859-2</entry></row>
142<row><entry>Croatian (hr)</entry><entry>ISO-8859-2</entry></row>
143<row><entry>Hungarian (hu)</entry><entry>ISO-8859-2</entry></row>
144<row><entry>Japanese (ja)</entry><entry>EUC-JP</entry></row>
145<row><entry>Korean (ko)</entry><entry>EUC-KR</entry></row>
146<row><entry>Polish (pl)</entry><entry>ISO-8859-2</entry></row>
147<row><entry>Russian (ru)</entry><entry>KOI8-R</entry></row>
148<row><entry>Slovak (sk)</entry><entry>ISO-8859-2</entry></row>
149<row><entry>Turkish (tr)</entry><entry>ISO-8859-9</entry></row>
150</tbody>
151</tgroup>
152</table>
153
154<note><para>Manual pages in languages not in the list are not supported.
155Norwegian doesn't work now because of the transition from no_NO to nb_NO
156locale, and Korean is non-functional because of the incomplete Groff patch.
157</para></note>
158
159<para>If upstream distributes the manual pages in the same encoding as
160Man-DB expects, the manual pages can be copied to
161<filename class="directory">/usr/share/man/<replaceable>[language code]</replaceable></filename>.
162E.g., French manual pages
163(<ulink url="http://ccb.club.fr/man/man-fr-1.58.0.tar.bz2"/>)
164can be installed with the following command:</para>
165
166<screen role="nodump"><userinput>mkdir -p /usr/share/man/fr &amp;&amp;
167cp -rv man? /usr/share/man/fr</userinput></screen>
168
169<para>If upstream distributes manual pages in UTF-8 (i.e., <quote>for RedHat</quote>)
170instead of the encoding listed in the table above, they have to be
171converted from UTF-8 to the encoding listed in the table before
172installation. E.g., Spanish manual pages
173(<ulink url="http://ditec.um.es/~piernas/manpages-es/man-pages-es-1.55.tar.bz2"/>)
174can be installed with the following commands:</para>
175
176<screen role="nodump"><userinput>mkdir -p /usr/share/man/es &amp;&amp;
177find man? -type f | grep -v 'man7/iso_8859-7.7' | \
178while read F ; do
179 iconv -f UTF-8 -t ISO-8859-1 $F >tmp ; mv tmp $F
180done &amp;&amp;
181cp -rv man? /usr/share/man/es</userinput></screen>
182
183<note><para>The need to exclude the <filename>man7/iso_8859-7.7</filename> file
184from the conversion process because it is already in ISO-8859-1 is a packaging
185bug in man-pages-es-1.55. Future versions should not require this workaround.</para></note>
186
187</sect2>
188
189<sect2 id="contents-man-db" role="content"><title>Contents of Man-DB</title>
190
191<segmentedlist>
192<segtitle>Installed programs</segtitle>
193<seglistitem><seg>accessdb, apropos, catman, lexgrog, man, mandb, manpath,
194and whatis</seg></seglistitem>
195</segmentedlist>
196
197<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
198<?dbfo list-presentation="list"?>
199<?dbhtml list-presentation="table"?>
200
201
202<varlistentry id="accessdb">
203<term><command>accessdb</command></term>
204<listitem>
205<para>Dumps the <command>whatis</command> database contents in human-readable form</para>
206<indexterm zone="ch-system-man-db accessdb"><primary sortas="b-accessdb">accessdb</primary></indexterm>
207</listitem>
208</varlistentry>
209
210<varlistentry id="apropos">
211<term><command>apropos</command></term>
212<listitem>
213<para>Searches the <command>whatis</command> database and displays the short descriptions
214of system commands that contain a given string</para>
215<indexterm zone="ch-system-man-db apropos"><primary sortas="b-apropos">apropos</primary></indexterm>
216</listitem>
217</varlistentry>
218
219<varlistentry id="catman">
220<term><command>catman</command></term>
221<listitem>
222<para>Creates or updates the pre-formatted manual pages</para>
223<indexterm zone="ch-system-man-db catman"><primary sortas="b-catman">catman</primary></indexterm>
224</listitem>
225</varlistentry>
226
227<varlistentry id="lexgrog">
228<term><command>lexgrog</command></term>
229<listitem>
230<para>Displays one-line summary information about a given manual page</para>
231<indexterm zone="ch-system-man-db lexgrog"><primary sortas="b-lexgrog">lexgrog</primary></indexterm>
232</listitem>
233</varlistentry>
234
235<varlistentry id="man">
236<term><command>man</command></term>
237<listitem>
238<para>Formats and displays the requested manual page</para>
239<indexterm zone="ch-system-man-db man"><primary sortas="b-man">man</primary></indexterm>
240</listitem>
241</varlistentry>
242
243<varlistentry id="mandb">
244<term><command>mandb</command></term>
245<listitem>
246<para>Creates or updates the <command>whatis</command> database</para>
247<indexterm zone="ch-system-man-db mandb"><primary sortas="b-mandb">mandb</primary></indexterm>
248</listitem>
249</varlistentry>
250
251<varlistentry id="whatis">
252<term><command>whatis</command></term>
253<listitem>
254<para>Searches the <command>whatis</command> database and displays the short descriptions
255of system commands that contain the given keyword as a separate
256word</para>
257<indexterm zone="ch-system-man-db whatis"><primary sortas="b-whatis">whatis</primary></indexterm>
258</listitem>
259</varlistentry>
260</variablelist>
261
262</sect2>
263
264</sect1>
265
Note: See TracBrowser for help on using the repository browser.