man-db.xml 15 KB

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