source: chapter06/man-db.xml@ 5536f74

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 5536f74 was 5536f74, checked in by Archaic <archaic@…>, 18 years ago

Applied Alexander Patrakov's patch which adds UTF-8 capability to the
development branch of the LFS Book.

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

  • Property mode set to 100644
File size: 10.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-system-man-db" role="wrap">
7<title>Man-DB-&man-db-version;</title>
8<?dbhtml filename="man-db.html"?>
9
10<indexterm zone="ch-system-man-db"><primary sortas="a-Man-DB">Man-DB</primary></indexterm>
11
12<sect2 role="package"><title/>
13<para>The Man-DB package contains programs for finding and viewing man pages.</para>
14
15<segmentedlist>
16<segtitle>&buildtime;</segtitle>
17<segtitle>&diskspace;</segtitle>
18<seglistitem><seg>0.1 SBU</seg><seg>1.1 MB</seg></seglistitem>
19</segmentedlist>
20
21<segmentedlist>
22<segtitle>&dependencies;</segtitle>
23<seglistitem><seg>Bash, Binutils, Coreutils, Gawk, GCC,
24Glibc, Gettext, GDBM, Grep, Make, and Sed</seg></seglistitem>
25</segmentedlist>
26</sect2>
27
28<sect2 role="installation">
29<title>Installation of Man-DB</title>
30
31<para>Three adjustments need to be made to the sources of Man-DB.</para>
32
33<para>The first one changes the location of translated manual pages that come
34with Man-DB, in order for them to be accessible in both traditional and
35UTF-8 locales:</para>
36
37<screen><userinput>mv man/de{_DE.88591,} &amp;&amp;
38mv man/es{_ES.88591,} &amp;&amp;
39mv man/it{_IT.88591,} &amp;&amp;
40mv man/ja{_JP.eucJP,} &amp;&amp;
41sed -i 's,\*_\*,??,' man/Makefile.in</userinput></screen>
42
43<para>The second change is a sed substitution to delete the
44<quote>/usr/man</quote> lines in the
45<filename>man_db.conf</filename> file to prevent redundant results when
46using programs such as <command>whatis</command>:</para>
47
48<screen><userinput>sed -i '/\t\/usr\/man/d' src/man_db.conf.in</userinput></screen>
49
50<para>The third change accounts for programs that Man-DB should be able
51to find at runtime, but that haven't been installed yet:</para>
52
53<screen><userinput>cat &gt;&gt;include/manconfig.h.in &lt;&lt;"EOF"
54<literal>#define WEB_BROWSER "exec /usr/bin/lynx"
55#define COL "/usr/bin/col"
56#define VGRIND "/usr/bin/vgrind"
57#define GRAP "/usr/bin/grap"</literal>
58EOF</userinput></screen>
59
60<para>The <command>col</command> program is a part of the Util-linux package,
61<command>lynx</command> is a text-based web browser
62(see BLFS for installation instructions),
63<command>vgrind</command> converts program sources to Groff input,
64and <command>grap</command> is useful for typesetting graphs in Groff documents.
65The <command>vgrind</command> and <command>grap</command> programs are
66not normally needed for viewing manual pages. They are
67not part of LFS or BLFS, but you should be able to install them yourself
68after finishing LFS if you wish to do so.</para>
69
70<para>Prepare Man-DB for compilation:</para>
71
72<screen><userinput>./configure --prefix=/usr --enable-mb-groff --disable-setuid</userinput></screen>
73
74<para>The meaning of the configure options:</para>
75
76<variablelist>
77<varlistentry>
78<term><parameter>--enable-mb-groff</parameter></term>
79<listitem><para>This tells the <command>man</command> program to
80use the "ascii8" and "nippon" Groff devices for formatting non-ISO-8859-1
81manual pages.</para></listitem>
82</varlistentry>
83<varlistentry>
84<term><parameter>--disable-setuid</parameter></term>
85<listitem><para>This disables making the <command>man</command> program
86setuid to user "man".</para></listitem>
87</varlistentry>
88</variablelist>
89
90<para>Compile the package:</para>
91
92<screen><userinput>make</userinput></screen>
93
94<para>Install the package:</para>
95
96<screen><userinput>make install</userinput></screen>
97
98<para>Additional information with regards to the compression of
99man and info pages can be found in the BLFS book at
100<ulink url="&blfs-root;view/cvs/postlfs/compressdoc.html"/>.</para>
101
102</sect2>
103
104<sect2><title>Non-English Manual Pages in LFS</title>
105
106<para>Linux distributions have different policies concerning the chracter
107encoding in which manual pages are stored on the hard disk. E.g., RedHat
108stores all manual pages in UTF-8, while Debian uses language-specific
109(mostly 8-bit) encodings. This leads to incompatibility of packages with
110manual pages designed for different distributions.</para>
111
112<para>LFS uses the same conventions as Debian. The correspondence between
113language codes and the expected encoding of manual pages is listed below.
114Man-DB automatically converts them to the locale encoding "on the fly"
115while viewing.</para>
116
117<!-- Origin: man-db-2.4.3/src/encodings.c -->
118<table frame='all'><title>Expected character encoding of manual pages</title>
119<tgroup cols='2' align='center' colsep='1' rowsep='1'>
120<thead>
121<row><entry>Language (code)</entry><entry>Encoding</entry></row>
122</thead>
123<tbody>
124<row><entry>Danish (da)</entry><entry>ISO-8859-1</entry></row>
125<row><entry>German (de)</entry><entry>ISO-8859-1</entry></row>
126<row><entry>English (en)</entry><entry>ISO-8859-1</entry></row>
127<row><entry>Spanish (es)</entry><entry>ISO-8859-1</entry></row>
128<row><entry>Finnish (fi)</entry><entry>ISO-8859-1</entry></row>
129<row><entry>French (fr)</entry><entry>ISO-8859-1</entry></row>
130<row><entry>Irish (ga)</entry><entry>ISO-8859-1</entry></row>
131<row><entry>Galician (gl)</entry><entry>ISO-8859-1</entry></row>
132<row><entry>Indonesian (id)</entry><entry>ISO-8859-1</entry></row>
133<row><entry>Icelandic (is)</entry><entry>ISO-8859-1</entry></row>
134<row><entry>Italian (it)</entry><entry>ISO-8859-1</entry></row>
135<row><entry>Dutch (nl)</entry><entry>ISO-8859-1</entry></row>
136<!-- BUG: "no" is deprecated, should use "nb" or "nn" and symlinks -->
137<row><entry>Norwegian (no)</entry><entry>ISO-8859-1</entry></row>
138<!-- END BUG -->
139<row><entry>Portuguese (pt)</entry><entry>ISO-8859-1</entry></row>
140<row><entry>Swedish (sv)</entry><entry>ISO-8859-1</entry></row>
141<!-- Languages below require patched groff -->
142<row><entry>Czech (cs)</entry><entry>ISO-8859-2</entry></row>
143<row><entry>Croatian (hr)</entry><entry>ISO-8859-2</entry></row>
144<row><entry>Hungarian (hu)</entry><entry>ISO-8859-2</entry></row>
145<row><entry>Japanese (ja)</entry><entry>EUC-JP</entry></row>
146<row><entry>Korean (ko)</entry><entry>EUC-KR</entry></row>
147<row><entry>Polish (pl)</entry><entry>ISO-8859-2</entry></row>
148<row><entry>Russian (ru)</entry><entry>KOI8-R</entry></row>
149<row><entry>Slovak (sk)</entry><entry>ISO-8859-2</entry></row>
150<row><entry>Turkish (tr)</entry><entry>ISO-8859-9</entry></row>
151</tbody>
152</tgroup>
153</table>
154
155<note><para>Manual pages in languages not in the list are not supported.
156Norwegian doesn't work now because of the transition from no_NO to nb_NO
157locale, and Korean is non-functional because of incomplete Groff patch.
158</para></note>
159
160<para>If upstream distributes the manual pages in the same encoding as
161Man-DB expects, the manual pages can be copied to
162<filename class="directory">/usr/share/man/<replaceable>[language code]</replaceable></filename>.
163E.g., French manual pages
164(<ulink url="http://ccb.club.fr/man/man-fr-1.58.0.tar.bz2"/>)
165can be installed with the following command:</para>
166
167<screen role="nodump"><userinput>mkdir -p /usr/share/man/fr &amp;&amp;
168cp -r man? /usr/share/man/fr</userinput></screen>
169
170<para>If upstream distributes manual pages in UTF-8 (i.e. "for RedHat")
171instead of the encoding listed in the table above, they have to be
172downconverted from UTF-8 to the encoding listed in the table before
173installation. E.g., Spanish manual pages
174(<ulink url="http://ditec.um.es/~piernas/manpages-es/man-pages-es-1.55.tar.bz2"/>)
175can be installed with the following commands:</para>
176
177<screen role="nodump"><userinput>mkdir -p /usr/share/man/es &amp;&amp;
178find man? -type f | \
179grep -v 'man7/iso_8859-2.7' | grep -v 'man7/iso_8859-7.7' | \
180while read F ; do
181 iconv -f UTF-8 -t ISO-8859-1 $F >tmp ; mv tmp $F
182done &amp;&amp;
183cp -r man? /usr/share/man/es</userinput></screen>
184
185<note>The need to exclude <filename>man7/iso_8859-2.7</filename>
186and <filename>man7/iso_8859-7.7</filename> files from the conversion process
187because they are already in ISO-8859-1 is a packaging bug in
188man-pages-es-1.55. Future versions should not require this kludge.</note>
189
190</sect2>
191
192<sect2 id="contents-man-db" role="content"><title>Contents of Man-DB</title>
193
194<segmentedlist>
195<segtitle>Installed programs</segtitle>
196<seglistitem><seg>accessdb, apropos, catman, lexgrog, man, mandb, manpath,
197and whatis</seg></seglistitem>
198</segmentedlist>
199
200<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
201<?dbfo list-presentation="list"?>
202<?dbhtml list-presentation="table"?>
203
204
205<varlistentry id="accessdb">
206<term><command>accessdb</command></term>
207<listitem>
208<para>Dumps the <command>whatis</command> database contents in human-readable form.</para>
209<indexterm zone="ch-system-man-db accessdb"><primary sortas="b-accessdb">accessdb</primary></indexterm>
210</listitem>
211</varlistentry>
212
213<varlistentry id="apropos">
214<term><command>apropos</command></term>
215<listitem>
216<para>Searches the <command>whatis</command> database and displays the short descriptions
217of system commands that contain a given string</para>
218<indexterm zone="ch-system-man-db apropos"><primary sortas="b-apropos">apropos</primary></indexterm>
219</listitem>
220</varlistentry>
221
222<varlistentry id="catman">
223<term><command>catman</command></term>
224<listitem>
225<para>Creates or updates the pre-formatted manual pages</para>
226<indexterm zone="ch-system-man-db catman"><primary sortas="b-catman">catman</primary></indexterm>
227</listitem>
228</varlistentry>
229
230<varlistentry id="lexgrog">
231<term><command>lexgrog</command></term>
232<listitem>
233<para>Displays one-line summary information about a given manual page.</para>
234<indexterm zone="ch-system-man-db lexgrog"><primary sortas="b-lexgrog">lexgrog</primary></indexterm>
235</listitem>
236</varlistentry>
237
238<varlistentry id="man">
239<term><command>man</command></term>
240<listitem>
241<para>Formats and displays the requested on-line man page</para>
242<indexterm zone="ch-system-man-db man"><primary sortas="b-man">man</primary></indexterm>
243</listitem>
244</varlistentry>
245
246<varlistentry id="mandb">
247<term><command>mandb</command></term>
248<listitem>
249<para>Creates or updates the <command>whatis</command> database</para>
250<indexterm zone="ch-system-man-db mandb"><primary sortas="b-mandb">mandb</primary></indexterm>
251</listitem>
252</varlistentry>
253
254<varlistentry id="whatis">
255<term><command>whatis</command></term>
256<listitem>
257<para>Searches the <command>whatis</command> database and displays the short descriptions
258of system commands that contain the given keyword as a separate
259word</para>
260<indexterm zone="ch-system-man-db whatis"><primary sortas="b-whatis">whatis</primary></indexterm>
261</listitem>
262</varlistentry>
263</variablelist>
264
265</sect2>
266
267</sect1>
268
Note: See TracBrowser for help on using the repository browser.