man-db.xml 10 KB

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