source: chapter06/man-db.xml@ 7f89db8

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

Updated Man-DB text to account for recent Man-DB development. Many thanks to Alexander Patrakov for patientely guiding me through this.

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

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