source: chapter06/man-db.xml@ 77e2988

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

Minor changes for consistent pdf generation

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

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