1
0

man-db.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. <?xml version="1.0" encoding="UTF-8"?>
  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>Man-DB 软件包包含查找和阅读 man 页面的程序。</para>
  21. <segmentedlist>
  22. <segtitle>&buildtime;</segtitle>
  23. <segtitle>&diskspace;</segtitle>
  24. <seglistitem>
  25. <seg>&man-db-ch6-sbu;</seg>
  26. <seg>&man-db-ch6-du;</seg>
  27. </seglistitem>
  28. </segmentedlist>
  29. </sect2>
  30. <sect2 role="installation">
  31. <title>安装 Man-DB</title>
  32. <para>准备安装 Man-DB:</para>
  33. <screen revision="systemd"><userinput remap="configure">sed -i '/find/s@/usr@@' init/systemd/man-db.service.in
  34. ./configure --prefix=/usr \
  35. --docdir=/usr/share/doc/man-db-&man-db-version; \
  36. --sysconfdir=/etc \
  37. --disable-setuid \
  38. --enable-cache-owner=bin \
  39. --with-browser=/usr/bin/lynx \
  40. --with-vgrind=/usr/bin/vgrind \
  41. --with-grap=/usr/bin/grap</userinput></screen>
  42. <screen revision="sysv"><userinput remap="configure">./configure --prefix=/usr \
  43. --docdir=/usr/share/doc/man-db-&man-db-version; \
  44. --sysconfdir=/etc \
  45. --disable-setuid \
  46. --enable-cache-owner=bin \
  47. --with-browser=/usr/bin/lynx \
  48. --with-vgrind=/usr/bin/vgrind \
  49. --with-grap=/usr/bin/grap \
  50. --with-systemdtmpfilesdir= \
  51. --with-systemdsystemunitdir=</userinput></screen>
  52. <variablelist>
  53. <title>配置选项的含义:</title>
  54. <varlistentry revision="systemd">
  55. <term><command>sed -i '/find/s@/usr@@' init/systemd/man-db.service.in</command></term>
  56. <listitem>
  57. <para>修改硬编码的,指向 <command>find</command>
  58. 工具的路径,它被我们安装到
  59. <filename class="directory">/bin</filename> 目录。</para>
  60. </listitem>
  61. </varlistentry>
  62. <varlistentry>
  63. <term><parameter>--disable-setuid</parameter></term>
  64. <listitem>
  65. <para>该选项防止将 <command>man</command> 程序 setuid
  66. 到用户 <systemitem class="username">man</systemitem>。</para>
  67. </listitem>
  68. </varlistentry>
  69. <varlistentry>
  70. <term><parameter>--enable-cache-owner=bin</parameter></term>
  71. <listitem>
  72. <para>该选项使得系统范围的缓存文件所有者为用户 bin。</para>
  73. </listitem>
  74. </varlistentry>
  75. <varlistentry>
  76. <term><parameter>--with-...</parameter></term>
  77. <listitem>
  78. <para>这三个选项设定一些默认程序。
  79. <command>lynx</command> 是基于文本的 web 浏览器 (安装过程可在
  80. BLFS 中查阅), <command>vgrind</command>
  81. 将程序源代码转换成 Groff 输入,<command>grap</command>
  82. 用于在 Groff 文档中画图。
  83. <command>vgrind</command> 和 <command>grap</command>
  84. 在阅读 man 手册页面时一般用不到,它们不是 LFS 或 BLFS 的一部分,
  85. 但如果需要的话,您应该可以在完成 LFS 的构建后自行安装它们。</para>
  86. </listitem>
  87. </varlistentry>
  88. <varlistentry revision="sysv">
  89. <term><parameter>--with-systemd...</parameter></term>
  90. <listitem>
  91. <para>该选项防止安装不必要的,为 systemd 提供的目录和文件。</para>
  92. </listitem>
  93. </varlistentry>
  94. </variablelist>
  95. <para>编译该软件包:</para>
  96. <screen><userinput remap="make">make</userinput></screen>
  97. <para>运行以下命令以测试编译结果:</para>
  98. <screen><userinput remap="test">make check</userinput></screen>
  99. <para>安装该软件包:</para>
  100. <screen><userinput remap="install">make install</userinput></screen>
  101. <!--
  102. <para revision="sysv">删除一个我们不希望存在的服务文件目录,
  103. 它的存在会导致某些 BLFS 软件包向该位置安装文件:</para>
  104. <screen revision="sysv"><userinput remap="install">rm -rfv /lib/systemd</userinput></screen>
  105. <para revision="systemd">删除一个对不存在用户的引用:</para>
  106. <screen revision="systemd"><userinput remap="install">sed -i "s:man man:root root:g" /usr/lib/tmpfiles.d/man-db.conf</userinput></screen>
  107. -->
  108. </sect2>
  109. <sect2>
  110. <title>LFS 中的非英文 man 手册页面</title>
  111. <para>下表展示了 Man-DB 假定的安装在
  112. <filename class="directory">/usr/share/man/&lt;ll&gt;</filename>
  113. 中的 man 手册页面的编码字符集。
  114. 另外,Man-DB 还能正确地判断出这些页面是否为 UTF-8 编码。</para>
  115. <!-- Origin: man-db-2.5.9/lib/encodings.c -->
  116. <table>
  117. <title>传统 8 位 man 手册页面的预期字符编码</title>
  118. <?dbfo table-width="6in" ?>
  119. <tgroup cols="4">
  120. <colspec colnum="1" colwidth="1.5in"/>
  121. <colspec colnum="2" colwidth="1in"/>
  122. <colspec colnum="3" colwidth="2.5in"/>
  123. <colspec colnum="4" colwidth="1in"/>
  124. <thead>
  125. <row>
  126. <entry>语言 (代号)</entry>
  127. <entry>编码</entry>
  128. <entry>语言 (代号)</entry>
  129. <entry>编码</entry>
  130. </row>
  131. </thead>
  132. <tbody>
  133. <row>
  134. <entry>丹麦语 (da)</entry>
  135. <entry>ISO-8859-1</entry>
  136. <entry>克罗地亚语 (hr)</entry>
  137. <entry>ISO-8859-2</entry>
  138. </row>
  139. <row>
  140. <entry>德语 (de)</entry>
  141. <entry>ISO-8859-1</entry>
  142. <entry>匈牙利语 (hu)</entry>
  143. <entry>ISO-8859-2</entry>
  144. </row>
  145. <row>
  146. <entry>英语 (en)</entry>
  147. <entry>ISO-8859-1</entry>
  148. <entry>日语 (ja)</entry>
  149. <entry>EUC-JP</entry>
  150. </row>
  151. <row>
  152. <entry>西班牙语 (es)</entry>
  153. <entry>ISO-8859-1</entry>
  154. <entry>朝鲜语 (ko)</entry>
  155. <entry>EUC-KR</entry>
  156. </row>
  157. <row>
  158. <entry>爱沙尼亚语 (et)</entry>
  159. <entry>ISO-8859-1</entry>
  160. <entry>立陶宛语 (lt)</entry>
  161. <entry>ISO-8859-13</entry>
  162. </row>
  163. <row>
  164. <entry>芬兰语 (fi)</entry>
  165. <entry>ISO-8859-1</entry>
  166. <entry>拉脱维亚语 (lv)</entry>
  167. <entry>ISO-8859-13</entry>
  168. </row>
  169. <row>
  170. <entry>法语 (fr)</entry>
  171. <entry>ISO-8859-1</entry>
  172. <entry>马其顿语 (mk)</entry>
  173. <entry>ISO-8859-5</entry>
  174. </row>
  175. <row>
  176. <entry>爱尔兰语 (ga)</entry>
  177. <entry>ISO-8859-1</entry>
  178. <entry>波兰语 (pl)</entry>
  179. <entry>ISO-8859-2</entry>
  180. </row>
  181. <row>
  182. <entry>加利西亚语 (gl)</entry>
  183. <entry>ISO-8859-1</entry>
  184. <entry>罗马尼亚语 (ro)</entry>
  185. <entry>ISO-8859-2</entry>
  186. </row>
  187. <row>
  188. <entry>印尼语 (id)</entry>
  189. <entry>ISO-8859-1</entry>
  190. <entry>俄语 (ru)</entry>
  191. <entry>KOI8-R</entry>
  192. </row>
  193. <row>
  194. <entry>冰岛语 (is)</entry>
  195. <entry>ISO-8859-1</entry>
  196. <entry>斯洛伐克语 (sk)</entry>
  197. <entry>ISO-8859-2</entry>
  198. </row>
  199. <row>
  200. <entry>意大利语 (it)</entry>
  201. <entry>ISO-8859-1</entry>
  202. <entry>斯洛文尼亚语 (sl)</entry>
  203. <entry>ISO-8859-2</entry>
  204. </row>
  205. <row>
  206. <entry>挪威语(波克默尔语) (nb)</entry>
  207. <entry>ISO-8859-1</entry>
  208. <entry>塞尔维亚语(拉丁文) (sr@latin)</entry>
  209. <entry>ISO-8859-2</entry>
  210. </row>
  211. <row>
  212. <entry>荷兰语 (nl)</entry>
  213. <entry>ISO-8859-1</entry>
  214. <entry>塞尔维亚语 (sr)</entry>
  215. <entry>ISO-8859-5</entry>
  216. </row>
  217. <row>
  218. <entry>新挪威语 (nn)</entry>
  219. <entry>ISO-8859-1</entry>
  220. <entry>土耳其语 (tr)</entry>
  221. <entry>ISO-8859-9</entry>
  222. </row>
  223. <row>
  224. <entry>挪威语 (no)</entry>
  225. <entry>ISO-8859-1</entry>
  226. <entry>乌克兰语 (uk)</entry>
  227. <entry>KOI8-U</entry>
  228. </row>
  229. <row>
  230. <entry>葡萄牙语 (pt)</entry>
  231. <entry>ISO-8859-1</entry>
  232. <entry>越南语 (vi)</entry>
  233. <entry>TCVN5712-1</entry>
  234. </row>
  235. <row>
  236. <entry>瑞典语 (sv)</entry>
  237. <entry>ISO-8859-1</entry>
  238. <entry>简体中文 (zh_CN)</entry>
  239. <entry>GBK</entry>
  240. </row>
  241. <row>
  242. <entry>白罗斯语 (be)</entry>
  243. <entry>CP1251</entry>
  244. <entry>简体中文,新加坡 (zh_SG)</entry>
  245. <entry>GBK</entry>
  246. </row>
  247. <row>
  248. <entry>保加利亚语 (bg)</entry>
  249. <entry>CP1251</entry>
  250. <entry>繁体中文,香港特别行政区 (zh_HK)</entry>
  251. <entry>BIG5HKSCS</entry>
  252. </row>
  253. <row>
  254. <entry>捷克语 (cs)</entry>
  255. <entry>ISO-8859-2</entry>
  256. <entry>繁体中文,台湾省 (zh_TW)</entry>
  257. <entry>BIG5</entry>
  258. </row>
  259. <row>
  260. <entry>希腊文 (el)</entry>
  261. <entry>ISO-8859-7</entry>
  262. <entry></entry>
  263. <entry></entry>
  264. </row>
  265. </tbody>
  266. </tgroup>
  267. </table>
  268. <note>
  269. <para>用该表之外的语言编写的 man 手册页面不被支持。</para>
  270. </note>
  271. </sect2>
  272. <sect2 id="contents-man-db" role="content">
  273. <title>Man-DB 的内容</title>
  274. <segmentedlist>
  275. <segtitle>安装的程序</segtitle>
  276. <segtitle>安装的库</segtitle>
  277. <segtitle>安装的目录</segtitle>
  278. <seglistitem>
  279. <seg>accessdb, apropos (link to whatis), catman, lexgrog, man, mandb,
  280. manpath, 以及 whatis</seg>
  281. <seg>libman.so 和 libmandb.so (都在 /usr/lib/man-db 中)</seg>
  282. <seg>/usr/lib/man-db, /usr/libexec/man-db,
  283. and /usr/share/doc/man-db-&man-db-version;</seg>
  284. </seglistitem>
  285. </segmentedlist>
  286. <variablelist>
  287. <bridgehead renderas="sect3">简要描述</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>将 <command>whatis</command> 数据库内容转储为人类可读格式
  294. </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>搜索 <command>whatis</command> 数据库,
  304. 显示包含给定字符串的系统命令的简要描述</para>
  305. <indexterm zone="ch-system-man-db apropos">
  306. <primary sortas="b-apropos">apropos</primary>
  307. </indexterm>
  308. </listitem>
  309. </varlistentry>
  310. <varlistentry id="catman">
  311. <term><command>catman</command></term>
  312. <listitem>
  313. <para>创建或更新预先格式化的 man 手册页面</para>
  314. <indexterm zone="ch-system-man-db catman">
  315. <primary sortas="b-catman">catman</primary>
  316. </indexterm>
  317. </listitem>
  318. </varlistentry>
  319. <varlistentry id="lexgrog">
  320. <term><command>lexgrog</command></term>
  321. <listitem>
  322. <para>显示给定 man 手册页面的单行摘要信息</para>
  323. <indexterm zone="ch-system-man-db lexgrog">
  324. <primary sortas="b-lexgrog">lexgrog</primary>
  325. </indexterm>
  326. </listitem>
  327. </varlistentry>
  328. <varlistentry id="man">
  329. <term><command>man</command></term>
  330. <listitem>
  331. <para>格式化并显示请求的 man 手册页面</para>
  332. <indexterm zone="ch-system-man-db man">
  333. <primary sortas="b-man">man</primary>
  334. </indexterm>
  335. </listitem>
  336. </varlistentry>
  337. <varlistentry id="mandb">
  338. <term><command>mandb</command></term>
  339. <listitem>
  340. <para>创建或更新 <command>whatis</command> 数据库</para>
  341. <indexterm zone="ch-system-man-db mandb">
  342. <primary sortas="b-mandb">mandb</primary>
  343. </indexterm>
  344. </listitem>
  345. </varlistentry>
  346. <varlistentry id="manpath">
  347. <term><command>manpath</command></term>
  348. <listitem>
  349. <para>显示 $MANPATH 的内容,或者(如果 $MATHPATH 未设定)
  350. 根据 man.conf 和用户环境确定的合适搜索路径</para>
  351. <indexterm zone="ch-system-man-db manpath">
  352. <primary sortas="b-manpath">manpath</primary>
  353. </indexterm>
  354. </listitem>
  355. </varlistentry>
  356. <varlistentry id="whatis">
  357. <term><command>whatis</command></term>
  358. <listitem>
  359. <para>搜索 <command>whatis</command> 数据库,
  360. 显示包含给定关键词的系统命令的简要描述</para>
  361. <indexterm zone="ch-system-man-db whatis">
  362. <primary sortas="b-whatis">whatis</primary>
  363. </indexterm>
  364. </listitem>
  365. </varlistentry>
  366. <varlistentry id="libman">
  367. <term><filename class="libraryfile">libman</filename></term>
  368. <listitem>
  369. <para>包含 <command>man</command> 运行时支持</para>
  370. <indexterm zone="ch-system-man-db libman">
  371. <primary sortas="c-libman">libman</primary>
  372. </indexterm>
  373. </listitem>
  374. </varlistentry>
  375. <varlistentry id="libmandb">
  376. <term><filename class="libraryfile">libmandb</filename></term>
  377. <listitem>
  378. <para>包含 <command>man</command> 运行时支持</para>
  379. <indexterm zone="ch-system-man-db libmandb">
  380. <primary sortas="c-libmandb">libmandb</primary>
  381. </indexterm>
  382. </listitem>
  383. </varlistentry>
  384. </variablelist>
  385. </sect2>
  386. </sect1>