man-db.xml 15 KB

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