man-db.xml 19 KB

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