man-db.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  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.2 SBU</seg>
  22. <seg>9.0 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>Some packages provide UTF-8 man pages which this version of
  90. <command>man</command> is unable to display. The following script will
  91. allow some of these to be converted into the expected encodings shown in
  92. the table below. Man-DB expects the manual pages to be in the encodings
  93. in the table, and will convert them as necessary to the actual locale
  94. encoding when it displays them, so that they will display in both UTF-8
  95. and traditional locales. Because this script is intended for limited use
  96. during the system build, for public data, we will not bother with error
  97. checking, nor use a non-predictable temporary file name.</para>
  98. <screen><userinput>cat &gt;&gt;convert-mans &lt;&lt;"EOF"
  99. <literal>#!/bin/sh -e
  100. FROM="$1"
  101. TO="$2"
  102. shift ; shift
  103. while [ $# -gt 0 ]
  104. do
  105. FILE="$1"
  106. shift
  107. iconv -f "$FROM" -t "$TO" "$FILE" >.tmp.iconv
  108. mv .tmp.iconv "$FILE"
  109. done
  110. </literal>
  111. EOF
  112. install -m755 convert-mans /usr/bin</userinput></screen>
  113. <para>Additional information regarding the compression of
  114. man and info pages can be found in the BLFS book at
  115. <ulink url="&blfs-root;view/cvs/postlfs/compressdoc.html"/>.</para>
  116. </sect2>
  117. <sect2>
  118. <title>Non-English Manual Pages in LFS</title>
  119. <para>Linux distributions have different policies concerning the character
  120. encoding in which manual pages are stored in the filesystem. E.g., RedHat
  121. stores all manual pages in UTF-8, while Debian uses language-specific
  122. (mostly 8-bit) encodings. This leads to incompatibility of packages with
  123. manual pages designed for different distributions.</para>
  124. <para>LFS uses the same conventions as Debian. The relationship between
  125. language codes and the expected encoding of manual pages is listed below.
  126. Man-DB automatically converts them to the locale encoding while viewing.</para>
  127. <!-- Origin: man-db-2.4.3/src/encodings.c -->
  128. <table>
  129. <title>Expected character encoding of manual pages</title>
  130. <tgroup cols="2">
  131. <thead>
  132. <row>
  133. <entry>Language (code)</entry>
  134. <entry>Encoding</entry>
  135. </row>
  136. </thead>
  137. <tbody>
  138. <row>
  139. <entry>Danish (da)</entry>
  140. <entry>ISO-8859-1</entry>
  141. </row>
  142. <row>
  143. <entry>German (de)</entry>
  144. <entry>ISO-8859-1</entry>
  145. </row>
  146. <row>
  147. <entry>English (en)</entry>
  148. <entry>ISO-8859-1</entry>
  149. </row>
  150. <row>
  151. <entry>Spanish (es)</entry>
  152. <entry>ISO-8859-1</entry>
  153. </row>
  154. <row>
  155. <entry>Finnish (fi)</entry>
  156. <entry>ISO-8859-1</entry>
  157. </row>
  158. <row>
  159. <entry>French (fr)</entry>
  160. <entry>ISO-8859-1</entry>
  161. </row>
  162. <row>
  163. <entry>Irish (ga)</entry>
  164. <entry>ISO-8859-1</entry>
  165. </row>
  166. <row>
  167. <entry>Galician (gl)</entry>
  168. <entry>ISO-8859-1</entry>
  169. </row>
  170. <row>
  171. <entry>Indonesian (id)</entry>
  172. <entry>ISO-8859-1</entry>
  173. </row>
  174. <row>
  175. <entry>Icelandic (is)</entry>
  176. <entry>ISO-8859-1</entry>
  177. </row>
  178. <row>
  179. <entry>Italian (it)</entry>
  180. <entry>ISO-8859-1</entry>
  181. </row>
  182. <row>
  183. <entry>Dutch (nl)</entry>
  184. <entry>ISO-8859-1</entry>
  185. </row>
  186. <!-- BUG: "no" is deprecated, should use "nb" or "nn" and symlinks -->
  187. <row>
  188. <entry>Norwegian (no)</entry>
  189. <entry>ISO-8859-1</entry>
  190. </row>
  191. <!-- END BUG -->
  192. <row>
  193. <entry>Portuguese (pt)</entry>
  194. <entry>ISO-8859-1</entry>
  195. </row>
  196. <row>
  197. <entry>Swedish (sv)</entry>
  198. <entry>ISO-8859-1</entry>
  199. </row>
  200. <!-- Languages below require patched groff -->
  201. <row>
  202. <entry>Czech (cs)</entry>
  203. <entry>ISO-8859-2</entry>
  204. </row>
  205. <row>
  206. <entry>Croatian (hr)</entry>
  207. <entry>ISO-8859-2</entry>
  208. </row>
  209. <row>
  210. <entry>Hungarian (hu)</entry>
  211. <entry>ISO-8859-2</entry>
  212. </row>
  213. <row>
  214. <entry>Japanese (ja)</entry>
  215. <entry>EUC-JP</entry>
  216. </row>
  217. <row>
  218. <entry>Korean (ko)</entry>
  219. <entry>EUC-KR</entry>
  220. </row>
  221. <row>
  222. <entry>Polish (pl)</entry>
  223. <entry>ISO-8859-2</entry>
  224. </row>
  225. <row>
  226. <entry>Russian (ru)</entry>
  227. <entry>KOI8-R</entry>
  228. </row>
  229. <row>
  230. <entry>Slovak (sk)</entry>
  231. <entry>ISO-8859-2</entry>
  232. </row>
  233. <row>
  234. <entry>Turkish (tr)</entry>
  235. <entry>ISO-8859-9</entry>
  236. </row>
  237. </tbody>
  238. </tgroup>
  239. </table>
  240. <note>
  241. <para>Manual pages in languages not in the list are not supported.
  242. Norwegian doesn't work now because of the transition from no_NO to
  243. nb_NO locale, and Korean is non-functional because of the incomplete
  244. Groff patch.</para>
  245. </note>
  246. <para>If upstream distributes the manual pages in the same encoding
  247. as Man-DB expects, the manual pages can be copied to
  248. <filename class="directory">/usr/share/man/<replaceable>[language
  249. code]</replaceable></filename>. E.g., French manual pages
  250. (<ulink url="http://ccb.club.fr/man/man-fr-1.58.0.tar.bz2"/>) can be
  251. installed with the following command:</para>
  252. <screen role="nodump"><userinput>mkdir -p /usr/share/man/fr &amp;&amp;
  253. cp -rv man? /usr/share/man/fr</userinput></screen>
  254. <para>If upstream distributes manual pages in UTF-8 (i.e., <quote>for
  255. RedHat</quote>) instead of the encoding listed in the table above, they
  256. have to be converted from UTF-8 to the encoding listed in the table before
  257. installation. This can be achieved with convert-mans, e.g., Spanish manual
  258. pages (<ulink url="http://ditec.um.es/~piernas/manpages-es/man-pages-es-1.55.tar.bz2"/>)
  259. can be installed with the following commands:</para>
  260. <screen role="nodump"><userinput>mv man7/iso_8859-7.7{,X}
  261. convert-mans UTF-8 ISO-8859-1 man?/*.?
  262. mv man7/iso_8859-7.7{X,}
  263. make install</userinput></screen>
  264. <note>
  265. <para>The need to exclude the <filename>man7/iso_8859-7.7</filename> file
  266. from the conversion process because it is already in ISO-8859-1 is a
  267. packaging bug in man-pages-es-1.55. Future versions should not require
  268. this workaround.</para>
  269. </note>
  270. </sect2>
  271. <sect2 id="contents-man-db" role="content">
  272. <title>Contents of Man-DB</title>
  273. <segmentedlist>
  274. <segtitle>Installed programs</segtitle>
  275. <seglistitem>
  276. <seg>accessdb, apropos, catman, convert-mans,lexgrog, man, mandb,
  277. manpath, and whatis</seg>
  278. </seglistitem>
  279. </segmentedlist>
  280. <variablelist>
  281. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  282. <?dbfo list-presentation="list"?>
  283. <?dbhtml list-presentation="table"?>
  284. <varlistentry id="accessdb">
  285. <term><command>accessdb</command></term>
  286. <listitem>
  287. <para>Dumps the <command>whatis</command> database contents in
  288. human-readable form</para>
  289. <indexterm zone="ch-system-man-db accessdb">
  290. <primary sortas="b-accessdb">accessdb</primary>
  291. </indexterm>
  292. </listitem>
  293. </varlistentry>
  294. <varlistentry id="apropos">
  295. <term><command>apropos</command></term>
  296. <listitem>
  297. <para>Searches the <command>whatis</command> database and displays
  298. the short descriptions of system commands that contain a given
  299. string</para>
  300. <indexterm zone="ch-system-man-db apropos">
  301. <primary sortas="b-apropos">apropos</primary>
  302. </indexterm>
  303. </listitem>
  304. </varlistentry>
  305. <varlistentry id="catman">
  306. <term><command>catman</command></term>
  307. <listitem>
  308. <para>Creates or updates the pre-formatted manual pages</para>
  309. <indexterm zone="ch-system-man-db catman">
  310. <primary sortas="b-catman">catman</primary>
  311. </indexterm>
  312. </listitem>
  313. </varlistentry>
  314. <varlistentry id="convert-mans">
  315. <term><command>convert-mans</command></term>
  316. <listitem>
  317. <para>Reformat man pages so that Man-DB can display them</para>
  318. <indexterm zone="ch-system-man-db convert-mans">
  319. <primary sortas="b-convert-mans">convert-mans</primary>
  320. </indexterm>
  321. </listitem>
  322. </varlistentry>
  323. <varlistentry id="lexgrog">
  324. <term><command>lexgrog</command></term>
  325. <listitem>
  326. <para>Displays one-line summary information about a given manual
  327. page</para>
  328. <indexterm zone="ch-system-man-db lexgrog">
  329. <primary sortas="b-lexgrog">lexgrog</primary>
  330. </indexterm>
  331. </listitem>
  332. </varlistentry>
  333. <varlistentry id="man">
  334. <term><command>man</command></term>
  335. <listitem>
  336. <para>Formats and displays the requested manual page</para>
  337. <indexterm zone="ch-system-man-db man">
  338. <primary sortas="b-man">man</primary>
  339. </indexterm>
  340. </listitem>
  341. </varlistentry>
  342. <varlistentry id="mandb">
  343. <term><command>mandb</command></term>
  344. <listitem>
  345. <para>Creates or updates the <command>whatis</command> database</para>
  346. <indexterm zone="ch-system-man-db mandb">
  347. <primary sortas="b-mandb">mandb</primary>
  348. </indexterm>
  349. </listitem>
  350. </varlistentry>
  351. <varlistentry id="whatis">
  352. <term><command>whatis</command></term>
  353. <listitem>
  354. <para>Searches the <command>whatis</command> database and displays
  355. the short descriptions of system commands that contain the given
  356. keyword as a separate word</para>
  357. <indexterm zone="ch-system-man-db whatis">
  358. <primary sortas="b-whatis">whatis</primary>
  359. </indexterm>
  360. </listitem>
  361. </varlistentry>
  362. </variablelist>
  363. </sect2>
  364. </sect1>