man-db.xml 18 KB

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