source: chapter06/man-db.xml@ 1652151

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.3 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 1652151 was 1652151, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Fixes for PDF output.

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

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