source: chapter06/man-db.xml@ bc81164

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.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 bc81164 was bc81164, checked in by DJ Lucas <dj@…>, 16 years ago

Removed previously commented working text.

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

  • Property mode set to 100644
File size: 17.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-system-man-db" role="wrap">
9 <?dbhtml filename="man-db.html"?>
10
11 <sect1info condition="script">
12 <productname>man-db</productname>
13 <productnumber>&man-db-version;</productnumber>
14 <address>&man-db-url;</address>
15 </sect1info>
16
17 <title>Man-DB-&man-db-version;</title>
18
19 <indexterm zone="ch-system-man-db">
20 <primary sortas="a-Man-DB">Man-DB</primary>
21 </indexterm>
22
23 <sect2 role="package">
24 <title/>
25
26 <para>The Man-DB package contains programs for finding and viewing man
27 pages.</para>
28
29 <segmentedlist>
30 <segtitle>&buildtime;</segtitle>
31 <segtitle>&diskspace;</segtitle>
32
33 <seglistitem>
34 <seg>&man-db-ch6-sbu;</seg>
35 <seg>&man-db-ch6-du;</seg>
36 </seglistitem>
37 </segmentedlist>
38
39 </sect2>
40
41 <sect2 role="installation">
42 <title>Installation of Man-DB</title>
43
44 <para>LFS creates <filename>/usr/man</filename> and
45 <filename>/usr/local/man</filename> as symlinks. Remove them from the
46 <filename>man_db.conf</filename> file to prevent redundant
47 results when using programs such as <command>whatis</command>:</para>
48
49<screen><userinput remap="pre">sed -i -e '\%\t/usr/man%d' -e '\%\t/usr/local/man%d' src/man_db.conf.in</userinput></screen>
50
51 <para>Prepare Man-DB for compilation:</para>
52
53<screen><userinput remap="configure">./configure --prefix=/usr --libexecdir=/usr/lib \
54 --sysconfdir=/etc --disable-setuid \
55 --enable-mb-groff --with-browser=/usr/bin/lynx \
56 --with-col=/usr/bin/col --with-vgrind=/usr/bin/vgrind \
57 --with-grap=/usr/bin/grap</userinput></screen>
58
59 <variablelist>
60 <title>The meaning of the configure options:</title>
61
62 <varlistentry>
63 <term><parameter>--disable-setuid</parameter></term>
64 <listitem>
65 <para>This disables making the <command>man</command> program setuid
66 to user <systemitem class="username">man</systemitem>.</para>
67 </listitem>
68 </varlistentry>
69
70 <varlistentry>
71 <term><parameter>--enable-mb-groff</parameter></term>
72 <listitem>
73 <para>This switch tells <application>man-db</application> to expect
74 the Debian multibyte patched version of
75 <application>groff</application>.</para>
76 </listitem>
77 </varlistentry>
78
79 <varlistentry>
80 <term><parameter>--with-...</parameter></term>
81 <listitem>
82 <para>These four parameters are used to set some default programs.
83 The <command>col</command> program is a part of the Util-linux-ng
84 package, <command>lynx</command> is a text-based web browser (see
85 BLFS for installation instructions), <command>vgrind</command>
86 converts program sources to Groff input, and <command>grap</command>
87 is useful for typesetting graphs in Groff documents. The
88 <command>vgrind</command> and <command>grap</command> programs are
89 not normally needed for viewing manual pages. They are not part of
90 LFS or BLFS, but you should be able to install them yourself after
91 finishing LFS if you wish to do so.</para>
92 </listitem>
93 </varlistentry>
94
95 </variablelist>
96
97 <para>Compile the package:</para>
98
99<screen><userinput remap="make">make</userinput></screen>
100
101 <para>This package does not come with a test suite.</para>
102
103 <para>Install the package:</para>
104
105<screen><userinput remap="install">make install</userinput></screen>
106
107 </sect2>
108
109 <sect2>
110 <title>Non-English Manual Pages in LFS</title>
111
112 <para>Some packages provide non-English manual pages. They are displayed
113 correctly only if their location and encoding matches the expectation of
114 the "man" program. However, different Linux distributions have different
115 policies (expressed in the choice of the <command>man</command> program,
116 its configuration and patches applied to it) concerning the character
117 encoding in which manual pages are stored in the filesystem.</para>
118
119 <para>E.g., Debian previously required Russian manual pages to be encoded
120 in KOI8-R and to be placed in
121 <filename class="directory">/usr/share/man/ru</filename>. Now, in addition,
122 their <command>man</command> program (<application>Man-DB</application>)
123 searches for UTF-8 encoded Russian manual pages in
124 <filename class="directory">/usr/share/man/ru.UTF-8</filename>. On the
125 other hand, Fedora uses UTF-8 encoded manual pages exclusively. Russian
126 manual pages are found in
127 <filename class="directory">/usr/share/man/ru</filename> and their
128 <command>man</command> program doesn't acknowledge
129 <filename class="directory">/usr/share/man/ru.UTF-8</filename>. Many
130 other distributions ignore the on disk encodings completely, leaving the
131 end user with a mix of improperly encoded manual pages for their
132 configuration. When <command>man</command> processes the requtested page,
133 it will display the contents as configured, resulting in completely
134 unreadable text if the on disk encoding is not what is expected for that
135 configuration.</para>
136
137 <para>Disagreement about the expected encoding of manual pages amongst
138 distribution vendors, has led to confusion for upstream package
139 maintainers. One package may contain UTF-8 manual pages, while another
140 ships with manual pages in legacy encodings. <command>man</command>
141 searches for manual pages based on the user's locale settings.
142 <application>Man-DB</application> uses a built-in table (see below) to
143 determine the on disk encoding of manual pages found for a user's
144 locale, only if the directories found do not have an extension that
145 describes the encoding. E.g., because of ".UTF-8" in the directory name,
146 <application>Man-DB</application> knows that all manual pages residing in
147 <filename class="directory">/usr/share/man/fr.UTF-8</filename> are UTF-8
148 encoded and, according to the built-in table, expects all manual pages
149 residing in <filename class="directory">/usr/share/man/ru</filename> to
150 be encoded using KOI8-R.</para>
151
152 <!-- Origin: man-db-2.5.2/src/encodings.c -->
153 <table>
154 <title>Expected character encoding of legacy 8-bit manual pages</title>
155 <?dbfo table-width="2.5in" ?>
156
157 <tgroup cols="2">
158
159 <colspec colnum="1" colwidth="1.5in"/>
160 <colspec colnum="2" colwidth="1in"/>
161
162 <thead>
163 <row>
164 <entry>Language (code)</entry>
165 <entry>Encoding</entry>
166 </row>
167 </thead>
168
169 <tbody>
170 <row>
171 <entry>Danish (da)</entry>
172 <entry>ISO-8859-1</entry>
173 </row>
174 <row>
175 <entry>German (de)</entry>
176 <entry>ISO-8859-1</entry>
177 </row>
178 <row>
179 <entry>English (en)</entry>
180 <entry>ISO-8859-1</entry>
181 </row>
182 <row>
183 <entry>Spanish (es)</entry>
184 <entry>ISO-8859-1</entry>
185 </row>
186 <row>
187 <entry>Finnish (fi)</entry>
188 <entry>ISO-8859-1</entry>
189 </row>
190 <row>
191 <entry>French (fr)</entry>
192 <entry>ISO-8859-1</entry>
193 </row>
194 <row>
195 <entry>Irish (ga)</entry>
196 <entry>ISO-8859-1</entry>
197 </row>
198 <row>
199 <entry>Galician (gl)</entry>
200 <entry>ISO-8859-1</entry>
201 </row>
202 <row>
203 <entry>Indonesian (id)</entry>
204 <entry>ISO-8859-1</entry>
205 </row>
206 <row>
207 <entry>Icelandic (is)</entry>
208 <entry>ISO-8859-1</entry>
209 </row>
210 <row>
211 <entry>Italian (it)</entry>
212 <entry>ISO-8859-1</entry>
213 </row>
214 <row>
215 <entry>Dutch (nl)</entry>
216 <entry>ISO-8859-1</entry>
217 </row>
218 <!-- FIXME: BUG: "no" is deprecated, should use "nb" or "nn" and
219 symlinks -->
220 <row>
221 <entry>Norwegian (no)</entry>
222 <entry>ISO-8859-1</entry>
223 </row>
224 <!-- END BUG -->
225 <row>
226 <entry>Portuguese (pt)</entry>
227 <entry>ISO-8859-1</entry>
228 </row>
229 <row>
230 <entry>Swedish (sv)</entry>
231 <entry>ISO-8859-1</entry>
232 </row>
233 <!-- Languages below require patched groff -->
234 <row>
235 <entry>Bulgarian (bg)</entry>
236 <entry>CP1251</entry>
237 </row>
238 <row>
239 <entry>Czech (cs)</entry>
240 <entry>ISO-8859-2</entry>
241 </row>
242 <row>
243 <entry>Croatian (hr)</entry>
244 <entry>ISO-8859-2</entry>
245 </row>
246 <row>
247 <entry>Hungarian (hu)</entry>
248 <entry>ISO-8859-2</entry>
249 </row>
250 <row>
251 <entry>Japanese (ja)</entry>
252 <entry>EUC-JP</entry>
253 </row>
254 <row>
255 <entry>Korean (ko)</entry>
256 <entry>EUC-KR</entry>
257 </row>
258 <row>
259 <entry>Polish (pl)</entry>
260 <entry>ISO-8859-2</entry>
261 </row>
262 <row>
263 <entry>Russian (ru)</entry>
264 <entry>KOI8-R</entry>
265 </row>
266 <row>
267 <entry>Slovak (sk)</entry>
268 <entry>ISO-8859-2</entry>
269 </row>
270 <row>
271 <entry>Serbian (sr)</entry>
272 <entry>ISO-8859-5</entry>
273 </row>
274 <row>
275 <entry>Turkish (tr)</entry>
276 <entry>ISO-8859-9</entry>
277 </row>
278 <row>
279 <entry>Simplified Chinese (zh_CN)</entry>
280 <entry>GBK</entry>
281 </row>
282 <row>
283 <entry>Simplified Chinese, Singapore (zh_SG)</entry>
284 <entry>GBK</entry>
285 </row>
286 <row>
287 <entry>Traditional Chinese (zh_TW)</entry>
288 <entry>BIG5</entry>
289 </row>
290 <row>
291 <entry>Traditional Chinese, Hong Kong (zh_HK)</entry>
292 <entry>BIG5HKSCS</entry>
293 </row>
294 </tbody>
295
296 </tgroup>
297
298 </table>
299
300 <note>
301 <para>Manual pages in languages not in the list are not supported.
302 Norwegian does not work because of the transition from no_NO to
303 nb_NO locale, and will be fixed in the next release of
304 <application>Man-DB</application>. Korean is currently non functional
305 because of incomplete fixes in the Debian
306 <application>Groff</application> patch applied in LFS.</para>
307 </note>
308
309 <para>Packages may install manual pages into an improperly named directory,
310 depending on which distributions the author develops the package for. To
311 assist in the conversion of the manual pages to the proper encoding for the
312 directory in which they are installed, the <command>convert-mans</command>
313 script was written. It will convert manual pages to another encoding before
314 (or after) installation. Install the <command>convert-mans</command>
315 script with the following instructions:</para>
316
317<screen><userinput remap="install">cat &gt;&gt; convert-mans &lt;&lt; "EOF"
318<literal>#!/bin/sh -e
319FROM="$1"
320TO="$2"
321shift ; shift
322while [ $# -gt 0 ]
323do
324 FILE="$1"
325 shift
326 iconv -f "$FROM" -t "$TO" "$FILE" >.tmp.iconv
327 mv .tmp.iconv "$FILE"
328done</literal>
329EOF
330install -m755 convert-mans /usr/bin</userinput></screen>
331
332
333 <para>If upstream distributes the manual pages in a legacy encoding, the
334 manual pages can simply be copied to
335 <filename class="directory">/usr/share/man/<replaceable>&lt;language
336 code&gt;</replaceable></filename>. For example, <ulink
337 url="http://www.infodrom.org/projects/manpages-de/download/manpages-de-0.5.tar.gz">
338 German manual pages</ulink> can be installed with the following
339 commands:</para>
340
341<screen role="nodump"><userinput>mkdir -p /usr/share/man/de
342cp -rv man? /usr/share/man/de</userinput></screen>
343
344 <para>If upstream distributes manual pages in UTF-8 (i.e., <quote>for
345 RedHat</quote>) instead of the encoding listed in the table above, they
346 can either be converted from UTF-8 to the encoding listed in the table
347 above, or they can be installed directly into
348 <filename class="directory">/usr/share/man/<replaceable>&lt;language
349 code&gt;</replaceable>.UTF-8</filename>.</para>
350
351 <para>For example, to install <ulink
352 url="http://manpagesfr.free.fr/download/man-pages-fr-2.40.0.tar.bz2">
353 French manual pages</ulink> in the legacy encoding, use the following
354 commands:</para>
355
356<screen role="nodump"><userinput>convert-mans UTF-8 ISO-8859-1 man?/*.?
357mkdir -p /usr/share/man/fr
358cp -rv man? /usr/share/man/fr</userinput></screen>
359
360 <note><para>The French manual pages ship with ready made scripts to do the
361 same conversion. The above instructions are used only as an example for
362 use of the <command>convert-mans</command> script.</para></note>
363
364 <para>Finally, as an example installation of UTF-8 manual pages, again, the
365 French manual pages could be installed with the following commands:</para>
366
367<screen role="nodump"><userinput>mkdir -p /usr/share/man/fr.UTF-8
368cp -rv man? /usr/share/man/fr.UTF-8</userinput></screen>
369
370 </sect2>
371
372 <sect2 id="contents-man-db" role="content">
373 <title>Contents of Man-DB</title>
374
375 <segmentedlist>
376 <segtitle>Installed programs</segtitle>
377
378 <seglistitem>
379 <seg>apropos, catman, convert-mans, lexgrog, man, mandb,
380 manpath, whatis, and zsoelim</seg>
381 </seglistitem>
382 </segmentedlist>
383
384 <variablelist>
385 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
386 <?dbfo list-presentation="list"?>
387 <?dbhtml list-presentation="table"?>
388
389 <!-- <varlistentry id="accessdb">
390 <term><command>accessdb</command></term>
391 <listitem>
392 <para>Dumps the <command>whatis</command> database contents in
393 human-readable form</para>
394 <indexterm zone="ch-system-man-db accessdb">
395 <primary sortas="b-accessdb">accessdb</primary>
396 </indexterm>
397 </listitem>
398 </varlistentry> -->
399
400 <varlistentry id="apropos">
401 <term><command>apropos</command></term>
402 <listitem>
403 <para>Searches the <command>whatis</command> database and displays
404 the short descriptions of system commands that contain a given
405 string</para>
406 <indexterm zone="ch-system-man-db apropos">
407 <primary sortas="b-apropos">apropos</primary>
408 </indexterm>
409 </listitem>
410 </varlistentry>
411
412 <varlistentry id="catman">
413 <term><command>catman</command></term>
414 <listitem>
415 <para>Creates or updates the pre-formatted manual pages</para>
416 <indexterm zone="ch-system-man-db catman">
417 <primary sortas="b-catman">catman</primary>
418 </indexterm>
419 </listitem>
420 </varlistentry>
421
422 <varlistentry id="convert-mans">
423 <term><command>convert-mans</command></term>
424 <listitem>
425 <para>Reformats manual pages into the chosen encoding.</para>
426 <indexterm zone="ch-system-man-db convert-mans">
427 <primary sortas="b-convert-mans">convert-mans</primary>
428 </indexterm>
429 </listitem>
430 </varlistentry>
431
432 <varlistentry id="lexgrog">
433 <term><command>lexgrog</command></term>
434 <listitem>
435 <para>Displays one-line summary information about a given manual
436 page</para>
437 <indexterm zone="ch-system-man-db lexgrog">
438 <primary sortas="b-lexgrog">lexgrog</primary>
439 </indexterm>
440 </listitem>
441 </varlistentry>
442
443 <varlistentry id="man">
444 <term><command>man</command></term>
445 <listitem>
446 <para>Formats and displays the requested manual page</para>
447 <indexterm zone="ch-system-man-db man">
448 <primary sortas="b-man">man</primary>
449 </indexterm>
450 </listitem>
451 </varlistentry>
452
453 <varlistentry id="mandb">
454 <term><command>mandb</command></term>
455 <listitem>
456 <para>Creates or updates the <command>whatis</command> database</para>
457 <indexterm zone="ch-system-man-db mandb">
458 <primary sortas="b-mandb">mandb</primary>
459 </indexterm>
460 </listitem>
461 </varlistentry>
462
463 <varlistentry id="manpath">
464 <term><command>manpath</command></term>
465 <listitem>
466 <para>Displays the contents of $MANPATH or (if $MANPATH is not set)
467 a suitable search path based on the settings in man.conf and the
468 user's environment</para>
469 <indexterm zone="ch-system-man-db manpath">
470 <primary sortas="b-manpath">manpath</primary>
471 </indexterm>
472 </listitem>
473 </varlistentry>
474
475 <varlistentry id="whatis">
476 <term><command>whatis</command></term>
477 <listitem>
478 <para>Searches the <command>whatis</command> database and displays
479 the short descriptions of system commands that contain the given
480 keyword as a separate word</para>
481 <indexterm zone="ch-system-man-db whatis">
482 <primary sortas="b-whatis">whatis</primary>
483 </indexterm>
484 </listitem>
485 </varlistentry>
486
487 <varlistentry id="zsoelim">
488 <term><command>zsoelim</command></term>
489 <listitem>
490 <para>Reads files and replaces lines of the form <emphasis>.so
491 file</emphasis> by the contents of the mentioned
492 <emphasis>file</emphasis></para>
493 <indexterm zone="ch-system-man-db zsoelim">
494 <primary sortas="b-zsoelim">zsoelim</primary>
495 </indexterm>
496 </listitem>
497 </varlistentry>
498
499 </variablelist>
500
501 </sect2>
502
503</sect1>
Note: See TracBrowser for help on using the repository browser.