source: chapter06/man-db.xml@ 862c5ae

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

Updated text and instructions on man-db page.

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

  • Property mode set to 100644
File size: 17.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 <para>Some packages provide UTF-8 manual pages, which previous versions of
115 <application>Man-DB</application> were unable to display. This limitation
116 has been fixed in recent versions, and <application>Man-DB</application>
117 can now convert manual pages from legacy encodings to UTF-8
118 (and vice-versa) on the fly. This used to be a rather annoying
119 problem across different distributions, as packages written for one
120 distribution would require changes to work on another. The following
121 script will allow you to convert manual pages to and from legacy and UTF-8
122 encodings.</para>
123
124<screen><userinput remap="install">cat &gt;&gt; convert-mans &lt;&lt; "EOF"
125<literal>#!/bin/sh -e
126FROM="$1"
127TO="$2"
128shift ; shift
129while [ $# -gt 0 ]
130do
131 FILE="$1"
132 shift
133 iconv -f "$FROM" -t "$TO" "$FILE" >.tmp.iconv
134 mv .tmp.iconv "$FILE"
135done</literal>
136EOF
137install -m755 convert-mans /usr/bin</userinput></screen>
138
139 <para>Additional information regarding the compression of
140 man and info pages can be found in the BLFS book at
141 <ulink url="&blfs-root;view/cvs/postlfs/compressdoc.html"/>.</para>
142
143 </sect2>
144
145 <sect2>
146 <title>Non-English Manual Pages in LFS</title>
147
148 <para>Linux distributions have different policies concerning the character
149 encoding in which manual pages are stored in the filesystem. E.g., RedHat
150 stores all manual pages in UTF-8, while Debian previously used
151 language-specific (mostly 8-bit) encodings. As mentioned above, this leads
152 to incompatibility of packages with manual pages designed for different
153 distributions.</para>
154
155 <para>LFS previously used the same convention as Debian. This was chosen
156 because <application>Man-DB</application> did not understand manual pages
157 stored in UTF-8 at the time of its introduction into LFS. For our purposes
158 at that time, <application>Man-DB</application> was preferable to
159 <application>Man</application> as it worked without any additional
160 configuration in any locale. This is still true today as
161 <application>Man-DB</application> with Debian patched
162 <application>Groff</application> will now dynamically convert UTF-8 encoded
163 manual pages to the user's locale. Additionally, this combination provides
164 support for Chinese and Japanese locales, and limited support for Korean,
165 whereas <application>Man</application> does not. The current offering of
166 <application>Man</application> as used in RedHat requires major
167 modifications to both the <application>Man</application> and
168 <application>Groff</application> packages, and still falls short on
169 Chinese, Japanese, and Korean encodings.</para>
170
171 <para>Finally, most distributions, including Debian, are rapidly migrating
172 to all UTF-8 encoded manual pages. Upstream packagers will very likely drop
173 legacy encodings in favor of UTF-8, though adoption has been slow due to
174 the hacks required to make the current <application>Man</application> and
175 <application>Groff</application> packages work correctly together.</para>
176
177 <para>The relationship between language codes and the expected encoding
178 of legacy manual pages is listed below.</para>
179
180 <!-- Origin: man-db-2.5.2/src/encodings.c -->
181 <table>
182 <title>Expected character encoding of legacy 8-bit manual pages</title>
183 <?dbfo table-width="2.5in" ?>
184
185 <tgroup cols="2">
186
187 <colspec colnum="1" colwidth="1.5in"/>
188 <colspec colnum="2" colwidth="1in"/>
189
190 <thead>
191 <row>
192 <entry>Language (code)</entry>
193 <entry>Encoding</entry>
194 </row>
195 </thead>
196
197 <tbody>
198 <row>
199 <entry>Danish (da)</entry>
200 <entry>ISO-8859-1</entry>
201 </row>
202 <row>
203 <entry>German (de)</entry>
204 <entry>ISO-8859-1</entry>
205 </row>
206 <row>
207 <entry>English (en)</entry>
208 <entry>ISO-8859-1</entry>
209 </row>
210 <row>
211 <entry>Spanish (es)</entry>
212 <entry>ISO-8859-1</entry>
213 </row>
214 <row>
215 <entry>Finnish (fi)</entry>
216 <entry>ISO-8859-1</entry>
217 </row>
218 <row>
219 <entry>French (fr)</entry>
220 <entry>ISO-8859-1</entry>
221 </row>
222 <row>
223 <entry>Irish (ga)</entry>
224 <entry>ISO-8859-1</entry>
225 </row>
226 <row>
227 <entry>Galician (gl)</entry>
228 <entry>ISO-8859-1</entry>
229 </row>
230 <row>
231 <entry>Indonesian (id)</entry>
232 <entry>ISO-8859-1</entry>
233 </row>
234 <row>
235 <entry>Icelandic (is)</entry>
236 <entry>ISO-8859-1</entry>
237 </row>
238 <row>
239 <entry>Italian (it)</entry>
240 <entry>ISO-8859-1</entry>
241 </row>
242 <row>
243 <entry>Dutch (nl)</entry>
244 <entry>ISO-8859-1</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 </row>
252 <!-- END BUG -->
253 <row>
254 <entry>Portuguese (pt)</entry>
255 <entry>ISO-8859-1</entry>
256 </row>
257 <row>
258 <entry>Swedish (sv)</entry>
259 <entry>ISO-8859-1</entry>
260 </row>
261 <!-- Languages below require patched groff -->
262 <row>
263 <entry>Bulgarian (bg)</entry>
264 <entry>CP1251</entry>
265 </row>
266 <row>
267 <entry>Czech (cs)</entry>
268 <entry>ISO-8859-2</entry>
269 </row>
270 <row>
271 <entry>Croatian (hr)</entry>
272 <entry>ISO-8859-2</entry>
273 </row>
274 <row>
275 <entry>Hungarian (hu)</entry>
276 <entry>ISO-8859-2</entry>
277 </row>
278 <row>
279 <entry>Japanese (ja)</entry>
280 <entry>EUC-JP</entry>
281 </row>
282 <row>
283 <entry>Korean (ko)</entry>
284 <entry>EUC-KR</entry>
285 </row>
286 <row>
287 <entry>Polish (pl)</entry>
288 <entry>ISO-8859-2</entry>
289 </row>
290 <row>
291 <entry>Russian (ru)</entry>
292 <entry>KOI8-R</entry>
293 </row>
294 <row>
295 <entry>Slovak (sk)</entry>
296 <entry>ISO-8859-2</entry>
297 </row>
298 <row>
299 <entry>Serbian (sr)</entry>
300 <entry>ISO-8859-5</entry>
301 </row>
302 <row>
303 <entry>Turkish (tr)</entry>
304 <entry>ISO-8859-9</entry>
305 </row>
306 <row>
307 <entry>Simplified Chinese (zh_CN)</entry>
308 <entry>GBK</entry>
309 </row>
310 <row>
311 <entry>Simplified Chinese,Singapore} (zh_SG)</entry>
312 <entry>GBK</entry>
313 </row>
314 <row>
315 <entry>Traditional Chinese (zh_TW)</entry>
316 <entry>BIG5</entry>
317 </row>
318 <row>
319 <entry>Traditional Chinese, Hong Kong (zh_HK)</entry>
320 <entry>BIG5HKSCS</entry>
321 </row>
322 </tbody>
323
324 </tgroup>
325
326 </table>
327
328 <note>
329 <para>Manual pages in languages not in the list are not supported.
330 Norwegian does not work because of the transition from no_NO to
331 nb_NO locale, and will be fixed in the next release of
332 <application>Man-DB</application>. Korean is currently non functional
333 because of incomplete fixes in the Groff patch.</para>
334 </note>
335
336
337 <para>If upstream distributes the manual pages in a legacy encoding,
338 the manual pages can simply be copied to
339 <filename class="directory">/usr/share/man/<replaceable>&lt;language
340 code&gt;</replaceable></filename>. For example, <ulink
341 url="http://www.infodrom.org/projects/manpages-de/download/manpages-de-0.5.tar.gz">
342 German manual pages</ulink> can be installed with the following
343 commands:</para>
344
345<screen role="nodump"><userinput>mkdir -p /usr/share/man/de
346cp -rv man? /usr/share/man/de</userinput></screen>
347
348 <para>If upstream distributes manual pages in UTF-8 (i.e., <quote>for
349 RedHat</quote>) instead of the encoding listed in the table above, they
350 can either be converted from UTF-8 to the encoding listed in the table
351 above, or they can be installed directly into
352 <filename class="directory">/usr/share/man/<replaceable>&lt;language
353 code&gt;</replaceable>.UTF-8</filename>.</para>
354
355 <para>For example, to install <ulink
356 url="http://ditec.um.es/~piernas/manpages-es/man-pages-es-1.55.tar.bz2">
357 Spanish manual pages</ulink> in the legacy encoding, use the following
358 commands:</para>
359
360<screen role="nodump"><userinput>mv man7/iso_8859-7.7{,X}
361convert-mans UTF-8 ISO-8859-1 man?/*.?
362mv man7/iso_8859-7.7{X,}
363make install</userinput></screen>
364
365 <note>
366 <para>The <filename>man7/iso_8859-7.7</filename> file needs to be
367 exclueded from the conversion process because it is already in
368 ISO-8859-1 format. This is a packaging bug in man-pages-es-1.55.
369 Future versions should not require this workaround.</para>
370 </note>
371
372 <para>Finally, as an example installation of UTF-8 manual pages, the <ulink
373 url="http://manpagesfr.free.fr/download/man-pages-fr-2.40.0.tar.bz2">
374 French manual pages</ulink> can be installed with the following
375 commands:</para>
376
377<screen role="nodump"><userinput>mkdir -p /usr/share/man/fr.UTF-8
378cp -rv man? /usr/share/man/fr.UTF-8</userinput></screen>
379
380 </sect2>
381
382 <sect2 id="contents-man-db" role="content">
383 <title>Contents of Man-DB</title>
384
385 <segmentedlist>
386 <segtitle>Installed programs</segtitle>
387
388 <seglistitem>
389 <seg>apropos, catman, convert-mans, lexgrog, man, mandb,
390 manpath, whatis, and zsoelim</seg>
391 </seglistitem>
392 </segmentedlist>
393
394 <variablelist>
395 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
396 <?dbfo list-presentation="list"?>
397 <?dbhtml list-presentation="table"?>
398
399 <!-- <varlistentry id="accessdb">
400 <term><command>accessdb</command></term>
401 <listitem>
402 <para>Dumps the <command>whatis</command> database contents in
403 human-readable form</para>
404 <indexterm zone="ch-system-man-db accessdb">
405 <primary sortas="b-accessdb">accessdb</primary>
406 </indexterm>
407 </listitem>
408 </varlistentry> -->
409
410 <varlistentry id="apropos">
411 <term><command>apropos</command></term>
412 <listitem>
413 <para>Searches the <command>whatis</command> database and displays
414 the short descriptions of system commands that contain a given
415 string</para>
416 <indexterm zone="ch-system-man-db apropos">
417 <primary sortas="b-apropos">apropos</primary>
418 </indexterm>
419 </listitem>
420 </varlistentry>
421
422 <varlistentry id="catman">
423 <term><command>catman</command></term>
424 <listitem>
425 <para>Creates or updates the pre-formatted manual pages</para>
426 <indexterm zone="ch-system-man-db catman">
427 <primary sortas="b-catman">catman</primary>
428 </indexterm>
429 </listitem>
430 </varlistentry>
431
432 <varlistentry id="convert-mans">
433 <term><command>convert-mans</command></term>
434 <listitem>
435 <para>Reformats manual pages into the chosen encoding.</para>
436 <indexterm zone="ch-system-man-db convert-mans">
437 <primary sortas="b-convert-mans">convert-mans</primary>
438 </indexterm>
439 </listitem>
440 </varlistentry>
441
442 <varlistentry id="lexgrog">
443 <term><command>lexgrog</command></term>
444 <listitem>
445 <para>Displays one-line summary information about a given manual
446 page</para>
447 <indexterm zone="ch-system-man-db lexgrog">
448 <primary sortas="b-lexgrog">lexgrog</primary>
449 </indexterm>
450 </listitem>
451 </varlistentry>
452
453 <varlistentry id="man">
454 <term><command>man</command></term>
455 <listitem>
456 <para>Formats and displays the requested manual page</para>
457 <indexterm zone="ch-system-man-db man">
458 <primary sortas="b-man">man</primary>
459 </indexterm>
460 </listitem>
461 </varlistentry>
462
463 <varlistentry id="mandb">
464 <term><command>mandb</command></term>
465 <listitem>
466 <para>Creates or updates the <command>whatis</command> database</para>
467 <indexterm zone="ch-system-man-db mandb">
468 <primary sortas="b-mandb">mandb</primary>
469 </indexterm>
470 </listitem>
471 </varlistentry>
472
473 <varlistentry id="manpath">
474 <term><command>manpath</command></term>
475 <listitem>
476 <para>Displays the contents of $MANPATH or (if $MANPATH is not set)
477 a suitable search path based on the settings in man.conf and the
478 user's environment</para>
479 <indexterm zone="ch-system-man-db manpath">
480 <primary sortas="b-manpath">manpath</primary>
481 </indexterm>
482 </listitem>
483 </varlistentry>
484
485 <varlistentry id="whatis">
486 <term><command>whatis</command></term>
487 <listitem>
488 <para>Searches the <command>whatis</command> database and displays
489 the short descriptions of system commands that contain the given
490 keyword as a separate word</para>
491 <indexterm zone="ch-system-man-db whatis">
492 <primary sortas="b-whatis">whatis</primary>
493 </indexterm>
494 </listitem>
495 </varlistentry>
496
497 <varlistentry id="zsoelim">
498 <term><command>zsoelim</command></term>
499 <listitem>
500 <para>Reads files and replaces lines of the form <emphasis>.so
501 file</emphasis> by the contents of the mentioned
502 <emphasis>file</emphasis></para>
503 <indexterm zone="ch-system-man-db zsoelim">
504 <primary sortas="b-zsoelim">zsoelim</primary>
505 </indexterm>
506 </listitem>
507 </varlistentry>
508
509 </variablelist>
510
511 </sect2>
512
513</sect1>
Note: See TracBrowser for help on using the repository browser.