man-db.xml 13 KB

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