man-db.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  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. <para>LFS creates <filename>/usr/man</filename> and
  39. <filename>/usr/local/man</filename> as symlinks. Remove them from the
  40. <filename>man_db.conf</filename> file to prevent redundant
  41. results when using programs such as <command>whatis</command>:</para>
  42. <screen><userinput remap="pre">sed -i -e '\%\t/usr/man%d' -e '\%\t/usr/local/man%d' src/man_db.conf.in</userinput></screen>
  43. <para>Prepare Man-DB for compilation:</para>
  44. <screen><userinput remap="configure">./configure --prefix=/usr --libexecdir=/usr/lib \
  45. --sysconfdir=/etc --disable-setuid \
  46. --enable-mb-groff --with-browser=/usr/bin/lynx \
  47. --with-col=/usr/bin/col --with-vgrind=/usr/bin/vgrind \
  48. --with-grap=/usr/bin/grap</userinput></screen>
  49. <variablelist>
  50. <title>The meaning of the configure options:</title>
  51. <varlistentry>
  52. <term><parameter>--disable-setuid</parameter></term>
  53. <listitem>
  54. <para>This disables making the <command>man</command> program setuid
  55. to user <systemitem class="username">man</systemitem>.</para>
  56. </listitem>
  57. </varlistentry>
  58. <varlistentry>
  59. <term><parameter>--enable-mb-groff</parameter></term>
  60. <listitem>
  61. <para>This switch tells <application>man-db</application> to expect
  62. the Debian multibyte patched version of
  63. <application>groff</application>.</para>
  64. </listitem>
  65. </varlistentry>
  66. <varlistentry>
  67. <term><parameter>--with-...</parameter></term>
  68. <listitem>
  69. <para>These four parameters are used to set some default programs.
  70. The <command>col</command> program is a part of the Util-linux-ng
  71. package, <command>lynx</command> is a text-based web browser (see
  72. BLFS for installation instructions), <command>vgrind</command>
  73. converts program sources to Groff input, and <command>grap</command>
  74. is useful for typesetting graphs in Groff documents. The
  75. <command>vgrind</command> and <command>grap</command> programs are
  76. not normally needed for viewing manual pages. They are not part of
  77. LFS or BLFS, but you should be able to install them yourself after
  78. finishing LFS if you wish to do so.</para>
  79. </listitem>
  80. </varlistentry>
  81. </variablelist>
  82. <para>Compile the package:</para>
  83. <screen><userinput remap="make">make</userinput></screen>
  84. <para>This package does not come with a test suite.</para>
  85. <para>Install the package:</para>
  86. <screen><userinput remap="install">make install</userinput></screen>
  87. <para>Some packages provide UTF-8 manual pages, which previous versions of
  88. <application>Man-DB</application> were unable to display. This limitation
  89. has been fixed in recent versions, and <application>Man-DB</application>
  90. can now convert manual pages from legacy encodings to UTF-8
  91. (and vice-versa) on the fly. This used to be a rather annoying
  92. problem across different distributions, as packages written for one
  93. distribution would require changes to work on another. The following
  94. script will allow you to convert manual pages to and from legacy and UTF-8
  95. encodings.</para>
  96. <screen><userinput remap="install">cat &gt;&gt; convert-mans &lt;&lt; "EOF"
  97. <literal>#!/bin/sh -e
  98. FROM="$1"
  99. TO="$2"
  100. shift ; shift
  101. while [ $# -gt 0 ]
  102. do
  103. FILE="$1"
  104. shift
  105. iconv -f "$FROM" -t "$TO" "$FILE" >.tmp.iconv
  106. mv .tmp.iconv "$FILE"
  107. done</literal>
  108. EOF
  109. install -m755 convert-mans /usr/bin</userinput></screen>
  110. <para>Additional information regarding the compression of
  111. man and info pages can be found in the BLFS book at
  112. <ulink url="&blfs-root;view/cvs/postlfs/compressdoc.html"/>.</para>
  113. </sect2>
  114. <sect2>
  115. <title>Non-English Manual Pages in LFS</title>
  116. <para>Linux distributions have different policies concerning the character
  117. encoding in which manual pages are stored in the filesystem. E.g., RedHat
  118. stores all manual pages in UTF-8, while Debian previously used
  119. language-specific (mostly 8-bit) encodings. As mentioned above, this leads
  120. to incompatibility of packages with manual pages designed for different
  121. distributions.</para>
  122. <para>LFS previously used the same convention as Debian. This was chosen
  123. because <application>Man-DB</application> did not understand manual pages
  124. stored in UTF-8 at the time of its introduction into LFS. For our purposes
  125. at that time, <application>Man-DB</application> was preferable to
  126. <application>Man</application> as it worked without any additional
  127. configuration in any locale. This is still true today as
  128. <application>Man-DB</application> with Debian patched
  129. <application>Groff</application> will now dynamically convert UTF-8 encoded
  130. manual pages to the user's locale. Additionally, this combination provides
  131. support for Chinese and Japanese locales, and limited support for Korean,
  132. whereas <application>Man</application> does not. The current offering of
  133. <application>Man</application> as used in RedHat requires major
  134. modifications to both the <application>Man</application> and
  135. <application>Groff</application> packages, and still falls short on
  136. Chinese, Japanese, and Korean encodings.</para>
  137. <para>Finally, most distributions, including Debian, are rapidly migrating
  138. to all UTF-8 encoded manual pages. Upstream packagers will very likely drop
  139. legacy encodings in favor of UTF-8, though adoption has been slow due to
  140. the hacks required to make the current <application>Man</application> and
  141. <application>Groff</application> packages work correctly together.</para>
  142. <para>The relationship between language codes and the expected encoding
  143. of legacy manual pages is listed below.</para>
  144. <!-- Origin: man-db-2.5.2/src/encodings.c -->
  145. <table>
  146. <title>Expected character encoding of legacy 8-bit manual pages</title>
  147. <?dbfo table-width="2.5in" ?>
  148. <tgroup cols="2">
  149. <colspec colnum="1" colwidth="1.5in"/>
  150. <colspec colnum="2" colwidth="1in"/>
  151. <thead>
  152. <row>
  153. <entry>Language (code)</entry>
  154. <entry>Encoding</entry>
  155. </row>
  156. </thead>
  157. <tbody>
  158. <row>
  159. <entry>Danish (da)</entry>
  160. <entry>ISO-8859-1</entry>
  161. </row>
  162. <row>
  163. <entry>German (de)</entry>
  164. <entry>ISO-8859-1</entry>
  165. </row>
  166. <row>
  167. <entry>English (en)</entry>
  168. <entry>ISO-8859-1</entry>
  169. </row>
  170. <row>
  171. <entry>Spanish (es)</entry>
  172. <entry>ISO-8859-1</entry>
  173. </row>
  174. <row>
  175. <entry>Finnish (fi)</entry>
  176. <entry>ISO-8859-1</entry>
  177. </row>
  178. <row>
  179. <entry>French (fr)</entry>
  180. <entry>ISO-8859-1</entry>
  181. </row>
  182. <row>
  183. <entry>Irish (ga)</entry>
  184. <entry>ISO-8859-1</entry>
  185. </row>
  186. <row>
  187. <entry>Galician (gl)</entry>
  188. <entry>ISO-8859-1</entry>
  189. </row>
  190. <row>
  191. <entry>Indonesian (id)</entry>
  192. <entry>ISO-8859-1</entry>
  193. </row>
  194. <row>
  195. <entry>Icelandic (is)</entry>
  196. <entry>ISO-8859-1</entry>
  197. </row>
  198. <row>
  199. <entry>Italian (it)</entry>
  200. <entry>ISO-8859-1</entry>
  201. </row>
  202. <row>
  203. <entry>Dutch (nl)</entry>
  204. <entry>ISO-8859-1</entry>
  205. </row>
  206. <!-- FIXME: BUG: "no" is deprecated, should use "nb" or "nn" and
  207. symlinks -->
  208. <row>
  209. <entry>Norwegian (no)</entry>
  210. <entry>ISO-8859-1</entry>
  211. </row>
  212. <!-- END BUG -->
  213. <row>
  214. <entry>Portuguese (pt)</entry>
  215. <entry>ISO-8859-1</entry>
  216. </row>
  217. <row>
  218. <entry>Swedish (sv)</entry>
  219. <entry>ISO-8859-1</entry>
  220. </row>
  221. <!-- Languages below require patched groff -->
  222. <row>
  223. <entry>Bulgarian (bg)</entry>
  224. <entry>CP1251</entry>
  225. </row>
  226. <row>
  227. <entry>Czech (cs)</entry>
  228. <entry>ISO-8859-2</entry>
  229. </row>
  230. <row>
  231. <entry>Croatian (hr)</entry>
  232. <entry>ISO-8859-2</entry>
  233. </row>
  234. <row>
  235. <entry>Hungarian (hu)</entry>
  236. <entry>ISO-8859-2</entry>
  237. </row>
  238. <row>
  239. <entry>Japanese (ja)</entry>
  240. <entry>EUC-JP</entry>
  241. </row>
  242. <row>
  243. <entry>Korean (ko)</entry>
  244. <entry>EUC-KR</entry>
  245. </row>
  246. <row>
  247. <entry>Polish (pl)</entry>
  248. <entry>ISO-8859-2</entry>
  249. </row>
  250. <row>
  251. <entry>Russian (ru)</entry>
  252. <entry>KOI8-R</entry>
  253. </row>
  254. <row>
  255. <entry>Slovak (sk)</entry>
  256. <entry>ISO-8859-2</entry>
  257. </row>
  258. <row>
  259. <entry>Serbian (sr)</entry>
  260. <entry>ISO-8859-5</entry>
  261. </row>
  262. <row>
  263. <entry>Turkish (tr)</entry>
  264. <entry>ISO-8859-9</entry>
  265. </row>
  266. <row>
  267. <entry>Simplified Chinese (zh_CN)</entry>
  268. <entry>GBK</entry>
  269. </row>
  270. <row>
  271. <entry>Simplified Chinese,Singapore} (zh_SG)</entry>
  272. <entry>GBK</entry>
  273. </row>
  274. <row>
  275. <entry>Traditional Chinese (zh_TW)</entry>
  276. <entry>BIG5</entry>
  277. </row>
  278. <row>
  279. <entry>Traditional Chinese, Hong Kong (zh_HK)</entry>
  280. <entry>BIG5HKSCS</entry>
  281. </row>
  282. </tbody>
  283. </tgroup>
  284. </table>
  285. <note>
  286. <para>Manual pages in languages not in the list are not supported.
  287. Norwegian does not work because of the transition from no_NO to
  288. nb_NO locale, and will be fixed in the next release of
  289. <application>Man-DB</application>. Korean is currently non functional
  290. because of incomplete fixes in the Groff patch.</para>
  291. </note>
  292. <para>If upstream distributes the manual pages in a legacy encoding,
  293. the 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://ditec.um.es/~piernas/manpages-es/man-pages-es-1.55.tar.bz2">
  309. Spanish manual pages</ulink> in the legacy encoding, use the following
  310. commands:</para>
  311. <screen role="nodump"><userinput>mv man7/iso_8859-7.7{,X}
  312. convert-mans UTF-8 ISO-8859-1 man?/*.?
  313. mv man7/iso_8859-7.7{X,}
  314. make install</userinput></screen>
  315. <note>
  316. <para>The <filename>man7/iso_8859-7.7</filename> file needs to be
  317. exclueded from the conversion process because it is already in
  318. ISO-8859-1 format. This is a packaging bug in man-pages-es-1.55.
  319. Future versions should not require this workaround.</para>
  320. </note>
  321. <para>Finally, as an example installation of UTF-8 manual pages, the <ulink
  322. url="http://manpagesfr.free.fr/download/man-pages-fr-2.40.0.tar.bz2">
  323. French manual pages</ulink> can be installed with the following
  324. commands:</para>
  325. <screen role="nodump"><userinput>mkdir -p /usr/share/man/fr.UTF-8
  326. cp -rv man? /usr/share/man/fr.UTF-8</userinput></screen>
  327. </sect2>
  328. <sect2 id="contents-man-db" role="content">
  329. <title>Contents of Man-DB</title>
  330. <segmentedlist>
  331. <segtitle>Installed programs</segtitle>
  332. <seglistitem>
  333. <seg>apropos, catman, convert-mans, lexgrog, man, mandb,
  334. manpath, whatis, and zsoelim</seg>
  335. </seglistitem>
  336. </segmentedlist>
  337. <variablelist>
  338. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  339. <?dbfo list-presentation="list"?>
  340. <?dbhtml list-presentation="table"?>
  341. <!-- <varlistentry id="accessdb">
  342. <term><command>accessdb</command></term>
  343. <listitem>
  344. <para>Dumps the <command>whatis</command> database contents in
  345. human-readable form</para>
  346. <indexterm zone="ch-system-man-db accessdb">
  347. <primary sortas="b-accessdb">accessdb</primary>
  348. </indexterm>
  349. </listitem>
  350. </varlistentry> -->
  351. <varlistentry id="apropos">
  352. <term><command>apropos</command></term>
  353. <listitem>
  354. <para>Searches the <command>whatis</command> database and displays
  355. the short descriptions of system commands that contain a given
  356. string</para>
  357. <indexterm zone="ch-system-man-db apropos">
  358. <primary sortas="b-apropos">apropos</primary>
  359. </indexterm>
  360. </listitem>
  361. </varlistentry>
  362. <varlistentry id="catman">
  363. <term><command>catman</command></term>
  364. <listitem>
  365. <para>Creates or updates the pre-formatted manual pages</para>
  366. <indexterm zone="ch-system-man-db catman">
  367. <primary sortas="b-catman">catman</primary>
  368. </indexterm>
  369. </listitem>
  370. </varlistentry>
  371. <varlistentry id="convert-mans">
  372. <term><command>convert-mans</command></term>
  373. <listitem>
  374. <para>Reformats manual pages into the chosen encoding.</para>
  375. <indexterm zone="ch-system-man-db convert-mans">
  376. <primary sortas="b-convert-mans">convert-mans</primary>
  377. </indexterm>
  378. </listitem>
  379. </varlistentry>
  380. <varlistentry id="lexgrog">
  381. <term><command>lexgrog</command></term>
  382. <listitem>
  383. <para>Displays one-line summary information about a given manual
  384. page</para>
  385. <indexterm zone="ch-system-man-db lexgrog">
  386. <primary sortas="b-lexgrog">lexgrog</primary>
  387. </indexterm>
  388. </listitem>
  389. </varlistentry>
  390. <varlistentry id="man">
  391. <term><command>man</command></term>
  392. <listitem>
  393. <para>Formats and displays the requested manual page</para>
  394. <indexterm zone="ch-system-man-db man">
  395. <primary sortas="b-man">man</primary>
  396. </indexterm>
  397. </listitem>
  398. </varlistentry>
  399. <varlistentry id="mandb">
  400. <term><command>mandb</command></term>
  401. <listitem>
  402. <para>Creates or updates the <command>whatis</command> database</para>
  403. <indexterm zone="ch-system-man-db mandb">
  404. <primary sortas="b-mandb">mandb</primary>
  405. </indexterm>
  406. </listitem>
  407. </varlistentry>
  408. <varlistentry id="manpath">
  409. <term><command>manpath</command></term>
  410. <listitem>
  411. <para>Displays the contents of $MANPATH or (if $MANPATH is not set)
  412. a suitable search path based on the settings in man.conf and the
  413. user's environment</para>
  414. <indexterm zone="ch-system-man-db manpath">
  415. <primary sortas="b-manpath">manpath</primary>
  416. </indexterm>
  417. </listitem>
  418. </varlistentry>
  419. <varlistentry id="whatis">
  420. <term><command>whatis</command></term>
  421. <listitem>
  422. <para>Searches the <command>whatis</command> database and displays
  423. the short descriptions of system commands that contain the given
  424. keyword as a separate word</para>
  425. <indexterm zone="ch-system-man-db whatis">
  426. <primary sortas="b-whatis">whatis</primary>
  427. </indexterm>
  428. </listitem>
  429. </varlistentry>
  430. <varlistentry id="zsoelim">
  431. <term><command>zsoelim</command></term>
  432. <listitem>
  433. <para>Reads files and replaces lines of the form <emphasis>.so
  434. file</emphasis> by the contents of the mentioned
  435. <emphasis>file</emphasis></para>
  436. <indexterm zone="ch-system-man-db zsoelim">
  437. <primary sortas="b-zsoelim">zsoelim</primary>
  438. </indexterm>
  439. </listitem>
  440. </varlistentry>
  441. </variablelist>
  442. </sect2>
  443. </sect1>