Ignore:
Timestamp:
10/23/2008 04:32:05 AM (16 years ago)
Author:
DJ Lucas <dj@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
ea36f37a
Parents:
18627b5
Message:

Updated text and instructions on man-db page.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8694 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter06/man-db.xml

    r18627b5 r862c5ae  
    4949    when using programs such as <command>whatis</command>:</para> -->
    5050
    51     <para>Use a <command>sed</command> substitution to delete
    52     the <quote>/usr/man</quote> and <quote>/usr/local/man</quote> lines in
    53     the <filename>man_db.conf</filename> file to prevent redundant results
    54     when using programs such as <command>whatis</command>:</para>
     51    <para>LFS creates <filename>/usr/man</filename> and
     52    <filename>/usr/local/man</filename> as symlinks.   Remove them from the
     53    <filename>man_db.conf</filename> file to prevent redundant
     54    results when using programs such as <command>whatis</command>:</para>
    5555
    5656<screen><userinput remap="pre">sed -i -e '\%\t/usr/man%d' -e '\%\t/usr/local/man%d' src/man_db.conf.in</userinput></screen>
    5757
    58     <!-- This is removed and the same thing is done using the configure
    59          command, which seems to be the more proper method
    60 
    61     <para>The second change accounts for programs that Man-DB should be able
    62     to find at runtime, but that haven't been installed yet:</para>
    63 
    64 <screen><userinput remap="pre">cat &gt;&gt; include/manconfig.h.in &lt;&lt; "EOF"
    65 <literal>#define WEB_BROWSER "exec /usr/bin/lynx"
    66 #define COL "/usr/bin/col"
    67 #define VGRIND "/usr/bin/vgrind"
    68 #define GRAP "/usr/bin/grap"</literal>
    69 EOF</userinput></screen>
    70 
    71     <para>The <command>col</command> program is a part of the Util-linux
    72     package, <command>lynx</command> is a text-based web browser (see BLFS
    73     for installation instructions), <command>vgrind</command> converts
    74     program sources to Groff input, and <command>grap</command> is useful
    75     for typesetting graphs in Groff documents. The <command>vgrind</command>
    76     and <command>grap</command> programs are not normally needed for viewing
    77     manual pages. They are not part of LFS or BLFS, but you should be able
    78     to install them yourself after finishing LFS if you wish to do so.</para>
    79 
    80     -->
    81 
    8258    <para>Prepare Man-DB for compilation:</para>
    8359
    84 <screen><userinput remap="configure">./configure --prefix=/usr --libexecdir=/usr/lib --sysconfdir=/etc \
    85     --disable-setuid --with-browser=/usr/bin/lynx \
     60<screen><userinput remap="configure">./configure --prefix=/usr --libexecdir=/usr/lib \
     61    --sysconfdir=/etc --disable-setuid \
     62    --enable-mb-groff --with-browser=/usr/bin/lynx \
    8663    --with-col=/usr/bin/col --with-vgrind=/usr/bin/vgrind \
    8764    --with-grap=/usr/bin/grap</userinput></screen>
     
    9976
    10077      <varlistentry>
     78        <term><parameter>--enable-mb-groff</parameter></term>
     79        <listitem>
     80          <para>This switch tells <application>man-db</application> to expect
     81          the Debian multibyte patched version of
     82          <application>groff</application>.</para> 
     83        </listitem>
     84      </varlistentry>
     85
     86      <varlistentry>
    10187        <term><parameter>--with-...</parameter></term>
    10288        <listitem>
    10389          <para>These four parameters are used to set some default programs.
    10490          The <command>col</command> program is a part of the Util-linux-ng
    105           package, <command>lynx</command> is a text-based web browser (see BLFS
    106           for installation instructions), <command>vgrind</command> converts
    107           program sources to Groff input, and <command>grap</command> is useful
    108           for typesetting graphs in Groff documents. The <command>vgrind</command>
    109           and <command>grap</command> programs are not normally needed for viewing
    110           manual pages. They are not part of LFS or BLFS, but you should be able
    111           to install them yourself after finishing LFS if you wish to do so.</para>
     91          package, <command>lynx</command> is a text-based web browser (see
     92          BLFS for installation instructions), <command>vgrind</command>
     93          converts program sources to Groff input, and <command>grap</command>
     94          is useful for typesetting graphs in Groff documents. The
     95          <command>vgrind</command> and <command>grap</command> programs are
     96          not normally needed for viewing manual pages. They are not part of
     97          LFS or BLFS, but you should be able to install them yourself after
     98          finishing LFS if you wish to do so.</para>
    11299        </listitem>
    113100      </varlistentry>
     
    125112<screen><userinput remap="install">make install</userinput></screen>
    126113
    127     <para>Some packages provide UTF-8 man pages which this version of
    128     <command>man</command> is unable to display.  The following script will
    129     allow some of these to be converted into the expected encodings shown in
    130     the table below. Man-DB expects the manual pages to be in the encodings
    131     in the table, and will convert them as necessary to the actual locale
    132     encoding when it displays them, so that they will display in both UTF-8
    133     and traditional locales.  Because this script is intended for limited use
    134     during the system build, for public data, we will not bother with error
    135     checking, nor use a non-predictable temporary file name:</para>
     114    <para>Some packages provide UTF-8 manual pages, which previous versions of
     115    <application>Man-DB</application> were unable to display.  This limitation
     116    has been fixed in recent versions, and <application>Man-DB</application>
     117    can now convert manual pages from legacy encodings to UTF-8
     118    (and vice-versa) on the fly.  This used to be a rather annoying
     119    problem across different distributions, as packages written for one
     120    distribution would require changes to work on another. The following
     121    script will allow you to convert manual pages to and from legacy and UTF-8
     122    encodings.</para>
    136123
    137124<screen><userinput remap="install">cat &gt;&gt; convert-mans &lt;&lt; "EOF"
     
    161148    <para>Linux distributions have different policies concerning the character
    162149    encoding in which manual pages are stored in the filesystem. E.g., RedHat
    163     stores all manual pages in UTF-8, while Debian uses language-specific
    164     (mostly 8-bit) encodings. This leads to incompatibility of packages with
    165     manual pages designed for different distributions.</para>
    166 
    167     <para>LFS uses the same conventions as Debian. This was chosen because
    168     Man-DB does not understand man pages stored in UTF-8. And, for our
    169     purposes, Man-DB is preferable to Man as it works without extra
    170     configuration in any locale. Lastly, as of now, there is no fully-working
    171     implementation of the RedHat convention. RedHat's <command>groff</command>
    172     is known to misformat text.</para>
     150    stores all manual pages in UTF-8, while Debian previously used
     151    language-specific (mostly 8-bit) encodings. As mentioned above, this leads
     152    to incompatibility of packages with manual pages designed for different
     153    distributions.</para>
     154
     155    <para>LFS previously used the same convention as Debian. This was chosen
     156    because <application>Man-DB</application> did not understand manual pages
     157    stored in UTF-8 at the time of its introduction into LFS.  For our purposes
     158    at that time, <application>Man-DB</application> was preferable to
     159    <application>Man</application> as it worked without any additional
     160    configuration in any locale.  This is still true today as
     161    <application>Man-DB</application> with Debian patched
     162    <application>Groff</application> will now dynamically convert UTF-8 encoded
     163    manual pages to the user's locale.  Additionally, this combination provides
     164    support for Chinese and Japanese locales, and limited support for Korean,
     165    whereas <application>Man</application> does not. The current offering of
     166    <application>Man</application> as used in RedHat requires major
     167    modifications to both the <application>Man</application> and
     168    <application>Groff</application> packages, and still falls short on
     169    Chinese, Japanese, and Korean encodings.</para>
     170
     171    <para>Finally, most distributions, including Debian, are rapidly migrating
     172    to all UTF-8 encoded manual pages. Upstream packagers will very likely drop
     173    legacy encodings in favor of UTF-8, though adoption has been slow due to
     174    the hacks required to make the current <application>Man</application> and
     175    <application>Groff</application> packages work correctly together.</para>
    173176
    174177    <para>The relationship between language codes and the expected encoding
    175     of manual pages is listed below. Man-DB automatically converts them to
    176     the locale encoding while viewing.</para>
    177 
    178     <!-- Origin: man-db-2.4.3/src/encodings.c -->
     178    of legacy manual pages is listed below.</para>
     179
     180    <!-- Origin: man-db-2.5.2/src/encodings.c -->
    179181    <table>
    180       <title>Expected character encoding of manual pages</title>
     182      <title>Expected character encoding of legacy 8-bit manual pages</title>
    181183      <?dbfo table-width="2.5in" ?>
    182184
     
    259261          <!-- Languages below require patched groff -->
    260262          <row>
     263            <entry>Bulgarian (bg)</entry>
     264            <entry>CP1251</entry>
     265          </row>
     266          <row>
    261267            <entry>Czech (cs)</entry>
    262268            <entry>ISO-8859-2</entry>
     
    291297          </row>
    292298          <row>
     299            <entry>Serbian (sr)</entry>
     300            <entry>ISO-8859-5</entry>
     301          </row>
     302          <row>
    293303            <entry>Turkish (tr)</entry>
    294304            <entry>ISO-8859-9</entry>
    295305          </row>
     306          <row>
     307            <entry>Simplified Chinese (zh_CN)</entry>
     308            <entry>GBK</entry>
     309          </row>
     310          <row>
     311            <entry>Simplified Chinese,Singapore} (zh_SG)</entry>
     312            <entry>GBK</entry>
     313          </row>
     314          <row>
     315            <entry>Traditional Chinese (zh_TW)</entry>
     316            <entry>BIG5</entry>
     317          </row>
     318          <row>
     319            <entry>Traditional Chinese, Hong Kong (zh_HK)</entry>
     320            <entry>BIG5HKSCS</entry>
     321          </row>
    296322        </tbody>
    297323
     
    302328    <note>
    303329      <para>Manual pages in languages not in the list are not supported.
    304       Norwegian doesn't work now because of the transition from no_NO to
    305       nb_NO locale, and Korean is non-functional because of the incomplete
    306       Groff patch.</para>
     330      Norwegian does not work because of the transition from no_NO to
     331      nb_NO locale, and will be fixed in the next release of
     332      <application>Man-DB</application>.  Korean is currently non functional
     333      because of incomplete fixes in the Groff patch.</para>
    307334    </note>
    308335
    309     <para>If upstream distributes the manual pages in the same encoding
    310     as Man-DB expects, the manual pages can be copied to
     336
     337    <para>If upstream distributes the manual pages in a legacy encoding,
     338    the manual pages can simply be copied to
    311339    <filename class="directory">/usr/share/man/<replaceable>&lt;language
    312     code&gt;</replaceable></filename>. E.g., French manual pages
    313     (<ulink url="http://ccb.club.fr/man/man-fr-1.58.0.tar.bz2"/>) can be
    314     installed with the following command:</para>
    315 
    316 <screen role="nodump"><userinput>mkdir -p /usr/share/man/fr
    317 cp -rv man? /usr/share/man/fr</userinput></screen>
     340    code&gt;</replaceable></filename>. For example, <ulink
     341    url="http://www.infodrom.org/projects/manpages-de/download/manpages-de-0.5.tar.gz">
     342    German manual pages</ulink> can be installed with the following
     343    commands:</para>
     344
     345<screen role="nodump"><userinput>mkdir -p /usr/share/man/de
     346cp -rv man? /usr/share/man/de</userinput></screen>
    318347
    319348    <para>If upstream distributes manual pages in UTF-8 (i.e., <quote>for
    320349    RedHat</quote>) instead of the encoding listed in the table above, they
    321     have to be converted from UTF-8 to the encoding listed in the table before
    322     installation. This can be achieved with <command>convert-mans</command>,
    323     e.g., Spanish manual pages (<ulink
    324     url="http://ditec.um.es/~piernas/manpages-es/man-pages-es-1.55.tar.bz2"/>)
    325     can be installed with the following commands:</para>
     350    can either be converted from UTF-8 to the encoding listed in the table
     351    above, or they can be installed directly into
     352    <filename class="directory">/usr/share/man/<replaceable>&lt;language
     353    code&gt;</replaceable>.UTF-8</filename>.</para>
     354
     355    <para>For example, to install <ulink
     356    url="http://ditec.um.es/~piernas/manpages-es/man-pages-es-1.55.tar.bz2">
     357    Spanish manual pages</ulink> in the legacy encoding, use the following
     358    commands:</para>
    326359
    327360<screen role="nodump"><userinput>mv man7/iso_8859-7.7{,X}
     
    331364
    332365    <note>
    333       <para>The need to exclude the <filename>man7/iso_8859-7.7</filename> file
    334       from the conversion process because it is already in ISO-8859-1 is a
    335       packaging bug in man-pages-es-1.55. Future versions should not require
    336       this workaround.</para>
     366      <para>The <filename>man7/iso_8859-7.7</filename> file needs to be
     367      exclueded from the conversion process because it is already in
     368      ISO-8859-1 format.  This is a packaging bug in man-pages-es-1.55.
     369      Future versions should not require this workaround.</para>
    337370    </note>
     371
     372    <para>Finally, as an example installation of UTF-8 manual pages, the <ulink
     373    url="http://manpagesfr.free.fr/download/man-pages-fr-2.40.0.tar.bz2">
     374    French manual pages</ulink> can be installed with the following
     375    commands:</para>
     376
     377<screen role="nodump"><userinput>mkdir -p /usr/share/man/fr.UTF-8
     378cp -rv man? /usr/share/man/fr.UTF-8</userinput></screen>
    338379
    339380  </sect2>
     
    392433        <term><command>convert-mans</command></term>
    393434        <listitem>
    394           <para>Reformat man pages so that Man-DB can display them</para>
     435          <para>Reformats manual pages into the chosen encoding.</para>
    395436          <indexterm zone="ch-system-man-db convert-mans">
    396437            <primary sortas="b-convert-mans">convert-mans</primary>
Note: See TracChangeset for help on using the changeset viewer.