source: chapter06/man-db.xml@ c569ab7

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

Updated to Man-DB-2.5.0. Fixes #2109.

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

  • Property mode set to 100644
File size: 15.3 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<screen><userinput remap="pre">sed -i -e '\%\t/usr/man%d' -e '\%\t/usr/local/man%d' src/man_db.conf.in</userinput></screen>
52
53 <para>The second change accounts for programs that Man-DB should be able
54 to find at runtime, but that haven't been installed yet:</para>
55
56<screen><userinput remap="pre">cat &gt;&gt; include/manconfig.h.in &lt;&lt; "EOF"
57<literal>#define WEB_BROWSER "exec /usr/bin/lynx"
58#define COL "/usr/bin/col"
59#define VGRIND "/usr/bin/vgrind"
60#define GRAP "/usr/bin/grap"</literal>
61EOF</userinput></screen>
62
63 <para>The <command>col</command> program is a part of the Util-linux
64 package, <command>lynx</command> is a text-based web browser (see BLFS
65 for installation instructions), <command>vgrind</command> converts
66 program sources to Groff input, and <command>grap</command> is useful
67 for typesetting graphs in Groff documents. The <command>vgrind</command>
68 and <command>grap</command> programs are not normally needed for viewing
69 manual pages. They are not part of LFS or BLFS, but you should be able
70 to install them yourself after finishing LFS if you wish to do so.</para>
71
72 <para>Prepare Man-DB for compilation:</para>
73
74<screen><userinput remap="configure">./configure --prefix=/usr --enable-mb-groff --disable-setuid</userinput></screen>
75
76 <variablelist>
77 <title>The meaning of the configure options:</title>
78
79 <varlistentry>
80 <term><parameter>--enable-mb-groff</parameter></term>
81 <listitem>
82 <para>This tells the <command>man</command> program to use the
83 <quote>ascii8</quote> and <quote>nippon</quote> Groff devices for
84 formatting non-ISO-8859-1 manual pages.</para>
85 </listitem>
86 </varlistentry>
87
88 <varlistentry>
89 <term><parameter>--disable-setuid</parameter></term>
90 <listitem>
91 <para>This disables making the <command>man</command> program setuid
92 to user <systemitem class="username">man</systemitem>.</para>
93 </listitem>
94 </varlistentry>
95
96 </variablelist>
97
98 <para>Compile the package:</para>
99
100<screen><userinput remap="make">make</userinput></screen>
101
102 <para>This package does not come with a test suite.</para>
103
104 <para>Install the package:</para>
105
106<screen><userinput remap="install">make install</userinput></screen>
107
108 <para>Some packages provide UTF-8 man pages which this version of
109 <command>man</command> is unable to display. The following script will
110 allow some of these to be converted into the expected encodings shown in
111 the table below. Man-DB expects the manual pages to be in the encodings
112 in the table, and will convert them as necessary to the actual locale
113 encoding when it displays them, so that they will display in both UTF-8
114 and traditional locales. Because this script is intended for limited use
115 during the system build, for public data, we will not bother with error
116 checking, nor use a non-predictable temporary file name:</para>
117
118<screen><userinput remap="install">cat &gt;&gt; convert-mans &lt;&lt; "EOF"
119<literal>#!/bin/sh -e
120FROM="$1"
121TO="$2"
122shift ; shift
123while [ $# -gt 0 ]
124do
125 FILE="$1"
126 shift
127 iconv -f "$FROM" -t "$TO" "$FILE" >.tmp.iconv
128 mv .tmp.iconv "$FILE"
129done</literal>
130EOF
131install -m755 convert-mans /usr/bin</userinput></screen>
132
133 <para>Additional information regarding the compression of
134 man and info pages can be found in the BLFS book at
135 <ulink url="&blfs-root;view/cvs/postlfs/compressdoc.html"/>.</para>
136
137 </sect2>
138
139 <sect2>
140 <title>Non-English Manual Pages in LFS</title>
141
142 <para>Linux distributions have different policies concerning the character
143 encoding in which manual pages are stored in the filesystem. E.g., RedHat
144 stores all manual pages in UTF-8, while Debian uses language-specific
145 (mostly 8-bit) encodings. This leads to incompatibility of packages with
146 manual pages designed for different distributions.</para>
147
148 <para>LFS uses the same conventions as Debian. This was chosen because
149 Man-DB does not understand man pages stored in UTF-8. And, for our
150 purposes, Man-DB is preferable to Man as it works without extra
151 configuration in any locale. Lastly, as of now, there is no fully-working
152 implementation of the RedHat convention. RedHat's <command>groff</command>
153 is known to misformat text.</para>
154
155 <para>The relationship between language codes and the expected encoding
156 of manual pages is listed below. Man-DB automatically converts them to
157 the locale encoding while viewing.</para>
158
159 <!-- Origin: man-db-2.4.3/src/encodings.c -->
160 <table>
161 <title>Expected character encoding of manual pages</title>
162 <?dbfo table-width="2.5in" ?>
163
164 <tgroup cols="2">
165
166 <colspec colnum="1" colwidth="1.5in"/>
167 <colspec colnum="2" colwidth="1in"/>
168
169 <thead>
170 <row>
171 <entry>Language (code)</entry>
172 <entry>Encoding</entry>
173 </row>
174 </thead>
175
176 <tbody>
177 <row>
178 <entry>Danish (da)</entry>
179 <entry>ISO-8859-1</entry>
180 </row>
181 <row>
182 <entry>German (de)</entry>
183 <entry>ISO-8859-1</entry>
184 </row>
185 <row>
186 <entry>English (en)</entry>
187 <entry>ISO-8859-1</entry>
188 </row>
189 <row>
190 <entry>Spanish (es)</entry>
191 <entry>ISO-8859-1</entry>
192 </row>
193 <row>
194 <entry>Finnish (fi)</entry>
195 <entry>ISO-8859-1</entry>
196 </row>
197 <row>
198 <entry>French (fr)</entry>
199 <entry>ISO-8859-1</entry>
200 </row>
201 <row>
202 <entry>Irish (ga)</entry>
203 <entry>ISO-8859-1</entry>
204 </row>
205 <row>
206 <entry>Galician (gl)</entry>
207 <entry>ISO-8859-1</entry>
208 </row>
209 <row>
210 <entry>Indonesian (id)</entry>
211 <entry>ISO-8859-1</entry>
212 </row>
213 <row>
214 <entry>Icelandic (is)</entry>
215 <entry>ISO-8859-1</entry>
216 </row>
217 <row>
218 <entry>Italian (it)</entry>
219 <entry>ISO-8859-1</entry>
220 </row>
221 <row>
222 <entry>Dutch (nl)</entry>
223 <entry>ISO-8859-1</entry>
224 </row>
225 <!-- FIXME: BUG: "no" is deprecated, should use "nb" or "nn" and
226 symlinks -->
227 <row>
228 <entry>Norwegian (no)</entry>
229 <entry>ISO-8859-1</entry>
230 </row>
231 <!-- END BUG -->
232 <row>
233 <entry>Portuguese (pt)</entry>
234 <entry>ISO-8859-1</entry>
235 </row>
236 <row>
237 <entry>Swedish (sv)</entry>
238 <entry>ISO-8859-1</entry>
239 </row>
240 <!-- Languages below require patched groff -->
241 <row>
242 <entry>Czech (cs)</entry>
243 <entry>ISO-8859-2</entry>
244 </row>
245 <row>
246 <entry>Croatian (hr)</entry>
247 <entry>ISO-8859-2</entry>
248 </row>
249 <row>
250 <entry>Hungarian (hu)</entry>
251 <entry>ISO-8859-2</entry>
252 </row>
253 <row>
254 <entry>Japanese (ja)</entry>
255 <entry>EUC-JP</entry>
256 </row>
257 <row>
258 <entry>Korean (ko)</entry>
259 <entry>EUC-KR</entry>
260 </row>
261 <row>
262 <entry>Polish (pl)</entry>
263 <entry>ISO-8859-2</entry>
264 </row>
265 <row>
266 <entry>Russian (ru)</entry>
267 <entry>KOI8-R</entry>
268 </row>
269 <row>
270 <entry>Slovak (sk)</entry>
271 <entry>ISO-8859-2</entry>
272 </row>
273 <row>
274 <entry>Turkish (tr)</entry>
275 <entry>ISO-8859-9</entry>
276 </row>
277 </tbody>
278
279 </tgroup>
280
281 </table>
282
283 <note>
284 <para>Manual pages in languages not in the list are not supported.
285 Norwegian doesn't work now because of the transition from no_NO to
286 nb_NO locale, and Korean is non-functional because of the incomplete
287 Groff patch.</para>
288 </note>
289
290 <para>If upstream distributes the manual pages in the same encoding
291 as Man-DB expects, the manual pages can be copied to
292 <filename class="directory">/usr/share/man/<replaceable>&lt;language
293 code&gt;</replaceable></filename>. E.g., French manual pages
294 (<ulink url="http://ccb.club.fr/man/man-fr-1.58.0.tar.bz2"/>) can be
295 installed with the following command:</para>
296
297<screen role="nodump"><userinput>mkdir -p /usr/share/man/fr
298cp -rv man? /usr/share/man/fr</userinput></screen>
299
300 <para>If upstream distributes manual pages in UTF-8 (i.e., <quote>for
301 RedHat</quote>) instead of the encoding listed in the table above, they
302 have to be converted from UTF-8 to the encoding listed in the table before
303 installation. This can be achieved with <command>convert-mans</command>,
304 e.g., Spanish manual pages (<ulink
305 url="http://ditec.um.es/~piernas/manpages-es/man-pages-es-1.55.tar.bz2"/>)
306 can be installed with the following commands:</para>
307
308<screen role="nodump"><userinput>mv man7/iso_8859-7.7{,X}
309convert-mans UTF-8 ISO-8859-1 man?/*.?
310mv man7/iso_8859-7.7{X,}
311make install</userinput></screen>
312
313 <note>
314 <para>The need to exclude the <filename>man7/iso_8859-7.7</filename> file
315 from the conversion process because it is already in ISO-8859-1 is a
316 packaging bug in man-pages-es-1.55. Future versions should not require
317 this workaround.</para>
318 </note>
319
320 </sect2>
321
322 <sect2 id="contents-man-db" role="content">
323 <title>Contents of Man-DB</title>
324
325 <segmentedlist>
326 <segtitle>Installed programs</segtitle>
327
328 <seglistitem>
329 <seg>accessdb, apropos, catman, convert-mans, lexgrog, man, mandb,
330 manpath, whatis, and zsoelim</seg>
331 </seglistitem>
332 </segmentedlist>
333
334 <variablelist>
335 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
336 <?dbfo list-presentation="list"?>
337 <?dbhtml list-presentation="table"?>
338
339 <varlistentry id="accessdb">
340 <term><command>accessdb</command></term>
341 <listitem>
342 <para>Dumps the <command>whatis</command> database contents in
343 human-readable form</para>
344 <indexterm zone="ch-system-man-db accessdb">
345 <primary sortas="b-accessdb">accessdb</primary>
346 </indexterm>
347 </listitem>
348 </varlistentry>
349
350 <varlistentry id="apropos">
351 <term><command>apropos</command></term>
352 <listitem>
353 <para>Searches the <command>whatis</command> database and displays
354 the short descriptions of system commands that contain a given
355 string</para>
356 <indexterm zone="ch-system-man-db apropos">
357 <primary sortas="b-apropos">apropos</primary>
358 </indexterm>
359 </listitem>
360 </varlistentry>
361
362 <varlistentry id="catman">
363 <term><command>catman</command></term>
364 <listitem>
365 <para>Creates or updates the pre-formatted manual pages</para>
366 <indexterm zone="ch-system-man-db catman">
367 <primary sortas="b-catman">catman</primary>
368 </indexterm>
369 </listitem>
370 </varlistentry>
371
372 <varlistentry id="convert-mans">
373 <term><command>convert-mans</command></term>
374 <listitem>
375 <para>Reformat man pages so that Man-DB can display them</para>
376 <indexterm zone="ch-system-man-db convert-mans">
377 <primary sortas="b-convert-mans">convert-mans</primary>
378 </indexterm>
379 </listitem>
380 </varlistentry>
381
382 <varlistentry id="lexgrog">
383 <term><command>lexgrog</command></term>
384 <listitem>
385 <para>Displays one-line summary information about a given manual
386 page</para>
387 <indexterm zone="ch-system-man-db lexgrog">
388 <primary sortas="b-lexgrog">lexgrog</primary>
389 </indexterm>
390 </listitem>
391 </varlistentry>
392
393 <varlistentry id="man">
394 <term><command>man</command></term>
395 <listitem>
396 <para>Formats and displays the requested manual page</para>
397 <indexterm zone="ch-system-man-db man">
398 <primary sortas="b-man">man</primary>
399 </indexterm>
400 </listitem>
401 </varlistentry>
402
403 <varlistentry id="mandb">
404 <term><command>mandb</command></term>
405 <listitem>
406 <para>Creates or updates the <command>whatis</command> database</para>
407 <indexterm zone="ch-system-man-db mandb">
408 <primary sortas="b-mandb">mandb</primary>
409 </indexterm>
410 </listitem>
411 </varlistentry>
412
413 <varlistentry id="manpath">
414 <term><command>manpath</command></term>
415 <listitem>
416 <para>Displays the contents of $MANPATH or (if $MANPATH is not set)
417 a suitable search path based on the settings in man.conf and the
418 user's environment</para>
419 <indexterm zone="ch-system-man-db manpath">
420 <primary sortas="b-manpath">manpath</primary>
421 </indexterm>
422 </listitem>
423 </varlistentry>
424
425 <varlistentry id="whatis">
426 <term><command>whatis</command></term>
427 <listitem>
428 <para>Searches the <command>whatis</command> database and displays
429 the short descriptions of system commands that contain the given
430 keyword as a separate word</para>
431 <indexterm zone="ch-system-man-db whatis">
432 <primary sortas="b-whatis">whatis</primary>
433 </indexterm>
434 </listitem>
435 </varlistentry>
436
437 <varlistentry id="zsoelim">
438 <term><command>zsoelim</command></term>
439 <listitem>
440 <para>Reads files and replaces lines of the form <emphasis>.so
441 file</emphasis> by the contents of the mentioned
442 <emphasis>file</emphasis></para>
443 <indexterm zone="ch-system-man-db zsoelim">
444 <primary sortas="b-zsoelim">zsoelim</primary>
445 </indexterm>
446 </listitem>
447 </varlistentry>
448
449 </variablelist>
450
451 </sect2>
452
453</sect1>
Note: See TracBrowser for help on using the repository browser.