man-db.xml 14 KB

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