man-db.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  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>LFS creates <filename>/usr/man</filename> and
  34. <filename>/usr/local/man</filename> as symlinks. Remove them from the
  35. <filename>man_db.conf</filename> file to prevent redundant
  36. results when using programs such as <command>whatis</command>:</para>
  37. <screen><userinput remap="pre">sed -i -e '\%\t/usr/man%d' -e '\%\t/usr/local/man%d' src/man_db.conf.in</userinput></screen>
  38. <para>Prepare Man-DB for compilation:</para>
  39. <screen><userinput remap="configure">./configure --prefix=/usr --libexecdir=/usr/lib \
  40. --sysconfdir=/etc --disable-setuid \
  41. --with-browser=/usr/bin/lynx --with-col=/usr/bin/col \
  42. --with-vgrind=/usr/bin/vgrind --with-grap=/usr/bin/grap</userinput></screen>
  43. <variablelist>
  44. <title>The meaning of the configure options:</title>
  45. <varlistentry>
  46. <term><parameter>--disable-setuid</parameter></term>
  47. <listitem>
  48. <para>This disables making the <command>man</command> program setuid
  49. to user <systemitem class="username">man</systemitem>.</para>
  50. </listitem>
  51. </varlistentry>
  52. <varlistentry>
  53. <term><parameter>--with-...</parameter></term>
  54. <listitem>
  55. <para>These four parameters are used to set some default programs.
  56. The <command>col</command> program is a part of the Util-linux-ng
  57. package, <command>lynx</command> is a text-based web browser (see
  58. BLFS for installation instructions), <command>vgrind</command>
  59. converts program sources to Groff input, and <command>grap</command>
  60. is useful for typesetting graphs in Groff documents. The
  61. <command>vgrind</command> and <command>grap</command> programs are
  62. not normally needed for viewing manual pages. They are not part of
  63. LFS or BLFS, but you should be able to install them yourself after
  64. finishing LFS if you wish to do so.</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. </sect2>
  74. <sect2>
  75. <title>Non-English Manual Pages in LFS</title>
  76. <para>Some packages provide non-English manual pages. They are displayed
  77. correctly only if their location and encoding matches the expectation of
  78. the "man" program. However, different Linux distributions have different
  79. policies (expressed in the choice of the <command>man</command> program,
  80. its configuration and patches applied to it) concerning the character
  81. encoding in which manual pages are stored in the filesystem.</para>
  82. <para>E.g., Debian previously required Russian manual pages to be encoded
  83. in KOI8-R and to be placed in
  84. <filename class="directory">/usr/share/man/ru</filename>. Now, in addition,
  85. their <command>man</command> program (<application>Man-DB</application>)
  86. searches for UTF-8 encoded Russian manual pages in
  87. <filename class="directory">/usr/share/man/ru.UTF-8</filename>. On the
  88. other hand, Fedora uses UTF-8 encoded manual pages exclusively. Russian
  89. manual pages are found in
  90. <filename class="directory">/usr/share/man/ru</filename> and their
  91. <command>man</command> program doesn't acknowledge
  92. <filename class="directory">/usr/share/man/ru.UTF-8</filename>. Many
  93. other distributions ignore the on disk encodings completely, leaving the
  94. end user with a mix of improperly encoded manual pages for their
  95. configuration. When <command>man</command> processes the requtested page,
  96. it will display the contents as configured, resulting in completely
  97. unreadable text if the on disk encoding is not what is expected for that
  98. configuration.</para>
  99. <para>Disagreement about the expected encoding of manual pages amongst
  100. distribution vendors, has led to confusion for upstream package
  101. maintainers. One package may contain UTF-8 manual pages, while another
  102. ships with manual pages in legacy encodings. <command>man</command>
  103. searches for manual pages based on the user's locale settings.
  104. <application>Man-DB</application> uses a built-in table (see below) to
  105. determine the on disk encoding of manual pages found for a user's
  106. locale, only if the directories found do not have an extension that
  107. describes the encoding. E.g., because of ".UTF-8" in the directory name,
  108. <application>Man-DB</application> knows that all manual pages residing in
  109. <filename class="directory">/usr/share/man/fr.UTF-8</filename> are UTF-8
  110. encoded and, according to the built-in table, expects all manual pages
  111. residing in <filename class="directory">/usr/share/man/ru</filename> to
  112. be encoded using KOI8-R.</para>
  113. <!-- Origin: man-db-2.5.2/src/encodings.c -->
  114. <table>
  115. <title>Expected character encoding of legacy 8-bit manual pages</title>
  116. <?dbfo table-width="6in" ?>
  117. <tgroup cols="4">
  118. <colspec colnum="1" colwidth="1.5in"/>
  119. <colspec colnum="2" colwidth="1in"/>
  120. <colspec colnum="3" colwidth="2.5in"/>
  121. <colspec colnum="4" colwidth="1in"/>
  122. <thead>
  123. <row>
  124. <entry>Language (code)</entry>
  125. <entry>Encoding</entry>
  126. <entry>Language (code)</entry>
  127. <entry>Encoding</entry>
  128. </row>
  129. </thead>
  130. <tbody>
  131. <row>
  132. <entry>Danish (da)</entry>
  133. <entry>ISO-8859-1</entry>
  134. <entry>Bulgarian (bg)</entry>
  135. <entry>CP1251</entry>
  136. </row>
  137. <row>
  138. <entry>German (de)</entry>
  139. <entry>ISO-8859-1</entry>
  140. <entry>Czech (cs)</entry>
  141. <entry>ISO-8859-2</entry>
  142. </row>
  143. <row>
  144. <entry>English (en)</entry>
  145. <entry>ISO-8859-1</entry>
  146. <entry>Croatian (hr)</entry>
  147. <entry>ISO-8859-2</entry>
  148. </row>
  149. <row>
  150. <entry>Spanish (es)</entry>
  151. <entry>ISO-8859-1</entry>
  152. <entry>Hungarian (hu)</entry>
  153. <entry>ISO-8859-2</entry>
  154. </row>
  155. <row>
  156. <entry>Finnish (fi)</entry>
  157. <entry>ISO-8859-1</entry>
  158. <entry>Japanese (ja)</entry>
  159. <entry>EUC-JP</entry>
  160. </row>
  161. <row>
  162. <entry>French (fr)</entry>
  163. <entry>ISO-8859-1</entry>
  164. <entry>Korean (ko)</entry>
  165. <entry>EUC-KR</entry>
  166. </row>
  167. <row>
  168. <entry>Irish (ga)</entry>
  169. <entry>ISO-8859-1</entry>
  170. <entry>Polish (pl)</entry>
  171. <entry>ISO-8859-2</entry>
  172. </row>
  173. <row>
  174. <entry>Galician (gl)</entry>
  175. <entry>ISO-8859-1</entry>
  176. <entry>Russian (ru)</entry>
  177. <entry>KOI8-R</entry>
  178. </row>
  179. <row>
  180. <entry>Indonesian (id)</entry>
  181. <entry>ISO-8859-1</entry>
  182. <entry>Slovak (sk)</entry>
  183. <entry>ISO-8859-2</entry>
  184. </row>
  185. <row>
  186. <entry>Icelandic (is)</entry>
  187. <entry>ISO-8859-1</entry>
  188. <entry>Serbian (sr)</entry>
  189. <entry>ISO-8859-5</entry>
  190. </row>
  191. <row>
  192. <entry>Italian (it)</entry>
  193. <entry>ISO-8859-1</entry>
  194. <entry>Turkish (tr)</entry>
  195. <entry>ISO-8859-9</entry>
  196. </row>
  197. <row>
  198. <entry>Dutch (nl)</entry>
  199. <entry>ISO-8859-1</entry>
  200. <entry>Simplified Chinese (zh_CN)</entry>
  201. <entry>GBK</entry>
  202. </row>
  203. <!-- FIXME: BUG: "no" is deprecated, should use "nb" or "nn" and
  204. symlinks -->
  205. <row>
  206. <entry>Norwegian (no)</entry>
  207. <entry>ISO-8859-1</entry>
  208. <entry>Simplified Chinese, Singapore (zh_SG)</entry>
  209. <entry>GBK</entry>
  210. </row>
  211. <!-- END BUG -->
  212. <row>
  213. <entry>Portuguese (pt)</entry>
  214. <entry>ISO-8859-1</entry>
  215. <entry>Traditional Chinese (zh_TW)</entry>
  216. <entry>BIG5</entry>
  217. </row>
  218. <row>
  219. <entry>Swedish (sv)</entry>
  220. <entry>ISO-8859-1</entry>
  221. <entry>Traditional Chinese, Hong Kong (zh_HK)</entry>
  222. <entry>BIG5HKSCS</entry>
  223. </row>
  224. <!-- Languages below require patched groff -->
  225. <!--
  226. <row>
  227. <entry>Bulgarian (bg)</entry>
  228. <entry>CP1251</entry>
  229. </row>
  230. <row>
  231. <entry>Czech (cs)</entry>
  232. <entry>ISO-8859-2</entry>
  233. </row>
  234. <row>
  235. <entry>Croatian (hr)</entry>
  236. <entry>ISO-8859-2</entry>
  237. </row>
  238. <row>
  239. <entry>Hungarian (hu)</entry>
  240. <entry>ISO-8859-2</entry>
  241. </row>
  242. <row>
  243. <entry>Japanese (ja)</entry>
  244. <entry>EUC-JP</entry>
  245. </row>
  246. <row>
  247. <entry>Korean (ko)</entry>
  248. <entry>EUC-KR</entry>
  249. </row>
  250. <row>
  251. <entry>Polish (pl)</entry>
  252. <entry>ISO-8859-2</entry>
  253. </row>
  254. <row>
  255. <entry>Russian (ru)</entry>
  256. <entry>KOI8-R</entry>
  257. </row>
  258. <row>
  259. <entry>Slovak (sk)</entry>
  260. <entry>ISO-8859-2</entry>
  261. </row>
  262. <row>
  263. <entry>Serbian (sr)</entry>
  264. <entry>ISO-8859-5</entry>
  265. </row>
  266. <row>
  267. <entry>Turkish (tr)</entry>
  268. <entry>ISO-8859-9</entry>
  269. </row>
  270. <row>
  271. <entry>Simplified Chinese (zh_CN)</entry>
  272. <entry>GBK</entry>
  273. </row>
  274. <row>
  275. <entry>Simplified Chinese, Singapore (zh_SG)</entry>
  276. <entry>GBK</entry>
  277. </row>
  278. <row>
  279. <entry>Traditional Chinese (zh_TW)</entry>
  280. <entry>BIG5</entry>
  281. </row>
  282. <row>
  283. <entry>Traditional Chinese, Hong Kong (zh_HK)</entry>
  284. <entry>BIG5HKSCS</entry>
  285. </row>-->
  286. </tbody>
  287. </tgroup>
  288. </table>
  289. <note>
  290. <para>Manual pages in languages not in the list are not supported.
  291. Norwegian does not work because of the transition from no_NO to
  292. nb_NO locale, and will be fixed in the next release of
  293. <application>Man-DB</application>. Korean is currently non functional
  294. because of incomplete fixes in the Debian
  295. <application>Groff</application> patch applied in LFS.</para>
  296. </note>
  297. <para>Packages may install manual pages into an improperly named directory,
  298. depending on which distributions the author develops the package for. To
  299. assist in the conversion of the manual pages to the proper encoding for the
  300. directory in which they are installed, the <command>convert-mans</command>
  301. script was written. It will convert manual pages to another encoding before
  302. (or after) installation. Install the <command>convert-mans</command>
  303. script with the following instructions:</para>
  304. <screen><userinput remap="install">cat &gt;&gt; convert-mans &lt;&lt; "EOF"
  305. <literal>#!/bin/sh -e
  306. FROM="$1"
  307. TO="$2"
  308. shift ; shift
  309. while [ $# -gt 0 ]
  310. do
  311. FILE="$1"
  312. shift
  313. iconv -f "$FROM" -t "$TO" "$FILE" >.tmp.iconv
  314. mv .tmp.iconv "$FILE"
  315. done</literal>
  316. EOF
  317. install -v -m755 convert-mans /usr/bin</userinput></screen>
  318. <para>If upstream distributes the manual pages in a legacy encoding, the
  319. manual pages can simply be copied to
  320. <filename class="directory">/usr/share/man/<replaceable>&lt;language
  321. code&gt;</replaceable></filename>. For example, <ulink
  322. url="http://www.infodrom.org/projects/manpages-de/download/manpages-de-0.5.tar.gz">
  323. German manual pages</ulink> can be installed with the following
  324. commands:</para>
  325. <screen role="nodump"><userinput>mkdir -p /usr/share/man/de
  326. cp -rv man? /usr/share/man/de</userinput></screen>
  327. <para>If upstream distributes manual pages in UTF-8 (i.e., <quote>for
  328. RedHat</quote>) instead of the encoding listed in the table above, they
  329. can either be converted from UTF-8 to the encoding listed in the table
  330. above, or they can be installed directly into
  331. <filename class="directory">/usr/share/man/<replaceable>&lt;language
  332. code&gt;</replaceable>.UTF-8</filename>.</para>
  333. <para>For example, to install <ulink
  334. url="http://manpagesfr.free.fr/download/man-pages-fr-2.40.0.tar.bz2">
  335. French manual pages</ulink> in the legacy encoding, use the following
  336. commands:</para>
  337. <screen role="nodump"><userinput>convert-mans UTF-8 ISO-8859-1 man?/*.?
  338. mkdir -p /usr/share/man/fr
  339. cp -rv man? /usr/share/man/fr</userinput></screen>
  340. <note><para>The French manual pages ship with ready made scripts to do the
  341. same conversion. The above instructions are used only as an example for
  342. use of the <command>convert-mans</command> script.</para></note>
  343. <para>Finally, as an example installation of UTF-8 manual pages, again, the
  344. French manual pages could be installed with the following commands:</para>
  345. <screen role="nodump"><userinput>mkdir -p /usr/share/man/fr.UTF-8
  346. cp -rv man? /usr/share/man/fr.UTF-8</userinput></screen>
  347. </sect2>
  348. <sect2 id="contents-man-db" role="content">
  349. <title>Contents of Man-DB</title>
  350. <segmentedlist>
  351. <segtitle>Installed programs</segtitle>
  352. <seglistitem>
  353. <seg>accessdb, apropos (link to whatis), catman, convert-mans, lexgrog, man, mandb,
  354. manpath, whatis, and zsoelim</seg>
  355. </seglistitem>
  356. </segmentedlist>
  357. <variablelist>
  358. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  359. <?dbfo list-presentation="list"?>
  360. <?dbhtml list-presentation="table"?>
  361. <varlistentry id="accessdb">
  362. <term><command>accessdb</command></term>
  363. <listitem>
  364. <para>Dumps the <command>whatis</command> database contents in
  365. human-readable form</para>
  366. <indexterm zone="ch-system-man-db accessdb">
  367. <primary sortas="b-accessdb">accessdb</primary>
  368. </indexterm>
  369. </listitem>
  370. </varlistentry>
  371. <varlistentry id="apropos">
  372. <term><command>apropos</command></term>
  373. <listitem>
  374. <para>Searches the <command>whatis</command> database and displays
  375. the short descriptions of system commands that contain a given
  376. string</para>
  377. <indexterm zone="ch-system-man-db apropos">
  378. <primary sortas="b-apropos">apropos</primary>
  379. </indexterm>
  380. </listitem>
  381. </varlistentry>
  382. <varlistentry id="catman">
  383. <term><command>catman</command></term>
  384. <listitem>
  385. <para>Creates or updates the pre-formatted manual pages</para>
  386. <indexterm zone="ch-system-man-db catman">
  387. <primary sortas="b-catman">catman</primary>
  388. </indexterm>
  389. </listitem>
  390. </varlistentry>
  391. <varlistentry id="convert-mans">
  392. <term><command>convert-mans</command></term>
  393. <listitem>
  394. <para>Reformats manual pages into the chosen encoding.</para>
  395. <indexterm zone="ch-system-man-db convert-mans">
  396. <primary sortas="b-convert-mans">convert-mans</primary>
  397. </indexterm>
  398. </listitem>
  399. </varlistentry>
  400. <varlistentry id="lexgrog">
  401. <term><command>lexgrog</command></term>
  402. <listitem>
  403. <para>Displays one-line summary information about a given manual
  404. page</para>
  405. <indexterm zone="ch-system-man-db lexgrog">
  406. <primary sortas="b-lexgrog">lexgrog</primary>
  407. </indexterm>
  408. </listitem>
  409. </varlistentry>
  410. <varlistentry id="man">
  411. <term><command>man</command></term>
  412. <listitem>
  413. <para>Formats and displays the requested manual page</para>
  414. <indexterm zone="ch-system-man-db man">
  415. <primary sortas="b-man">man</primary>
  416. </indexterm>
  417. </listitem>
  418. </varlistentry>
  419. <varlistentry id="mandb">
  420. <term><command>mandb</command></term>
  421. <listitem>
  422. <para>Creates or updates the <command>whatis</command> database</para>
  423. <indexterm zone="ch-system-man-db mandb">
  424. <primary sortas="b-mandb">mandb</primary>
  425. </indexterm>
  426. </listitem>
  427. </varlistentry>
  428. <varlistentry id="manpath">
  429. <term><command>manpath</command></term>
  430. <listitem>
  431. <para>Displays the contents of $MANPATH or (if $MANPATH is not set)
  432. a suitable search path based on the settings in man.conf and the
  433. user's environment</para>
  434. <indexterm zone="ch-system-man-db manpath">
  435. <primary sortas="b-manpath">manpath</primary>
  436. </indexterm>
  437. </listitem>
  438. </varlistentry>
  439. <varlistentry id="whatis">
  440. <term><command>whatis</command></term>
  441. <listitem>
  442. <para>Searches the <command>whatis</command> database and displays
  443. the short descriptions of system commands that contain the given
  444. keyword as a separate word</para>
  445. <indexterm zone="ch-system-man-db whatis">
  446. <primary sortas="b-whatis">whatis</primary>
  447. </indexterm>
  448. </listitem>
  449. </varlistentry>
  450. <varlistentry id="zsoelim">
  451. <term><command>zsoelim</command></term>
  452. <listitem>
  453. <para>Reads files and replaces lines of the form <emphasis>.so
  454. file</emphasis> by the contents of the mentioned
  455. <emphasis>file</emphasis></para>
  456. <indexterm zone="ch-system-man-db zsoelim">
  457. <primary sortas="b-zsoelim">zsoelim</primary>
  458. </indexterm>
  459. </listitem>
  460. </varlistentry>
  461. </variablelist>
  462. </sect2>
  463. </sect1>