source: chapter06/man-db.xml@ 4c0c012

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.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 4c0c012 was 4c0c012, checked in by Bruce Dubbs <bdubbs@…>, 15 years ago

Reformatted several pages so pdf is properly generated.

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

  • Property mode set to 100644
File size: 19.1 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 <?dbfo keep-together="auto" ?>
155<title>Expected character encoding of legacy 8-bit manual pages</title>
156 <?dbfo keep-together="auto" ?>
157 <?dbfo table-width="6in" ?>
158
159 <tgroup cols="4">
160
161 <colspec colnum="1" colwidth="1.5in"/>
162 <colspec colnum="2" colwidth="1in"/>
163 <colspec colnum="3" colwidth="2.5in"/>
164 <colspec colnum="4" colwidth="1in"/>
165
166 <thead>
167 <row>
168 <entry>Language (code)</entry>
169 <entry>Encoding</entry>
170 <entry>Language (code)</entry>
171 <entry>Encoding</entry>
172 </row>
173 </thead>
174
175 <tbody>
176 <row>
177 <entry>Danish (da)</entry>
178 <entry>ISO-8859-1</entry>
179 <entry>Bulgarian (bg)</entry>
180 <entry>CP1251</entry>
181 </row>
182 <row>
183 <entry>German (de)</entry>
184 <entry>ISO-8859-1</entry>
185 <entry>Czech (cs)</entry>
186 <entry>ISO-8859-2</entry>
187 </row>
188 <row>
189 <entry>English (en)</entry>
190 <entry>ISO-8859-1</entry>
191 <entry>Croatian (hr)</entry>
192 <entry>ISO-8859-2</entry>
193 </row>
194 <row>
195 <entry>Spanish (es)</entry>
196 <entry>ISO-8859-1</entry>
197 <entry>Hungarian (hu)</entry>
198 <entry>ISO-8859-2</entry>
199 </row>
200 <row>
201 <entry>Finnish (fi)</entry>
202 <entry>ISO-8859-1</entry>
203 <entry>Japanese (ja)</entry>
204 <entry>EUC-JP</entry>
205 </row>
206 <row>
207 <entry>French (fr)</entry>
208 <entry>ISO-8859-1</entry>
209 <entry>Korean (ko)</entry>
210 <entry>EUC-KR</entry>
211 </row>
212 <row>
213 <entry>Irish (ga)</entry>
214 <entry>ISO-8859-1</entry>
215 <entry>Polish (pl)</entry>
216 <entry>ISO-8859-2</entry>
217 </row>
218 <row>
219 <entry>Galician (gl)</entry>
220 <entry>ISO-8859-1</entry>
221 <entry>Russian (ru)</entry>
222 <entry>KOI8-R</entry>
223 </row>
224 <row>
225 <entry>Indonesian (id)</entry>
226 <entry>ISO-8859-1</entry>
227 <entry>Slovak (sk)</entry>
228 <entry>ISO-8859-2</entry>
229 </row>
230 <row>
231 <entry>Icelandic (is)</entry>
232 <entry>ISO-8859-1</entry>
233 <entry>Serbian (sr)</entry>
234 <entry>ISO-8859-5</entry>
235 </row>
236 <row>
237 <entry>Italian (it)</entry>
238 <entry>ISO-8859-1</entry>
239 <entry>Turkish (tr)</entry>
240 <entry>ISO-8859-9</entry>
241 </row>
242 <row>
243 <entry>Dutch (nl)</entry>
244 <entry>ISO-8859-1</entry>
245 <entry>Simplified Chinese (zh_CN)</entry>
246 <entry>GBK</entry>
247 </row>
248 <!-- FIXME: BUG: "no" is deprecated, should use "nb" or "nn" and
249 symlinks -->
250 <row>
251 <entry>Norwegian (no)</entry>
252 <entry>ISO-8859-1</entry>
253 <entry>Simplified Chinese, Singapore (zh_SG)</entry>
254 <entry>GBK</entry>
255 </row>
256 <!-- END BUG -->
257 <row>
258 <entry>Portuguese (pt)</entry>
259 <entry>ISO-8859-1</entry>
260 <entry>Traditional Chinese (zh_TW)</entry>
261 <entry>BIG5</entry>
262 </row>
263 <row>
264 <entry>Swedish (sv)</entry>
265 <entry>ISO-8859-1</entry>
266 <entry>Traditional Chinese, Hong Kong (zh_HK)</entry>
267 <entry>BIG5HKSCS</entry>
268 </row>
269
270 <!-- Languages below require patched groff -->
271 <!--
272 <row>
273 <entry>Bulgarian (bg)</entry>
274 <entry>CP1251</entry>
275 </row>
276 <row>
277 <entry>Czech (cs)</entry>
278 <entry>ISO-8859-2</entry>
279 </row>
280 <row>
281 <entry>Croatian (hr)</entry>
282 <entry>ISO-8859-2</entry>
283 </row>
284 <row>
285 <entry>Hungarian (hu)</entry>
286 <entry>ISO-8859-2</entry>
287 </row>
288 <row>
289 <entry>Japanese (ja)</entry>
290 <entry>EUC-JP</entry>
291 </row>
292 <row>
293 <entry>Korean (ko)</entry>
294 <entry>EUC-KR</entry>
295 </row>
296 <row>
297 <entry>Polish (pl)</entry>
298 <entry>ISO-8859-2</entry>
299 </row>
300 <row>
301 <entry>Russian (ru)</entry>
302 <entry>KOI8-R</entry>
303 </row>
304 <row>
305 <entry>Slovak (sk)</entry>
306 <entry>ISO-8859-2</entry>
307 </row>
308 <row>
309 <entry>Serbian (sr)</entry>
310 <entry>ISO-8859-5</entry>
311 </row>
312 <row>
313 <entry>Turkish (tr)</entry>
314 <entry>ISO-8859-9</entry>
315 </row>
316 <row>
317 <entry>Simplified Chinese (zh_CN)</entry>
318 <entry>GBK</entry>
319 </row>
320 <row>
321 <entry>Simplified Chinese, Singapore (zh_SG)</entry>
322 <entry>GBK</entry>
323 </row>
324 <row>
325 <entry>Traditional Chinese (zh_TW)</entry>
326 <entry>BIG5</entry>
327 </row>
328 <row>
329 <entry>Traditional Chinese, Hong Kong (zh_HK)</entry>
330 <entry>BIG5HKSCS</entry>
331 </row>-->
332 </tbody>
333
334 </tgroup>
335
336 </table>
337
338 <note>
339 <para>Manual pages in languages not in the list are not supported.
340 Norwegian does not work because of the transition from no_NO to
341 nb_NO locale, and will be fixed in the next release of
342 <application>Man-DB</application>. Korean is currently non functional
343 because of incomplete fixes in the Debian
344 <application>Groff</application> patch applied in LFS.</para>
345 </note>
346
347 <para>Packages may install manual pages into an improperly named directory,
348 depending on which distributions the author develops the package for. To
349 assist in the conversion of the manual pages to the proper encoding for the
350 directory in which they are installed, the <command>convert-mans</command>
351 script was written. It will convert manual pages to another encoding before
352 (or after) installation. Install the <command>convert-mans</command>
353 script with the following instructions:</para>
354
355<screen><userinput remap="install">cat &gt;&gt; convert-mans &lt;&lt; "EOF"
356<literal>#!/bin/sh -e
357FROM="$1"
358TO="$2"
359shift ; shift
360while [ $# -gt 0 ]
361do
362 FILE="$1"
363 shift
364 iconv -f "$FROM" -t "$TO" "$FILE" >.tmp.iconv
365 mv .tmp.iconv "$FILE"
366done</literal>
367EOF
368install -v -m755 convert-mans /usr/bin</userinput></screen>
369
370
371 <para>If upstream distributes the manual pages in a legacy encoding, the
372 manual pages can simply be copied to
373 <filename class="directory">/usr/share/man/<replaceable>&lt;language
374 code&gt;</replaceable></filename>. For example, <ulink
375 url="http://www.infodrom.org/projects/manpages-de/download/manpages-de-0.5.tar.gz">
376 German manual pages</ulink> can be installed with the following
377 commands:</para>
378
379<screen role="nodump"><userinput>mkdir -p /usr/share/man/de
380cp -rv man? /usr/share/man/de</userinput></screen>
381
382 <para>If upstream distributes manual pages in UTF-8 (i.e., <quote>for
383 RedHat</quote>) instead of the encoding listed in the table above, they
384 can either be converted from UTF-8 to the encoding listed in the table
385 above, or they can be installed directly into
386 <filename class="directory">/usr/share/man/<replaceable>&lt;language
387 code&gt;</replaceable>.UTF-8</filename>.</para>
388
389 <para>For example, to install <ulink
390 url="http://manpagesfr.free.fr/download/man-pages-fr-2.40.0.tar.bz2">
391 French manual pages</ulink> in the legacy encoding, use the following
392 commands:</para>
393
394<screen role="nodump"><userinput>convert-mans UTF-8 ISO-8859-1 man?/*.?
395mkdir -p /usr/share/man/fr
396cp -rv man? /usr/share/man/fr</userinput></screen>
397
398 <note><para>The French manual pages ship with ready made scripts to do the
399 same conversion. The above instructions are used only as an example for
400 use of the <command>convert-mans</command> script.</para></note>
401
402 <para>Finally, as an example installation of UTF-8 manual pages, again, the
403 French manual pages could be installed with the following commands:</para>
404
405<screen role="nodump"><userinput>mkdir -p /usr/share/man/fr.UTF-8
406cp -rv man? /usr/share/man/fr.UTF-8</userinput></screen>
407
408 </sect2>
409
410 <sect2 id="contents-man-db" role="content">
411 <title>Contents of Man-DB</title>
412
413 <segmentedlist>
414 <segtitle>Installed programs</segtitle>
415
416 <seglistitem>
417 <seg>apropos, catman, convert-mans, lexgrog, man, mandb,
418 manpath, whatis, and zsoelim</seg>
419 </seglistitem>
420 </segmentedlist>
421
422 <variablelist>
423 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
424 <?dbfo list-presentation="list"?>
425 <?dbhtml list-presentation="table"?>
426
427 <!-- <varlistentry id="accessdb">
428 <term><command>accessdb</command></term>
429 <listitem>
430 <para>Dumps the <command>whatis</command> database contents in
431 human-readable form</para>
432 <indexterm zone="ch-system-man-db accessdb">
433 <primary sortas="b-accessdb">accessdb</primary>
434 </indexterm>
435 </listitem>
436 </varlistentry> -->
437
438 <varlistentry id="apropos">
439 <term><command>apropos</command></term>
440 <listitem>
441 <para>Searches the <command>whatis</command> database and displays
442 the short descriptions of system commands that contain a given
443 string</para>
444 <indexterm zone="ch-system-man-db apropos">
445 <primary sortas="b-apropos">apropos</primary>
446 </indexterm>
447 </listitem>
448 </varlistentry>
449
450 <varlistentry id="catman">
451 <term><command>catman</command></term>
452 <listitem>
453 <para>Creates or updates the pre-formatted manual pages</para>
454 <indexterm zone="ch-system-man-db catman">
455 <primary sortas="b-catman">catman</primary>
456 </indexterm>
457 </listitem>
458 </varlistentry>
459
460 <varlistentry id="convert-mans">
461 <term><command>convert-mans</command></term>
462 <listitem>
463 <para>Reformats manual pages into the chosen encoding.</para>
464 <indexterm zone="ch-system-man-db convert-mans">
465 <primary sortas="b-convert-mans">convert-mans</primary>
466 </indexterm>
467 </listitem>
468 </varlistentry>
469
470 <varlistentry id="lexgrog">
471 <term><command>lexgrog</command></term>
472 <listitem>
473 <para>Displays one-line summary information about a given manual
474 page</para>
475 <indexterm zone="ch-system-man-db lexgrog">
476 <primary sortas="b-lexgrog">lexgrog</primary>
477 </indexterm>
478 </listitem>
479 </varlistentry>
480
481 <varlistentry id="man">
482 <term><command>man</command></term>
483 <listitem>
484 <para>Formats and displays the requested manual page</para>
485 <indexterm zone="ch-system-man-db man">
486 <primary sortas="b-man">man</primary>
487 </indexterm>
488 </listitem>
489 </varlistentry>
490
491 <varlistentry id="mandb">
492 <term><command>mandb</command></term>
493 <listitem>
494 <para>Creates or updates the <command>whatis</command> database</para>
495 <indexterm zone="ch-system-man-db mandb">
496 <primary sortas="b-mandb">mandb</primary>
497 </indexterm>
498 </listitem>
499 </varlistentry>
500
501 <varlistentry id="manpath">
502 <term><command>manpath</command></term>
503 <listitem>
504 <para>Displays the contents of $MANPATH or (if $MANPATH is not set)
505 a suitable search path based on the settings in man.conf and the
506 user's environment</para>
507 <indexterm zone="ch-system-man-db manpath">
508 <primary sortas="b-manpath">manpath</primary>
509 </indexterm>
510 </listitem>
511 </varlistentry>
512
513 <varlistentry id="whatis">
514 <term><command>whatis</command></term>
515 <listitem>
516 <para>Searches the <command>whatis</command> database and displays
517 the short descriptions of system commands that contain the given
518 keyword as a separate word</para>
519 <indexterm zone="ch-system-man-db whatis">
520 <primary sortas="b-whatis">whatis</primary>
521 </indexterm>
522 </listitem>
523 </varlistentry>
524
525 <varlistentry id="zsoelim">
526 <term><command>zsoelim</command></term>
527 <listitem>
528 <para>Reads files and replaces lines of the form <emphasis>.so
529 file</emphasis> by the contents of the mentioned
530 <emphasis>file</emphasis></para>
531 <indexterm zone="ch-system-man-db zsoelim">
532 <primary sortas="b-zsoelim">zsoelim</primary>
533 </indexterm>
534 </listitem>
535 </varlistentry>
536
537 </variablelist>
538
539 </sect2>
540
541</sect1>
Note: See TracBrowser for help on using the repository browser.