man-db.xml 16 KB

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