man-db.xml 16 KB

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