source: chapter06/man-db.xml@ 9afdb62

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 9afdb62 was 9afdb62, checked in by Matthew Burgess <matthew@…>, 15 years ago

Upgrade to Groff-1.20.1. Fixes #2322.

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

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