man-db.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/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>&man-db-ch6-sbu;</seg>
  22. <seg>&man-db-ch6-du;</seg>
  23. </seglistitem>
  24. </segmentedlist>
  25. </sect2>
  26. <sect2 role="installation">
  27. <title>Installation of Man-DB</title>
  28. <para>Three adjustments need to be made to the sources of Man-DB.</para>
  29. <para>The first one changes the location of translated manual pages that come
  30. with Man-DB, in order for them to be accessible in both traditional and
  31. UTF-8 locales:</para>
  32. <screen><userinput>mv man/de{_DE.88591,} &amp;&amp;
  33. mv man/es{_ES.88591,} &amp;&amp;
  34. mv man/it{_IT.88591,} &amp;&amp;
  35. mv man/ja{_JP.eucJP,} &amp;&amp;
  36. sed -i 's,\*_\*,??,' man/Makefile.in</userinput></screen>
  37. <para>The second change is a <command>sed</command> substitution to delete
  38. the <quote>/usr/man</quote> and <quote>/usr/local/man</quote> lines in
  39. the <filename>man_db.conf</filename> file to prevent redundant results
  40. when using programs such as <command>whatis</command>:</para>
  41. <screen><userinput>sed -i -e '\%\t/usr/man%d' -e '\%\t/usr/local/man%d' src/man_db.conf.in</userinput></screen>
  42. <para>The third change accounts for programs that Man-DB should be able
  43. to find at runtime, but that haven't been installed yet:</para>
  44. <screen><userinput>cat &gt;&gt; include/manconfig.h.in &lt;&lt; "EOF"
  45. <literal>#define WEB_BROWSER "exec /usr/bin/lynx"
  46. #define COL "/usr/bin/col"
  47. #define VGRIND "/usr/bin/vgrind"
  48. #define GRAP "/usr/bin/grap"</literal>
  49. EOF</userinput></screen>
  50. <para>The <command>col</command> program is a part of the Util-linux
  51. package, <command>lynx</command> is a text-based web browser (see BLFS
  52. for installation instructions), <command>vgrind</command> converts
  53. program sources to Groff input, and <command>grap</command> is useful
  54. for typesetting graphs in Groff documents. The <command>vgrind</command>
  55. and <command>grap</command> programs are not normally needed for viewing
  56. manual pages. They are not part of LFS or BLFS, but you should be able
  57. to install them yourself after finishing LFS if you wish to do so.</para>
  58. <para>Prepare Man-DB for compilation:</para>
  59. <screen><userinput>./configure --prefix=/usr --enable-mb-groff --disable-setuid</userinput></screen>
  60. <variablelist>
  61. <title>The meaning of the configure options:</title>
  62. <varlistentry>
  63. <term><parameter>--enable-mb-groff</parameter></term>
  64. <listitem>
  65. <para>This tells the <command>man</command> program to use the
  66. <quote>ascii8</quote> and <quote>nippon</quote> Groff devices for
  67. formatting non-ISO-8859-1 manual pages.</para>
  68. </listitem>
  69. </varlistentry>
  70. <varlistentry>
  71. <term><parameter>--disable-setuid</parameter></term>
  72. <listitem>
  73. <para>This disables making the <command>man</command> program setuid
  74. to user <systemitem class="username">man</systemitem>.</para>
  75. </listitem>
  76. </varlistentry>
  77. </variablelist>
  78. <para>Compile the package:</para>
  79. <screen><userinput>make</userinput></screen>
  80. <para>This package does not come with a test suite.</para>
  81. <para>Install the package:</para>
  82. <screen><userinput>make install</userinput></screen>
  83. <para>Some packages provide UTF-8 man pages which this version of
  84. <command>man</command> is unable to display. The following script will
  85. allow some of these to be converted into the expected encodings shown in
  86. the table below. Man-DB expects the manual pages to be in the encodings
  87. in the table, and will convert them as necessary to the actual locale
  88. encoding when it displays them, so that they will display in both UTF-8
  89. and traditional locales. Because this script is intended for limited use
  90. during the system build, for public data, we will not bother with error
  91. checking, nor use a non-predictable temporary file name.</para>
  92. <screen><userinput>cat &gt;&gt; convert-mans &lt;&lt; "EOF"
  93. <literal>#!/bin/sh -e
  94. FROM="$1"
  95. TO="$2"
  96. shift ; shift
  97. while [ $# -gt 0 ]
  98. do
  99. FILE="$1"
  100. shift
  101. iconv -f "$FROM" -t "$TO" "$FILE" >.tmp.iconv
  102. mv .tmp.iconv "$FILE"
  103. done</literal>
  104. EOF
  105. install -m755 convert-mans /usr/bin</userinput></screen>
  106. <para>Additional information regarding the compression of
  107. man and info pages can be found in the BLFS book at
  108. <ulink url="&blfs-root;view/cvs/postlfs/compressdoc.html"/>.</para>
  109. </sect2>
  110. <sect2>
  111. <title>Non-English Manual Pages in LFS</title>
  112. <para>Linux distributions have different policies concerning the character
  113. encoding in which manual pages are stored in the filesystem. E.g., RedHat
  114. stores all manual pages in UTF-8, while Debian uses language-specific
  115. (mostly 8-bit) encodings. This leads to incompatibility of packages with
  116. manual pages designed for different distributions.</para>
  117. <para>LFS uses the same conventions as Debian. This was chosen because
  118. Man-DB does not understand man pages stored in UTF-8. And, for our
  119. purposes, Man-DB is preferable to Man as it works without extra
  120. configuration in any locale. Lastly, as of now, there is no fully-working
  121. implementation of the RedHat convention. RedHat's <command>groff</command>
  122. is known to misformat text.</para>
  123. <para>The relationship between language codes and the expected encoding
  124. of manual pages is listed below. Man-DB automatically converts them to
  125. the locale encoding while viewing.</para>
  126. <!-- Origin: man-db-2.4.3/src/encodings.c -->
  127. <table>
  128. <title>Expected character encoding of manual pages</title>
  129. <?dbfo table-width="50%" ?>
  130. <tgroup cols="2" align="center">
  131. <colspec colnum="1" colwidth="2in"/>
  132. <colspec colnum="2" colwidth="2in"/>
  133. <thead>
  134. <row>
  135. <entry>Language (code)</entry>
  136. <entry>Encoding</entry>
  137. </row>
  138. </thead>
  139. <tbody>
  140. <row>
  141. <entry>Danish (da)</entry>
  142. <entry>ISO-8859-1</entry>
  143. </row>
  144. <row>
  145. <entry>German (de)</entry>
  146. <entry>ISO-8859-1</entry>
  147. </row>
  148. <row>
  149. <entry>English (en)</entry>
  150. <entry>ISO-8859-1</entry>
  151. </row>
  152. <row>
  153. <entry>Spanish (es)</entry>
  154. <entry>ISO-8859-1</entry>
  155. </row>
  156. <row>
  157. <entry>Finnish (fi)</entry>
  158. <entry>ISO-8859-1</entry>
  159. </row>
  160. <row>
  161. <entry>French (fr)</entry>
  162. <entry>ISO-8859-1</entry>
  163. </row>
  164. <row>
  165. <entry>Irish (ga)</entry>
  166. <entry>ISO-8859-1</entry>
  167. </row>
  168. <row>
  169. <entry>Galician (gl)</entry>
  170. <entry>ISO-8859-1</entry>
  171. </row>
  172. <row>
  173. <entry>Indonesian (id)</entry>
  174. <entry>ISO-8859-1</entry>
  175. </row>
  176. <row>
  177. <entry>Icelandic (is)</entry>
  178. <entry>ISO-8859-1</entry>
  179. </row>
  180. <row>
  181. <entry>Italian (it)</entry>
  182. <entry>ISO-8859-1</entry>
  183. </row>
  184. <row>
  185. <entry>Dutch (nl)</entry>
  186. <entry>ISO-8859-1</entry>
  187. </row>
  188. <!-- FIXME: BUG: "no" is deprecated, should use "nb" or "nn" and
  189. symlinks -->
  190. <row>
  191. <entry>Norwegian (no)</entry>
  192. <entry>ISO-8859-1</entry>
  193. </row>
  194. <!-- END BUG -->
  195. <row>
  196. <entry>Portuguese (pt)</entry>
  197. <entry>ISO-8859-1</entry>
  198. </row>
  199. <row>
  200. <entry>Swedish (sv)</entry>
  201. <entry>ISO-8859-1</entry>
  202. </row>
  203. <!-- Languages below require patched groff -->
  204. <row>
  205. <entry>Czech (cs)</entry>
  206. <entry>ISO-8859-2</entry>
  207. </row>
  208. <row>
  209. <entry>Croatian (hr)</entry>
  210. <entry>ISO-8859-2</entry>
  211. </row>
  212. <row>
  213. <entry>Hungarian (hu)</entry>
  214. <entry>ISO-8859-2</entry>
  215. </row>
  216. <row>
  217. <entry>Japanese (ja)</entry>
  218. <entry>EUC-JP</entry>
  219. </row>
  220. <row>
  221. <entry>Korean (ko)</entry>
  222. <entry>EUC-KR</entry>
  223. </row>
  224. <row>
  225. <entry>Polish (pl)</entry>
  226. <entry>ISO-8859-2</entry>
  227. </row>
  228. <row>
  229. <entry>Russian (ru)</entry>
  230. <entry>KOI8-R</entry>
  231. </row>
  232. <row>
  233. <entry>Slovak (sk)</entry>
  234. <entry>ISO-8859-2</entry>
  235. </row>
  236. <row>
  237. <entry>Turkish (tr)</entry>
  238. <entry>ISO-8859-9</entry>
  239. </row>
  240. </tbody>
  241. </tgroup>
  242. </table>
  243. <note>
  244. <para>Manual pages in languages not in the list are not supported.
  245. Norwegian doesn't work now because of the transition from no_NO to
  246. nb_NO locale, and Korean is non-functional because of the incomplete
  247. Groff patch.</para>
  248. </note>
  249. <para>If upstream distributes the manual pages in the same encoding
  250. as Man-DB expects, the manual pages can be copied to
  251. <filename class="directory">/usr/share/man/<replaceable>&lt;language
  252. code&gt;</replaceable></filename>. E.g., French manual pages
  253. (<ulink url="http://ccb.club.fr/man/man-fr-1.58.0.tar.bz2"/>) can be
  254. installed with the following command:</para>
  255. <screen role="nodump"><userinput>mkdir -p /usr/share/man/fr &amp;&amp;
  256. cp -rv man? /usr/share/man/fr</userinput></screen>
  257. <para>If upstream distributes manual pages in UTF-8 (i.e., <quote>for
  258. RedHat</quote>) instead of the encoding listed in the table above, they
  259. have to be converted from UTF-8 to the encoding listed in the table before
  260. installation. This can be achieved with <command>convert-mans</command>,
  261. e.g., Spanish manual pages (<ulink
  262. url="http://ditec.um.es/~piernas/manpages-es/man-pages-es-1.55.tar.bz2"/>)
  263. can be installed with the following commands:</para>
  264. <screen role="nodump"><userinput>mv man7/iso_8859-7.7{,X}
  265. convert-mans UTF-8 ISO-8859-1 man?/*.?
  266. mv man7/iso_8859-7.7{X,}
  267. make install</userinput></screen>
  268. <note>
  269. <para>The need to exclude the <filename>man7/iso_8859-7.7</filename> file
  270. from the conversion process because it is already in ISO-8859-1 is a
  271. packaging bug in man-pages-es-1.55. Future versions should not require
  272. this workaround.</para>
  273. </note>
  274. </sect2>
  275. <sect2 id="contents-man-db" role="content">
  276. <title>Contents of Man-DB</title>
  277. <segmentedlist>
  278. <segtitle>Installed programs</segtitle>
  279. <seglistitem>
  280. <seg>accessdb, apropos, catman, convert-mans,lexgrog, man, mandb,
  281. manpath, whatis, and zsoelim</seg>
  282. </seglistitem>
  283. </segmentedlist>
  284. <variablelist>
  285. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  286. <?dbfo list-presentation="list"?>
  287. <?dbhtml list-presentation="table"?>
  288. <varlistentry id="accessdb">
  289. <term><command>accessdb</command></term>
  290. <listitem>
  291. <para>Dumps the <command>whatis</command> database contents in
  292. human-readable form</para>
  293. <indexterm zone="ch-system-man-db accessdb">
  294. <primary sortas="b-accessdb">accessdb</primary>
  295. </indexterm>
  296. </listitem>
  297. </varlistentry>
  298. <varlistentry id="apropos">
  299. <term><command>apropos</command></term>
  300. <listitem>
  301. <para>Searches the <command>whatis</command> database and displays
  302. the short descriptions of system commands that contain a given
  303. string</para>
  304. <indexterm zone="ch-system-man-db apropos">
  305. <primary sortas="b-apropos">apropos</primary>
  306. </indexterm>
  307. </listitem>
  308. </varlistentry>
  309. <varlistentry id="catman">
  310. <term><command>catman</command></term>
  311. <listitem>
  312. <para>Creates or updates the pre-formatted manual pages</para>
  313. <indexterm zone="ch-system-man-db catman">
  314. <primary sortas="b-catman">catman</primary>
  315. </indexterm>
  316. </listitem>
  317. </varlistentry>
  318. <varlistentry id="convert-mans">
  319. <term><command>convert-mans</command></term>
  320. <listitem>
  321. <para>Reformat man pages so that Man-DB can display them</para>
  322. <indexterm zone="ch-system-man-db convert-mans">
  323. <primary sortas="b-convert-mans">convert-mans</primary>
  324. </indexterm>
  325. </listitem>
  326. </varlistentry>
  327. <varlistentry id="lexgrog">
  328. <term><command>lexgrog</command></term>
  329. <listitem>
  330. <para>Displays one-line summary information about a given manual
  331. page</para>
  332. <indexterm zone="ch-system-man-db lexgrog">
  333. <primary sortas="b-lexgrog">lexgrog</primary>
  334. </indexterm>
  335. </listitem>
  336. </varlistentry>
  337. <varlistentry id="man">
  338. <term><command>man</command></term>
  339. <listitem>
  340. <para>Formats and displays the requested manual page</para>
  341. <indexterm zone="ch-system-man-db man">
  342. <primary sortas="b-man">man</primary>
  343. </indexterm>
  344. </listitem>
  345. </varlistentry>
  346. <varlistentry id="mandb">
  347. <term><command>mandb</command></term>
  348. <listitem>
  349. <para>Creates or updates the <command>whatis</command> database</para>
  350. <indexterm zone="ch-system-man-db mandb">
  351. <primary sortas="b-mandb">mandb</primary>
  352. </indexterm>
  353. </listitem>
  354. </varlistentry>
  355. <varlistentry id="manpath">
  356. <term><command>manpath</command></term>
  357. <listitem>
  358. <para>Displays the contents of $MANPATH or (if $MANPATH is not set)
  359. a suitable search path based on the settings in man.conf and the
  360. user's environment</para>
  361. <indexterm zone="ch-system-man-db manpath">
  362. <primary sortas="b-manpath">manpath</primary>
  363. </indexterm>
  364. </listitem>
  365. </varlistentry>
  366. <varlistentry id="whatis">
  367. <term><command>whatis</command></term>
  368. <listitem>
  369. <para>Searches the <command>whatis</command> database and displays
  370. the short descriptions of system commands that contain the given
  371. keyword as a separate word</para>
  372. <indexterm zone="ch-system-man-db whatis">
  373. <primary sortas="b-whatis">whatis</primary>
  374. </indexterm>
  375. </listitem>
  376. </varlistentry>
  377. <varlistentry id="zsoelim">
  378. <term><command>zsoelim</command></term>
  379. <listitem>
  380. <para>Reads files and replaces lines of the form <emphasis>.so
  381. file</emphasis> by the contents of the mentioned
  382. <emphasis>file</emphasis></para>
  383. <indexterm zone="ch-system-man-db zsoelim">
  384. <primary sortas="b-zsoelim">zsoelim</primary>
  385. </indexterm>
  386. </listitem>
  387. </varlistentry>
  388. </variablelist>
  389. </sect2>
  390. </sect1>