Index: chapter06/chapter06.xml
===================================================================
--- chapter06/chapter06.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/chapter06.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -41,4 +41,5 @@
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bzip2.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="diffutils.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="db.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="e2fsprogs.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="file.xml"/>
@@ -55,5 +56,5 @@
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="libtool.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="make.xml"/>
-<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man-db.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mktemp.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="module-init-tools.xml"/>
Index: chapter06/coreutils.xml
===================================================================
--- chapter06/coreutils.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/coreutils.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -41,4 +41,24 @@
 
 <screen><userinput>patch -Np1 -i ../&coreutils-suppress-patch;</userinput></screen>
+
+<para>POSIX requires that programs from Coreutils recognize character
+boundaries correctly even in multibyte locales. The following patch
+fixes this non-compliance and other internationalization-related bugs:</para>
+
+<screen><userinput>patch -Np1 -i ../&coreutils-i18n-patch;</userinput></screen>
+
+<para>In order for the tests added by this patch to pass, the permissions for
+the test file have to be changed:</para>
+
+<screen><userinput>chmod +x tests/sort/sort-mb-tests</userinput></screen>
+
+<note><para>In the past, many bugs were found in this patch. When reporting
+new bugs to Coreutils maintainers, please check first if they are reproducible
+without this patch.</para></note>
+
+<para>It has been found that translated messages sometimes overflow a buffer
+in the <command>who -Hu</command> command. Increase the buffer size:</para>
+
+<screen><userinput>sed -i 's/_LEN 6/_LEN 20/' src/who.c</userinput></screen>
 
 <para>Now prepare Coreutils for compilation:</para>
Index: chapter06/db.xml
===================================================================
--- chapter06/db.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
+++ chapter06/db.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<sect1 id="ch-system-db" role="wrap">
+<title>DB-&db-version;</title>
+<?dbhtml filename="db.html"?>
+
+<indexterm zone="ch-system-db"><primary sortas="a-DB">Berkeley DB</primary></indexterm>
+
+<sect2 role="package"><title/>
+<para>The DB package contains programs and utilities used by many other
+applications for database related functions.</para>
+
+<segmentedlist>
+<segtitle>&buildtime;</segtitle>
+<segtitle>&diskspace;</segtitle>
+<seglistitem><seg>1.0 SBU</seg><seg>74 MB</seg></seglistitem>
+</segmentedlist>
+
+<segmentedlist>
+<segtitle>&dependencies;</segtitle>
+<seglistitem><seg>Bash, Binutils, Coreutils,
+Diffutils, GCC, Glibc, Make and Sed.</seg></seglistitem>
+</segmentedlist>
+</sect2>
+
+<sect2 role="installation">
+<title>Installation of DB</title>
+
+<para>Prepare DB for compilation:</para>
+
+<screen><userinput>cd build_unix &amp;&amp;
+../dist/configure --prefix=/usr --enable-compat185 --enable-cxx</userinput></screen>
+
+<para>The meaning of the configure options:</para>
+
+<variablelist>
+<varlistentry>
+<term><parameter>--enable-compat185</parameter></term>
+<listitem><para>This option enables building DB 1.85 compatibility API.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><parameter>--enable-cxx</parameter></term>
+<listitem><para>This option enables building C++ API libraries.</para></listitem>
+</varlistentry>
+</variablelist>
+
+<para>Compile the package:</para>
+
+<screen><userinput>make LIBSO_LIBS="-lpthread" LIBXSO_LIBS="-lpthread"</userinput></screen>
+
+<para>The meaning of the make option:</para>
+
+<variablelist>
+<varlistentry>
+<term><parameter>LIBSO_LIBS="-lpthread" LIBXSO_LIBS="-lpthread"</parameter></term>
+<listitem><para>These variables work around a bug in the <command>configure</command>
+script that causes the DB libraries not to link against NPTL libraries</para></listitem>
+</varlistentry>
+</variablelist>
+
+<para>It is not possible to test the package meaningfully, because that
+would involve building TCL bindings. TCL bindings cannot be built properly
+now because TCL is linked against Glibc in <filename class="directory">/tools</filename>,
+not against Glibc in <filename class="directory">/usr</filename>.</para>
+
+<para>Install the package:</para>
+
+<screen><userinput>make docdir=/usr/share/doc/db-&db-version; install</userinput></screen>
+
+<para>The meaning of the make option:</para>
+
+<variablelist>
+<varlistentry>
+<term><parameter>docdir=...</parameter></term>
+<listitem><para>This variable specifies the correct place for the documentation.</para></listitem>
+</varlistentry>
+</variablelist>
+
+<para>Fix the permissions on the installed documentation files:</para>
+
+<screen><userinput>chown root:root /usr/bin/db_* \
+    /usr/lib/libdb* /usr/include/db* &amp;&amp;
+chown -R root:root /usr/share/doc/db-&db-version;</userinput></screen>
+
+</sect2>
+
+
+<sect2 id="contents-db" role="content"><title>Contents of DB</title>
+<segmentedlist>
+<segtitle>Installed programs</segtitle>
+<seglistitem><seg>db_archive, db_checkpoint, db_deadlock, db_dump,
+db_hotbackup, db_load, db_printlog, db_recover, db_stat, db_upgrade and
+db_verify
+</seg></seglistitem>
+</segmentedlist>
+
+<segmentedlist>
+<segtitle>Installed libraries</segtitle>
+<seglistitem><seg>libdb.[so,a] and libdb_cxx.[so,a]</seg></seglistitem>
+</segmentedlist>
+
+<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
+<?dbfo list-presentation="list"?>
+<?dbhtml list-presentation="table"?>
+
+<varlistentry id="db_archive">
+<term><command>db_archive</command></term>
+<listitem>
+<para>Prints the pathnames of log files that are no longer in use</para>
+<indexterm zone="ch-system-db db_archive"><primary sortas="b-db_archive">db_archive</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="db_checkpoint">
+<term><command>db_checkpoint</command></term>
+<listitem>
+<para>A daemon used to monitor and checkpoint database logs</para>
+<indexterm zone="ch-system-db db_checkpoint"><primary sortas="b-db_checkpoint">db_checkpoint</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="db_deadlock">
+<term><command>db_deadlock</command></term>
+<listitem>
+<para>A daemon used to abort lock requests when deadlocks are detected</para>
+<indexterm zone="ch-system-db db_deadlock"><primary sortas="b-db_deadlock">db_deadlock</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="db_dump">
+<term><command>db_dump</command></term>
+<listitem>
+<para>Converts database files to a plain-text file format readable by <command>db_load</command></para>
+<indexterm zone="ch-system-db db_dump"><primary sortas="b-db_dump">db_dump</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="db_hotbackup">
+<term><command>db_hotbackup</command></term>
+<listitem>
+<para>Creates <quote>hot backup</quote> or <quote>hot failover</quote> snapshots of Berkeley DB databases</para>
+<indexterm zone="ch-system-db db_hotbackup"><primary sortas="b-db_hotbackup">db_hotbackup</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="db_load">
+<term><command>db_load</command></term>
+<listitem>
+<para>Is used to create database files from plain-text files</para>
+<indexterm zone="ch-system-db db_load"><primary sortas="b-db_load">db_load</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="db_printlog">
+<term><command>db_printlog</command></term>
+<listitem>
+<para>Converts database log files to human readable text</para>
+<indexterm zone="ch-system-db db_printlog"><primary sortas="b-db_printlog">db_printlog</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="db_recover">
+<term><command>db_recover</command></term>
+<listitem>
+<para>Is used to restore a database to a consistent state after a failure</para>
+<indexterm zone="ch-system-db db_recover"><primary sortas="b-db_recover">db_recover</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="db_stat">
+<term><command>db_stat</command></term>
+<listitem>
+<para>Displays statistics for Berkeley databases</para>
+<indexterm zone="ch-system-db db_stat"><primary sortas="b-db_stat">db_stat</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="db_upgrade">
+<term><command>db_upgrade</command></term>
+<listitem>
+<para>Is used to upgrade database files to a newer version of Berkeley DB</para>
+<indexterm zone="ch-system-db db_upgrade"><primary sortas="b-db_upgrade">db_upgrade</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="db_verify">
+<term><command>db_verify</command></term>
+<listitem>
+<para>Is used to run consistency checks on database files</para>
+<indexterm zone="ch-system-db db_verify"><primary sortas="b-db_verify">db_verify</primary></indexterm>
+</listitem>
+</varlistentry>
+
+
+<varlistentry id="libdb">
+<term><filename class="libraryfile">libdb.[so,a]</filename></term>
+<listitem>
+<para>Contains functions to manipulate database files from C programs</para>
+<indexterm zone="ch-system-db libdb"><primary sortas="c-libdb">libdb</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libdb_cxx">
+<term><filename class="libraryfile">libdb_cxx.[so,a]</filename></term>
+<listitem>
+<para>Contains functions to manipulate database files from C++ programs</para>
+<indexterm zone="ch-system-db libdb_cxx"><primary sortas="c-libdb_cxx">libdb_cxx</primary></indexterm>
+</listitem>
+</varlistentry>
+</variablelist>
+
+</sect2>
+
+</sect1>
Index: chapter06/diffutils.xml
===================================================================
--- chapter06/diffutils.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/diffutils.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -29,4 +29,10 @@
 <sect2 role="installation">
 <title>Installation of Diffutils</title>
+
+<para>POSIX requires the <command>diff</command> command to treat whitespace
+characters according to the current locale. The following patch fixes the
+non-compliance issue:</para>
+
+<screen><userinput>patch -Np1 -i ../&diffutils-i18n-patch;</userinput></screen>
 
 <para>Prepare Diffutils for compilation:</para>
Index: chapter06/gawk.xml
===================================================================
--- chapter06/gawk.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/gawk.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -29,6 +29,6 @@
 <title>Installation of Gawk</title>
 
-<para>Patch Gawk to fix a bug which causes it to segfault when invoked on a
-non-existent file:</para>
+<para>Under some circumstances, Gawk-&gawk-version;  attempts to free a chunk
+of memory that was not allocated. This bug is fixed by the following patch:</para>
 
 <screen><userinput>patch -Np1 -i ../&gawk-segfault-patch;</userinput></screen>
@@ -38,9 +38,13 @@
 <screen><userinput>./configure --prefix=/usr --libexecdir=/usr/lib</userinput></screen>
 
-<para>The configure script doesn't detect some functionality correctly.  The
-following commands correct this problem:</para>
+<para>Due to a bug in the <command>configure</command> script, Gawk fails
+to detect certain aspects of locale support in Glibc. This
+bug leads to, e.g., Gettext testsuite failures. Work around this issue
+by appending the missing macro definitions to <filename>config.h</filename>:</para>
 
-<screen><userinput>echo "#define HAVE_LANGINFO_CODESET 1" >> config.h
-echo "#define HAVE_LC_MESSAGES 1" >> config.h</userinput></screen>
+<screen><userinput>cat &gt;&gt;config.h &lt;&lt;"EOF"
+<literal>#define HAVE_LANGINFO_CODESET 1
+#define HAVE_LC_MESSAGES 1</literal>
+EOF</userinput></screen>
 
 <para>Compile the package:</para>
Index: chapter06/glibc.xml
===================================================================
--- chapter06/glibc.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/glibc.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -48,4 +48,21 @@
 of achieving a clean build.</para>
 
+<para>The glibc-libidn tarball adds support for internationalized
+domain names (IDN) to Glibc. Many programs that
+support IDN require the full libidn library (see
+<ulink url="&blfs-root;view/svn/general/libidn.html"/>),
+not this add-on.
+Unpack the tarball from within the Glibc source
+directory:</para>
+
+<screen><userinput>tar jxf ../glibc-libidn-&glibc-version;.tar.bz2</userinput></screen>
+
+<para>In the vi_VN.TCVN locale, <command>bash</command> enters an infinite loop
+at startup. It is unknown whether this is a <command>bash</command> bug or a
+Glibc problem. Disable installation of this locale in order to avoid the
+problem:</para>
+
+<screen><userinput>sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED</userinput></screen>
+
 <para>The Glibc documentation recommends building Glibc outside of the source
 directory in a dedicated build directory:</para>
@@ -122,24 +139,34 @@
 <para>Install the package:</para>
 
-<screen><userinput>make install</userinput></screen>
+<screen><userinput>make install_root=/ install</userinput></screen>
+
+<para>The meaning of the make option:</para>
+
+<variablelist>
+<varlistentry>
+<term><parameter>install_root=/</parameter></term>
+<listitem><para>This causes the Glibc Makefile not to run the
+<filename>scripts/test-installation.pl</filename> script at the end
+of Glibc installation. Since the toolchain has not been adjusted yet for
+the new Glibc, this script would test Glibc installed in
+<filename class="directory">/tools</filename> and fail because the
+libidn add-on has not been installed there.</para></listitem>
+</varlistentry>
+</variablelist>
 
 <para>The locales that can make the system respond in a different
-language were not installed by the above command. Install this
-with:</para>
-
-<screen><userinput>make localedata/install-locales</userinput></screen>
-
-<para>To save time, an alternative to running the
-previous command (which generates and installs every locale Glibc is
-aware of) is to install only those locales that are wanted and needed.
-This can be achieved by using the <command>localedef</command>
-command. Information on this command is located in the
-<filename>INSTALL</filename> file in the Glibc source.  However, there
-are a number of locales that are essential in order for the tests of
-future packages to pass, in particular, the
-<emphasis>libstdc++</emphasis> tests from GCC. The following
-instructions, instead of the <parameter>install-locales</parameter>
-target used above, will install the minimum set of locales necessary
-for the tests to run successfully:</para>
+language were not installed by the above command. None of the
+locales are required, but, if some of them are misssing, testuites of the
+future packages would skip important testcases.</para>
+
+<para>Individual locales can be installed using the <command>localedef</command>
+program. E.g., the first <command>localedef</command> command below combines
+the <filename>/usr/share/i18n/locales/de_DE</filename> charset-independent
+locale definition with the
+<filename>/usr/share/i18n/charmaps/ISO-8859-1.gz</filename> charmap definition
+and appends the result to the
+<filename>/usr/lib/locale/locale-archive</filename> file. The following
+instructions will install the minimum set of locales necessary
+for the optimal coverage of tests:</para>
 
 <screen role="nodump"><userinput>mkdir -pv /usr/lib/locale
@@ -153,21 +180,24 @@
 localedef -i fr_FR -f ISO-8859-1 fr_FR
 localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
+localedef -i fr_FR.UTF-8 -f UTF-8 fr_FR
 localedef -i it_IT -f ISO-8859-1 it_IT
 localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen>
 
-<para>Some locales installed by the <command>make
-localedata/install-locales</command> command above are not properly
-supported by some applications that are in the LFS and BLFS books.
-Because of the various problems that arise due to application
-programmers making assumptions that break in such locales, LFS should
-not be used in locales that utilize multibyte character sets
-(including UTF-8) or right-to-left writing order.  Numerous unofficial
-and unstable patches are required to fix these problems, and it has
-been decided by the LFS developers not to support such complex locales.  This applies to the
-ja_JP and fa_IR locales as well&mdash;they have been installed only for
-GCC and Gettext tests to pass, and the <command>watch</command> program
-(part of the Procps package) does not work properly in them. Various
-attempts to circumvent these restrictions are documented in
-internationalization-related hints.</para>
+<para>In addition, install the locale for your own country, language and
+character set.</para>
+
+<para>Alternatively, install all locales
+listed in the <filename>glibc-&glibc-version;/localedata/SUPPORTED</filename>
+file (it includes every locale listed above and many more)
+at once with the following time-consuming command:</para>
+
+<screen><userinput>make localedata/install-locales</userinput></screen>
+
+<para>Then use the <command>localedef</command> command to create and
+install locales not listed in the
+<filename>glibc-&glibc-version;/localedata/SUPPORTED</filename> file
+in the unlikely case if you need them.</para>
+<!-- The Live CD patches the localedata/SUPPORTED file instead of
+running localedef, the results are equivalent -->
 
 </sect2>
@@ -278,5 +308,5 @@
 rpcinfo, sln, sprof, tzselect, xtrace, zdump, and zic</seg>
 <seg>ld.so, libBrokenLocale.[a,so],
-libSegFault.so, libanl.[a,so], libbsd-compat.a, libc.[a,so],
+libSegFault.so, libanl.[a,so], libbsd-compat.a, libc.[a,so], libcidn.so,
 libcrypt.[a,so], libdl.[a,so], libg.a, libieee.a, libm.[a,so], libmcheck.a,
 libmemusage.so, libnsl.a, libnss_compat.so, libnss_dns.so, libnss_files.so,
@@ -367,6 +397,5 @@
 <term><command>locale</command></term>
 <listitem>
-<para>Tells the compiler to enable or disable the use of POSIX locales
-for built-in operations</para>
+<para>Prints various information about the current locale</para>
 <indexterm zone="ch-system-glibc locale"><primary sortas="b-locale">locale</primary></indexterm>
 </listitem>
@@ -500,5 +529,8 @@
 <term><filename class="libraryfile">libBrokenLocale</filename></term>
 <listitem>
-<para>Used by programs, such as Mozilla, to solve broken locales</para>
+<para>Used internally by Glibc as a gross hack to get broken programs 
+(e.g., some Motif applications) running. See comments in
+<filename>glibc-&glibc-version;/locale/broken_cur_max.c</filename> for more
+information</para>
 <indexterm zone="ch-system-glibc libBrokenLocale"><primary sortas="c-libBrokenLocale">libBrokenLocale</primary></indexterm>
 </listitem>
@@ -508,5 +540,6 @@
 <term><filename class="libraryfile">libSegFault</filename></term>
 <listitem>
-<para>The segmentation fault signal handler</para>
+<para>The segmentation fault signal handler, used by
+<command>catchsegv</command></para>
 <indexterm zone="ch-system-glibc libSegFault"><primary sortas="c-libSegFault">libSegFault</primary></indexterm>
 </listitem>
@@ -538,4 +571,13 @@
 </varlistentry>
 
+<varlistentry id="libcidn">
+<term><filename class="libraryfile">libcidn</filename></term>
+<listitem>
+<para>Used internally by Glibc for handling internationalized domain names in
+the <function>getaddrinfo()</function> function</para>
+<indexterm zone="ch-system-glibc libcrypt"><primary sortas="c-libcrypt">libcrypt</primary></indexterm>
+</listitem>
+</varlistentry>
+
 <varlistentry id="libcrypt">
 <term><filename class="libraryfile">libcrypt</filename></term>
@@ -557,5 +599,6 @@
 <term><filename class="libraryfile">libg</filename></term>
 <listitem>
-<para>A runtime library for <command>g++</command></para>
+<para>Dummy library containing no functions. Previously was a runtime library
+for <command>g++</command></para>
 <indexterm zone="ch-system-glibc libg"><primary sortas="c-libg">libg</primary></indexterm>
 </listitem>
@@ -565,5 +608,7 @@
 <term><filename class="libraryfile">libieee</filename></term>
 <listitem>
-<para>The Institute of Electrical and Electronic Engineers (IEEE) floating point library</para>
+<para>Linking in this module forces error handling rules for math functions as
+defined by the Institute of Electrical and Electronic Engineers (IEEE).
+The default is POSIX.1 error handling</para>
 <indexterm zone="ch-system-glibc libieee"><primary sortas="c-libieee">libieee</primary></indexterm>
 </listitem>
@@ -581,5 +626,5 @@
 <term><filename class="libraryfile">libmcheck</filename></term>
 <listitem>
-<para>Contains code run at boot</para>
+<para>Turns on memory allocation checking when linked to</para>
 <indexterm zone="ch-system-glibc libmcheck"><primary sortas="c-libmcheck">libmcheck</primary></indexterm>
 </listitem>
Index: chapter06/grep.xml
===================================================================
--- chapter06/grep.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/grep.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -28,4 +28,14 @@
 <sect2 role="installation">
 <title>Installation of Grep</title>
+
+<para>The current Grep package has many bugs, especially in the support of
+multibyte locales. RedHat fixed some of them with the following patch:</para>
+
+<screen><userinput>patch -Np1 -i ../&grep-fixes-patch;</userinput></screen>
+
+<para>In order for the tests added by this patch to pass, the permissions for
+the test file have to be changed:</para>
+
+<screen><userinput>chmod +x tests/fmbtest.sh</userinput></screen>
 
 <para>Prepare Grep for compilation:</para>
Index: chapter06/groff.xml
===================================================================
--- chapter06/groff.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/groff.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -29,12 +29,33 @@
 <title>Installation of Groff</title>
 
+<para>Apply the patch that adds the <quote>ascii8</quote> and
+<quote>nippon</quote> devices to Groff:</para>
+
+<screen><userinput>zcat ../&groff-debian-patch; | patch -Np1</userinput></screen>
+
+<note><para>These devices are used by Man-DB when formatting non-English manual
+pages that are not in the ISO-8859-1 encoding. Currently, there is no working
+patch for Groff-1.19.x that adds this functionality.
+<!-- Details: http://bugs.debian.org/196762 -->
+</para></note>
+
+<para>Many screen fonts don't have Unicode single quotes and dashes in them.
+Tell Groff to use the ASCII equivalents instead:</para>
+
+<screen><userinput>sed -i -e 's/2010/002D/' -e 's/2212/002D/' \
+    -e 's/2018/0060/' -e 's/2019/0027/' font/devutf8/R.proto
+</userinput></screen>
+
 <para>Groff expects the environment variable <envar>PAGE</envar>
 to contain the default paper size. For users in the United States,
 <parameter>PAGE=letter</parameter> is appropriate. Elsewhere,
-<parameter>PAGE=A4</parameter> may be more suitable.</para>
+<parameter>PAGE=A4</parameter> may be more suitable.
+While the default paper size is configured during compilation, it can be
+overridden later by echoing either <quote>A4</quote> or <quote>letter</quote>
+to the <filename>/etc/papersize</filename> file.</para>
 
 <para>Prepare Groff for compilation:</para>
 
-<screen><userinput>PAGE=<replaceable>[paper_size]</replaceable> ./configure --prefix=/usr</userinput></screen>
+<screen><userinput>PAGE=<replaceable>[paper_size]</replaceable> ./configure --prefix=/usr --enable-multibyte</userinput></screen>
 
 <para>Compile the package:</para>
Index: chapter06/iproute2.xml
===================================================================
--- chapter06/iproute2.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/iproute2.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -26,5 +26,5 @@
       <segtitle>&dependencies;</segtitle>
       <seglistitem>
-        <seg>GCC, Glibc, Make, Linux-Headers, and Sed</seg>
+        <seg>DB, GCC, Glibc, Make, and Linux-Headers</seg>
       </seglistitem>
     </segmentedlist>
@@ -32,14 +32,4 @@
   <sect2 role="installation">
     <title>Installation of IPRoute2</title>
-    <para>The <command>arpd</command> binary included in this package is
-          dependent on Berkeley DB.  Because <command>arpd</command> is not a very
-          common requirement on a base Linux system, remove the dependency on
-          Berkeley DB by applying the <command>sed</command> command below.  If 
-          the <command>arpd</command> binary is needed, instructions for
-          compiling Berkeley DB can be found in the BLFS Book at <ulink
-          url="&blfs-root;view/svn/server/databases.html#db"/>.
-    </para>
-
-    <screen><userinput>sed -i '/^TARGETS/s@arpd@@g' misc/Makefile</userinput></screen>
 
     <para>Prepare IPRoute2 for compilation:</para>
@@ -69,4 +59,14 @@
 
     <screen><userinput>make SBINDIR=/sbin install</userinput></screen>
+    
+    <para>The <command>arpd</command> binary links against the DB libraries
+          that reside in <filename class="directory">/usr</filename> and
+          uses a database in <filename>/var/lib/arpd/arpd.db</filename>. Thus,
+          according to the FHS, it must be
+          in <filename class="directory">/usr/sbin</filename>. Move it there:
+    </para>
+
+    <screen><userinput>mv -v /sbin/arpd /usr/sbin</userinput></screen>
+      
   </sect2>
 
@@ -76,6 +76,7 @@
       <segtitle>Installed programs</segtitle>
       <seglistitem>
-        <seg>ctstat (link to lnstat), ifcfg, ifstat, ip, lnstat, nstat, routef,
-             routel, rtacct, rtmon, rtpr, rtstat (link to lnstat), ss, and tc.
+        <seg>arpd, ctstat (link to lnstat), ifcfg, ifstat, ip, lnstat, nstat,
+	     routef, routel, rtacct, rtmon, rtpr, rtstat (link to lnstat), ss,
+	     and tc.
         </seg>
       </seglistitem>
@@ -85,4 +86,18 @@
 <?dbfo list-presentation="list"?>
 <?dbhtml list-presentation="table"?>
+      <varlistentry id="arpd">
+        <term>
+          <command>arpd</command>
+        </term>
+        <listitem>
+          <para>Userspace ARP daemon, useful in really large networks, where
+	        the kernelspace ARP implementation is insufficient, or
+	        when setting up a honeypot</para>
+          <indexterm zone="ch-system-iproute2 arpd">
+            <primary sortas="b-arpd">arpd</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
       <varlistentry id="ctstat">
         <term>
@@ -293,5 +308,5 @@
         <listitem>
           <para>Traffic Controlling Executable; this is for Quality Of
-Service (QOS) and Class Of Service (COS)
+                Service (QOS) and Class Of Service (COS)
                 implementations
           </para>
Index: chapter06/kbd.xml
===================================================================
--- chapter06/kbd.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/kbd.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -29,4 +29,13 @@
 <title>Installation of Kbd</title>
 
+<para>The behaviour of the Backspace and Delete keys is not consistent across the
+keymaps in the Kbd package. The following patch fixes this issue for
+i386 keymaps:</para>
+
+<screen><userinput>patch -Np1 -i ../&kbd-backspace-patch;</userinput></screen>
+
+<para>After patching, the Backspace key generates the character with code 127,
+and the Delete key generates a well-known escape sequence.</para>
+
 <para>Patch Kbd to fix a bug in <command>setfont</command> that is triggered
 when compiling with GCC-&gcc-version;:</para>
@@ -47,4 +56,9 @@
 
 <screen><userinput>make install</userinput></screen>
+
+<note><para>For some languages (e.g., Belarusian) the Kbd package doesn't
+provide a useful keymap (the stock <quote>by</quote> keymap assumes the
+ISO-8859-5 encoding, while everybody uses CP1251 instead). Users of such
+languages have to download working keymaps separately.</para></note>
 
 </sect2>
@@ -275,6 +289,7 @@
 <term><command>unicode_start</command></term>
 <listitem>
-<para>Puts the keyboard and console in UNICODE mode. Never use it on LFS, 
-because applications are not configured to support UNICODE.</para>
+<para>Puts the keyboard and console in UNICODE mode. Don't use this program
+unless your keymap file is in the ISO-8859-1 encoding. For other encodings,
+this utility produces incorrect results.</para>
 <indexterm zone="ch-system-kbd unicode_start"><primary sortas="b-unicode_start">unicode_start</primary></indexterm>
 </listitem>
Index: chapter06/libtool.xml
===================================================================
--- chapter06/libtool.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/libtool.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -18,5 +18,5 @@
 <segtitle>&buildtime;</segtitle>
 <segtitle>&diskspace;</segtitle>
-<seglistitem><seg>1.5 SBU</seg><seg>19.7 MB</seg></seglistitem>
+<seglistitem><seg>1.8 SBU</seg><seg>19.0 MB</seg></seglistitem>
 </segmentedlist>
 
Index: chapter06/linux-libc-headers.xml
===================================================================
--- chapter06/linux-libc-headers.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/linux-libc-headers.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -42,5 +42,6 @@
 <para>Install the header files:</para>
 
-<screen><userinput>cp -Rv include/asm-i386 /usr/include/asm
+<screen><userinput>install -d /usr/include/asm
+cp -Rv include/asm-i386/* /usr/include/asm
 cp -Rv include/linux /usr/include</userinput></screen>
 
Index: chapter06/man-db.xml
===================================================================
--- chapter06/man-db.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
+++ chapter06/man-db.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -0,0 +1,265 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<sect1 id="ch-system-man-db" role="wrap">
+<title>Man-DB-&man-db-version;</title>
+<?dbhtml filename="man-db.html"?>
+
+<indexterm zone="ch-system-man-db"><primary sortas="a-Man-DB">Man-DB</primary></indexterm>
+
+<sect2 role="package"><title/>
+<para>The Man-DB package contains programs for finding and viewing man pages.</para>
+
+<segmentedlist>
+<segtitle>&buildtime;</segtitle>
+<segtitle>&diskspace;</segtitle>
+<seglistitem><seg>0.1 SBU</seg><seg>1.1 MB</seg></seglistitem>
+</segmentedlist>
+
+<segmentedlist>
+<segtitle>&dependencies;</segtitle>
+<seglistitem><seg>Bash, Binutils, Coreutils, Gawk, GCC, DB,
+Glibc, Gettext, Grep, Make, and Sed</seg></seglistitem>
+</segmentedlist>
+</sect2>
+
+<sect2 role="installation">
+<title>Installation of Man-DB</title>
+
+<para>Three adjustments need to be made to the sources of Man-DB.</para>
+
+<para>The first one changes the location of translated manual pages that come
+with Man-DB, in order for them to be accessible in both traditional and
+UTF-8 locales:</para>
+
+<screen><userinput>mv man/de{_DE.88591,} &amp;&amp;
+mv man/es{_ES.88591,} &amp;&amp;
+mv man/it{_IT.88591,} &amp;&amp;
+mv man/ja{_JP.eucJP,} &amp;&amp;
+sed -i 's,\*_\*,??,' man/Makefile.in</userinput></screen>
+
+<para>The second change is a <command>sed</command> substitution to delete the
+<quote>/usr/man</quote> lines in the
+<filename>man_db.conf</filename> file to prevent redundant results when
+using programs such as <command>whatis</command>:</para>
+
+<screen><userinput>sed -i '/\t\/usr\/man/d' src/man_db.conf.in</userinput></screen>
+
+<para>The third change accounts for programs that Man-DB should be able
+to find at runtime, but that haven't been installed yet:</para>
+
+<screen><userinput>cat &gt;&gt;include/manconfig.h.in &lt;&lt;"EOF"
+<literal>#define WEB_BROWSER "exec /usr/bin/lynx"
+#define COL "/usr/bin/col"
+#define VGRIND "/usr/bin/vgrind"
+#define GRAP "/usr/bin/grap"</literal>
+EOF</userinput></screen>
+
+<para>The <command>col</command> program is a part of the Util-linux package,
+<command>lynx</command> is a text-based web browser
+(see BLFS for installation instructions),
+<command>vgrind</command> converts program sources to Groff input,
+and <command>grap</command> is useful for typesetting graphs in Groff documents.
+The <command>vgrind</command> and <command>grap</command> programs are
+not normally needed for viewing manual pages. They are
+not part of LFS or BLFS, but you should be able to install them yourself
+after finishing LFS if you wish to do so.</para>
+
+<para>Prepare Man-DB for compilation:</para>
+
+<screen><userinput>./configure --prefix=/usr --enable-mb-groff --disable-setuid</userinput></screen>
+
+<para>The meaning of the configure options:</para>
+
+<variablelist>
+<varlistentry>
+<term><parameter>--enable-mb-groff</parameter></term>
+<listitem><para>This tells the <command>man</command> program to
+use the <quote>ascii8</quote> and <quote>nippon</quote> Groff devices for formatting non-ISO-8859-1
+manual pages.</para></listitem>
+</varlistentry>
+<varlistentry>
+<term><parameter>--disable-setuid</parameter></term>
+<listitem><para>This disables making the <command>man</command> program
+setuid to user <quote>man</quote>.</para></listitem>
+</varlistentry>
+</variablelist>
+
+<para>Compile the package:</para>
+
+<screen><userinput>make</userinput></screen>
+
+<para>Install the package:</para>
+
+<screen><userinput>make install</userinput></screen>
+
+<para>Additional information regarding the compression of
+man and info pages can be found in the BLFS book at
+<ulink url="&blfs-root;view/cvs/postlfs/compressdoc.html"/>.</para>
+
+</sect2>
+
+<sect2><title>Non-English Manual Pages in LFS</title>
+
+<para>Linux distributions have different policies concerning the character
+encoding in which manual pages are stored in the filesystem. E.g., RedHat
+stores all manual pages in UTF-8, while Debian uses language-specific
+(mostly 8-bit) encodings. This leads to incompatibility of packages with
+manual pages designed for different distributions.</para>
+
+<para>LFS uses the same conventions as Debian. The relationship between
+language codes and the expected encoding of manual pages is listed below.
+Man-DB automatically converts them to the locale encoding while viewing.</para>
+
+<!-- Origin: man-db-2.4.3/src/encodings.c -->
+<table frame='all'><title>Expected character encoding of manual pages</title>
+<tgroup cols='2' align='center' colsep='1' rowsep='1'>
+<thead>
+<row><entry>Language (code)</entry><entry>Encoding</entry></row>
+</thead>
+<tbody>
+<row><entry>Danish (da)</entry><entry>ISO-8859-1</entry></row>
+<row><entry>German (de)</entry><entry>ISO-8859-1</entry></row>
+<row><entry>English (en)</entry><entry>ISO-8859-1</entry></row>
+<row><entry>Spanish (es)</entry><entry>ISO-8859-1</entry></row>
+<row><entry>Finnish (fi)</entry><entry>ISO-8859-1</entry></row>
+<row><entry>French (fr)</entry><entry>ISO-8859-1</entry></row>
+<row><entry>Irish (ga)</entry><entry>ISO-8859-1</entry></row>
+<row><entry>Galician (gl)</entry><entry>ISO-8859-1</entry></row>
+<row><entry>Indonesian (id)</entry><entry>ISO-8859-1</entry></row>
+<row><entry>Icelandic (is)</entry><entry>ISO-8859-1</entry></row>
+<row><entry>Italian (it)</entry><entry>ISO-8859-1</entry></row>
+<row><entry>Dutch (nl)</entry><entry>ISO-8859-1</entry></row>
+<!-- BUG: "no" is deprecated, should use "nb" or "nn" and symlinks -->
+<row><entry>Norwegian (no)</entry><entry>ISO-8859-1</entry></row>
+<!-- END BUG -->
+<row><entry>Portuguese (pt)</entry><entry>ISO-8859-1</entry></row>
+<row><entry>Swedish (sv)</entry><entry>ISO-8859-1</entry></row>
+<!-- Languages below require patched groff -->
+<row><entry>Czech (cs)</entry><entry>ISO-8859-2</entry></row>
+<row><entry>Croatian (hr)</entry><entry>ISO-8859-2</entry></row>
+<row><entry>Hungarian (hu)</entry><entry>ISO-8859-2</entry></row>
+<row><entry>Japanese (ja)</entry><entry>EUC-JP</entry></row>
+<row><entry>Korean (ko)</entry><entry>EUC-KR</entry></row>
+<row><entry>Polish (pl)</entry><entry>ISO-8859-2</entry></row>
+<row><entry>Russian (ru)</entry><entry>KOI8-R</entry></row>
+<row><entry>Slovak (sk)</entry><entry>ISO-8859-2</entry></row>
+<row><entry>Turkish (tr)</entry><entry>ISO-8859-9</entry></row>
+</tbody>
+</tgroup>
+</table>
+
+<note><para>Manual pages in languages not in the list are not supported.
+Norwegian doesn't work now because of the transition from no_NO to nb_NO
+locale, and Korean is non-functional because of the incomplete Groff patch.
+</para></note>
+
+<para>If upstream distributes the manual pages in the same encoding as
+Man-DB expects, the manual pages can be copied to
+<filename class="directory">/usr/share/man/<replaceable>[language code]</replaceable></filename>.
+E.g., French manual pages
+(<ulink url="http://ccb.club.fr/man/man-fr-1.58.0.tar.bz2"/>)
+can be installed with the following command:</para>
+
+<screen role="nodump"><userinput>mkdir -p /usr/share/man/fr &amp;&amp;
+cp -rv man? /usr/share/man/fr</userinput></screen>
+
+<para>If upstream distributes manual pages in UTF-8 (i.e., <quote>for RedHat</quote>)
+instead of the encoding listed in the table above, they have to be
+converted from UTF-8 to the encoding listed in the table before
+installation. E.g., Spanish manual pages
+(<ulink url="http://ditec.um.es/~piernas/manpages-es/man-pages-es-1.55.tar.bz2"/>)
+can be installed with the following commands:</para>
+
+<screen role="nodump"><userinput>mkdir -p /usr/share/man/es &amp;&amp;
+find man? -type f | grep -v 'man7/iso_8859-7.7' | \
+while read F ; do
+	iconv -f UTF-8 -t ISO-8859-1 $F >tmp ; mv tmp $F
+done &amp;&amp;
+cp -rv man? /usr/share/man/es</userinput></screen>
+
+<note>The need to exclude the <filename>man7/iso_8859-7.7</filename> file
+from the conversion process because it is already in ISO-8859-1 is a packaging
+bug in man-pages-es-1.55. Future versions should not require this workaround.</note>
+
+</sect2>
+
+<sect2 id="contents-man-db" role="content"><title>Contents of Man-DB</title>
+
+<segmentedlist>
+<segtitle>Installed programs</segtitle>
+<seglistitem><seg>accessdb, apropos, catman, lexgrog, man, mandb, manpath,
+and whatis</seg></seglistitem>
+</segmentedlist>
+
+<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
+<?dbfo list-presentation="list"?>
+<?dbhtml list-presentation="table"?>
+
+
+<varlistentry id="accessdb">
+<term><command>accessdb</command></term>
+<listitem>
+<para>Dumps the <command>whatis</command> database contents in human-readable form</para>
+<indexterm zone="ch-system-man-db accessdb"><primary sortas="b-accessdb">accessdb</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="apropos">
+<term><command>apropos</command></term>
+<listitem>
+<para>Searches the <command>whatis</command> database and displays the short descriptions
+of system commands that contain a given string</para>
+<indexterm zone="ch-system-man-db apropos"><primary sortas="b-apropos">apropos</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="catman">
+<term><command>catman</command></term>
+<listitem>
+<para>Creates or updates the pre-formatted manual pages</para>
+<indexterm zone="ch-system-man-db catman"><primary sortas="b-catman">catman</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="lexgrog">
+<term><command>lexgrog</command></term>
+<listitem>
+<para>Displays one-line summary information about a given manual page</para>
+<indexterm zone="ch-system-man-db lexgrog"><primary sortas="b-lexgrog">lexgrog</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="man">
+<term><command>man</command></term>
+<listitem>
+<para>Formats and displays the requested manual page</para>
+<indexterm zone="ch-system-man-db man"><primary sortas="b-man">man</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="mandb">
+<term><command>mandb</command></term>
+<listitem>
+<para>Creates or updates the <command>whatis</command> database</para>
+<indexterm zone="ch-system-man-db mandb"><primary sortas="b-mandb">mandb</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="whatis">
+<term><command>whatis</command></term>
+<listitem>
+<para>Searches the <command>whatis</command> database and displays the short descriptions
+of system commands that contain the given keyword as a separate
+word</para>
+<indexterm zone="ch-system-man-db whatis"><primary sortas="b-whatis">whatis</primary></indexterm>
+</listitem>
+</varlistentry>
+</variablelist>
+
+</sect2>
+
+</sect1>
+
Index: chapter06/man-pages.xml
===================================================================
--- chapter06/man-pages.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/man-pages.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -16,5 +16,5 @@
 <segtitle>&buildtime;</segtitle>
 <segtitle>&diskspace;</segtitle>
-<seglistitem><seg>0.1 SBU</seg><seg>18.4 MB</seg></seglistitem>
+<seglistitem><seg>0.1 SBU</seg><seg>18.6 MB</seg></seglistitem>
 </segmentedlist>
 
Index: chapter06/man.xml
===================================================================
--- chapter06/man.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/man.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -1,180 +1,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
-  <!ENTITY % general-entities SYSTEM "../general.ent">
-  %general-entities;
-]>
-<sect1 id="ch-system-man" role="wrap">
-<title>Man-&man-version;</title>
-<?dbhtml filename="man.html"?>
-
-<indexterm zone="ch-system-man"><primary sortas="a-Man">Man</primary></indexterm>
-
-<sect2 role="package"><title/>
-<para>The Man package contains programs for finding and viewing man pages.</para>
-
-<segmentedlist>
-<segtitle>&buildtime;</segtitle>
-<segtitle>&diskspace;</segtitle>
-<seglistitem><seg>0.1 SBU</seg><seg>1.3 MB</seg></seglistitem>
-</segmentedlist>
-
-<segmentedlist>
-<segtitle>&dependencies;</segtitle>
-<seglistitem><seg>Bash, Binutils, Bzip2, Coreutils, Diffutils, Gawk, GCC,
-Glibc, Grep, Gzip, Less, Make, and Sed</seg></seglistitem>
-</segmentedlist>
-</sect2>
-
-<sect2 role="installation">
-<title>Installation of Man</title>
-
-<para>Two adjustments need to be made to the sources of Man.</para>
-
-<para>The first is a <command>sed</command> substitution to add the
-<parameter>-R</parameter> switch to the <envar>PAGER</envar>
-variable so that escape sequences are properly handled by Less:</para>
-
-<screen><userinput>sed -i 's@-is@&amp;R@g' configure</userinput></screen>
-
-<para>The second is also a <command>sed</command> substitution to comment out the
-<quote>MANPATH /usr/man</quote> line in the
-<filename>man.conf</filename> file to prevent redundant results when
-using programs such as <command>whatis</command>:</para>
-
-<screen><userinput>sed -i 's@MANPATH./usr/man@#&amp;@g' src/man.conf.in</userinput></screen>
-
-<para>Prepare Man for compilation:</para>
-
-<screen><userinput>./configure -confdir=/etc</userinput></screen>
-
-<para>The meaning of the configure options:</para>
-
-<variablelist>
-<varlistentry>
-<term><parameter>-confdir=/etc</parameter></term>
-<listitem><para>This tells the <command>man</command> program to look for the
-<filename>man.conf</filename> configuration file in the <filename
-class="directory">/etc</filename> directory.</para></listitem>
-</varlistentry>
-</variablelist>
-
-<para>Compile the package:</para>
-
-<screen><userinput>make</userinput></screen>
-
-<para>This package does not come with a test suite.</para>
-
-<para>Install the package:</para>
-
-<screen><userinput>make install</userinput></screen>
-
-<note><para>If you will be working on a terminal that does not support text
-attributes such as color and bold, you can disable Select Graphic Rendition
-(SGR) escape sequences by editing the <filename>man.conf</filename> file and
-adding the <parameter>-c</parameter> option to the <envar>NROFF</envar>
-variable. If you use multiple terminal types for one computer it may be better
-to selectively add the <envar>GROFF_NO_SGR</envar> environment variable for the
-terminals that do not support SGR.</para></note>
-
-<para>If the character set of the locale uses 8-bit characters, search for the
-line beginning with <quote>NROFF</quote> in <filename>/etc/man.conf</filename>,
-and verify that it matches the following:</para>
-
-<screen>NROFF  /usr/bin/nroff -Tlatin1 -mandoc</screen>
-
-<para>Note that <quote>latin1</quote> should be used even if it is not
-the character set of the locale. The reason is that, according to the
-specification, <command>groff</command> has no means of typesetting
-characters outside International Organization for Standards
-(ISO) 8859-1 without some strange escape codes. When formatting man
-pages, <command>groff</command> thinks that they are in the ISO 8859-1
-encoding and this <parameter>-Tlatin1</parameter> switch tells
-<command>groff</command> to use the same encoding for output. Since
-<command>groff</command> does no recoding of input characters, the
-formatted result is really in the same encoding as input, and therefore
-it is usable as the input for a pager.</para>
-
-<para>This does not solve the problem of a non-working
-<command>man2dvi</command> program for localized man pages in
-non-ISO 8859-1 locales. Also, it does not work with multibyte
-character sets. The first problem does not currently have a solution.
-The second issue is not of concern because the LFS installation does
-not support multibyte character sets.</para>
-
-<para>Additional information with regards to the compression of
-man and info pages can be found in the BLFS book at
-<ulink url="&blfs-root;view/cvs/postlfs/compressdoc.html"/>.</para>
-
-</sect2>
-
-
-<sect2 id="contents-man" role="content"><title>Contents of Man</title>
-
-<segmentedlist>
-<segtitle>Installed programs</segtitle>
-<seglistitem><seg>apropos, makewhatis, man,
-man2dvi, man2html, and whatis</seg></seglistitem>
-</segmentedlist>
-
-<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
-<?dbfo list-presentation="list"?>
-<?dbhtml list-presentation="table"?>
-
-<varlistentry id="apropos">
-<term><command>apropos</command></term>
-<listitem>
-<para>Searches the <command>whatis</command> database and displays the short descriptions
-of system commands that contain a given string</para>
-<indexterm zone="ch-system-man apropos"><primary sortas="b-apropos">apropos</primary></indexterm>
-</listitem>
-</varlistentry>
-
-<varlistentry id="makewhatis">
-<term><command>makewhatis</command></term>
-<listitem>
-<para>Builds the <command>whatis</command> database; it reads all the man pages
-in the <envar>MANPATH</envar> and writes the name and a short description in the
-<command>whatis</command> database for each page</para>
-<indexterm zone="ch-system-man makewhatis"><primary sortas="b-makewhatis">makewhatis</primary></indexterm>
-</listitem>
-</varlistentry>
-
-<varlistentry id="man">
-<term><command>man</command></term>
-<listitem>
-<para>Formats and displays the requested on-line man page</para>
-<indexterm zone="ch-system-man man"><primary sortas="b-man">man</primary></indexterm>
-</listitem>
-</varlistentry>
-
-<varlistentry id="man2dvi">
-<term><command>man2dvi</command></term>
-<listitem>
-<para>Converts a man page into dvi format</para>
-<indexterm zone="ch-system-man man2dvi"><primary sortas="b-man2dvi">man2dvi</primary></indexterm>
-</listitem>
-</varlistentry>
-
-<varlistentry id="man2html">
-<term><command>man2html</command></term>
-<listitem>
-<para>Converts a man page into HTML</para>
-<indexterm zone="ch-system-man man2html"><primary sortas="b-man2html">man2html</primary></indexterm>
-</listitem>
-</varlistentry>
-
-<varlistentry id="whatis">
-<term><command>whatis</command></term>
-<listitem>
-<para>Searches the <command>whatis</command> database and displays the short descriptions
-of system commands that contain the given keyword as a separate
-word</para>
-<indexterm zone="ch-system-man whatis"><primary sortas="b-whatis">whatis</primary></indexterm>
-</listitem>
-</varlistentry>
-</variablelist>
-
-</sect2>
-
-</sect1>
-
Index: chapter06/mktemp.xml
===================================================================
--- chapter06/mktemp.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/mktemp.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -47,5 +47,6 @@
 <listitem><para>This causes the <command>mktemp</command> program to 
 use the <emphasis>mkstemp</emphasis> and <emphasis>mkdtemp</emphasis>
-functions from the system C library.</para></listitem>
+functions from the system C library instead of its own implementation of them.
+</para></listitem>
 </varlistentry>
 </variablelist>
Index: chapter06/module-init-tools.xml
===================================================================
--- chapter06/module-init-tools.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/module-init-tools.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -40,21 +40,5 @@
 <para>Prepare Module-Init-Tools for compilation:</para>
 
-<screen><userinput>./configure --prefix="" --mandir=/usr/share/man \
-  --enable-zlib</userinput></screen>
-
-<para>The meaning of the configure options:</para>
-
-<variablelist>
-<varlistentry>
-<term><parameter>--mandir=/usr/share/man</parameter></term>
-<listitem><para>This ensures the man pages are installed in the correct
-location.</para></listitem>
-</varlistentry>
-<varlistentry>
-<term><parameter>--enable-zlib</parameter></term>
-<listitem><para>This allows the Module-Init-Tools package to handle compressed
-kernel modules.</para></listitem>
-</varlistentry>
-</variablelist>
+<screen><userinput>./configure --prefix=/ --enable-zlib</userinput></screen>
 
 <para>Compile the package:</para>
Index: chapter06/ncurses.xml
===================================================================
--- chapter06/ncurses.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/ncurses.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -29,8 +29,47 @@
 <sect2 role="installation">
 <title>Installation of Ncurses</title>
+<!-- Uncomment if using a dated ncurses release instead of a numbered one.
+
+<para>Since the release of Ncurses-&ncurses-version;, some bugs have been fixed
+and features added. The most important news are .......
+To get these fixes and features, apply the rollup patch:</para>
+
+<screen><userinput>bzcat ../&ncurses-rollup-patch; | patch -Np1</userinput></screen>
+-->
+
+<para>Since the release of Ncurses-&ncurses-version;, a memory leak and some
+display bugs were found and fixed upstream. Apply those fixes:</para>
+
+<screen><userinput>patch -Np1 -i ../&ncurses-fixes-patch;</userinput></screen>
 
 <para>Prepare Ncurses for compilation:</para>
 
-<screen><userinput>./configure --prefix=/usr --with-shared --without-debug</userinput></screen>
+<screen><userinput>./configure --prefix=/usr --with-shared --without-debug --enable-widec</userinput></screen>
+
+<para>The meaning of the configure options:</para>
+
+<variablelist>
+<varlistentry>
+<term><parameter>--enable-widec</parameter></term>
+<listitem><para>This switch causes wide-character libraries
+(e.g., <filename class="libraryfile">libncursesw.so.&ncurses-version;</filename>)
+to be built instead of normal ones
+(e.g., <filename class="libraryfile">libncurses.so.&ncurses-version;</filename>).
+These wide-character libraries are usable in both multibyte and traditional 8-bit
+locales, while normal libraries work properly only in 8-bit locales.
+Wide-character and normal libraries are source-compatible, but not
+binary-compatible.</para>
+</listitem>
+</varlistentry>
+<!--
+<varlistentry>
+<term><parameter>- -without-cxx-binding</parameter></term>
+<listitem><para>This optional switch causes the
+<filename class="libraryfile">libncurses++w.a</filename> library
+not to be built. Nothing in LFS and BLFS uses this library.</para>
+</listitem>
+</varlistentry>
+-->
+</variablelist>
 
 <para>Compile the package:</para>
@@ -50,16 +89,47 @@
 <para>Fix a library that should not be executable:</para>
 
-<screen><userinput>chmod -v 644 /usr/lib/libncurses++.a</userinput></screen>
+<screen><userinput>chmod -v 644 /usr/lib/libncurses++w.a</userinput></screen>
 
 <para>Move the libraries to the <filename class="directory">/lib</filename> directory,
 where they are expected to reside:</para>
 
-<screen><userinput>mv -v /usr/lib/libncurses.so.5* /lib</userinput></screen>
-
-<para>Because the libraries have been moved, a few symlinks point to
-non-existent files. Recreate those symlinks:</para>
-
-<screen><userinput>ln -sfv ../../lib/libncurses.so.5 /usr/lib/libncurses.so
-ln -sfv libncurses.so /usr/lib/libcurses.so</userinput></screen>
+<screen><userinput>mv -v /usr/lib/libncursesw.so.5* /lib</userinput></screen>
+
+<para>Because the libraries have been moved, one symlink points to
+a non-existent file. Recreate it:</para>
+
+<screen><userinput>ln -sfv ../../lib/libncursesw.so.5 /usr/lib/libncursesw.so</userinput></screen>
+
+<para>Many applications still expect the linker to be able to find
+non-wide-character Ncurses libraries. Trick such applications into linking with
+wide-character libraries by means of symlinks and linker scripts:</para>
+
+<screen><userinput>for lib in curses ncurses form panel menu ; do \
+	rm -vf /usr/lib/lib${lib}.so ; \
+	echo "INPUT(-l${lib}w)" &gt;/usr/lib/lib${lib}.so ; \
+	ln -sfv lib${lib}w.a /usr/lib/lib${lib}.a ; \
+done &amp;&amp;
+ln -sfv libncurses++w.a /usr/lib/libncurses++.a</userinput></screen>
+
+<para>Finally, make sure that old applications that look for
+<filename class="libaryfile">-lcurses</filename> at build time are still
+buildable:</para>
+
+<screen><userinput>echo "INPUT(-lncursesw)" &gt;/usr/lib/libcursesw.so &amp;&amp;
+ln -sfv libncurses.so /usr/lib/libcurses.so &amp;&amp;
+ln -sfv libncursesw.a /usr/lib/libcursesw.a &amp;&amp;
+ln -sfv libncurses.a /usr/lib/libcurses.a</userinput></screen>
+
+<note><para>The instructions above don't create non-wide-character Ncurses
+libraries since no package installed by compiling from sources would link
+against them at runtime.
+If you must have such libraries because of some binary-only application,
+build them with the following commands:</para>
+<screen role="nodump"><userinput>make distclean &amp;&amp;
+./configure --prefix=/usr --with-shared --without-normal \
+	--without-debug --without-cxx-binding &amp;&amp;
+make sources libs &amp;&amp;
+cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
+</note>
 </sect2>
 
@@ -72,6 +142,8 @@
 <seglistitem><seg>captoinfo (link to tic), clear, infocmp, infotocap (link to tic), 
 reset (link to tset), tack, tic, toe, tput, and tset</seg>
-<seg>libcurses.[a,so] (link to libncurses.[a,so]), libform.[a,so], libmenu.[a,so], 
-libncurses++.a, libncurses.[a,so], and libpanel.[a,so]</seg></seglistitem>
+<seg>libcursesw.[a,so] (symlink and linker script to libncursesw.[a,so]),
+libformw.[a,so], libmenuw.[a,so], 
+libncurses++w.a, libncursesw.[a,so], libpanelw.[a,so] and their
+non-wide-character counterparts without "w" in the library names.</seg></seglistitem>
 </segmentedlist>
 
@@ -213,3 +285,2 @@
 
 </sect1>
-
Index: chapter06/perl.xml
===================================================================
--- chapter06/perl.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/perl.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -21,5 +21,5 @@
 <segmentedlist>
 <segtitle>&dependencies;</segtitle>
-<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils,
+<seglistitem><seg>Bash, Binutils, Coreutils, DB, Diffutils,
 Gawk, GCC, Glibc, Grep, Iana-Etc, Make, Patch, and Sed</seg></seglistitem>
 </segmentedlist>
Index: chapter06/psmisc.xml
===================================================================
--- chapter06/psmisc.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/psmisc.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -104,4 +104,12 @@
 </varlistentry>
 
+<varlistentry id="oldfuser">
+<term><command>oldfuser</command></term>
+<listitem>
+<para>Reports the Process IDs (PIDs) of processes that use the given files or file systems</para>
+<indexterm zone="ch-system-psmisc oldfuser"><primary sortas="b-oldfuser">oldfuser</primary></indexterm>
+</listitem>
+</varlistentry>
+
 <varlistentry id="pstree">
 <term><command>pstree</command></term>
Index: chapter06/readline.xml
===================================================================
--- chapter06/readline.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/readline.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -44,5 +44,7 @@
 <term><parameter>SHLIB_LIBS=-lncurses</parameter></term>
 <listitem><para>This option forces Readline to link against the
-<filename class="libraryfile">libncurses</filename> library.</para></listitem>
+<filename class="libraryfile">libncurses</filename>
+(really, <filename class="libraryfile">libncursesw</filename>)
+library.</para></listitem>
 </varlistentry>
 </variablelist>
Index: chapter06/shadow.xml
===================================================================
--- chapter06/shadow.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/shadow.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -48,4 +48,9 @@
 <screen><userinput>sed -i 's/groups$(EXEEXT) //' src/Makefile
 find man -name Makefile -exec sed -i '/groups/d' {} \;</userinput></screen>
+
+<para>Disable the installation of Chinese and Korean manual pages, since Man-DB
+cannot format them properly:</para>
+
+<screen><userinput>sed -i -e 's/ ko//' -e 's/ zh_CN zh_TW//' man/Makefile</userinput></screen>
 
 <para>Compile the package:</para>
Index: chapter06/sysklogd.xml
===================================================================
--- chapter06/sysklogd.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/sysklogd.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -33,4 +33,10 @@
 
 <screen><userinput>patch -Np1 -i ../&sysklogd-fixes-patch;</userinput></screen>
+
+<para>The following patch makes sysklogd treat bytes in the 0x80--0x9f range
+literally in the messages being logged, instead of replacing them with octal
+codes. Unpatched sysklogd would damage messages in the UTF-8 encoding.</para>
+
+<screen><userinput>patch -Np1 -i ../&sysklogd-8bit-patch;</userinput></screen>
 
 <para>Compile the package:</para>
Index: chapter06/sysvinit.xml
===================================================================
--- chapter06/sysvinit.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/sysvinit.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -85,24 +85,13 @@
 su:S016:once:/sbin/sulogin
 
-1:2345:respawn:/sbin/agetty -I '\033(K' tty1 9600
-2:2345:respawn:/sbin/agetty -I '\033(K' tty2 9600
-3:2345:respawn:/sbin/agetty -I '\033(K' tty3 9600
-4:2345:respawn:/sbin/agetty -I '\033(K' tty4 9600
-5:2345:respawn:/sbin/agetty -I '\033(K' tty5 9600
-6:2345:respawn:/sbin/agetty -I '\033(K' tty6 9600
+1:2345:respawn:/sbin/agetty tty1 9600
+2:2345:respawn:/sbin/agetty tty2 9600
+3:2345:respawn:/sbin/agetty tty3 9600
+4:2345:respawn:/sbin/agetty tty4 9600
+5:2345:respawn:/sbin/agetty tty5 9600
+6:2345:respawn:/sbin/agetty tty6 9600
 
 # End /etc/inittab</literal>
 EOF</userinput></screen>
-
-<para>The <parameter>-I '\033(K'</parameter> option tells
-<command>agetty</command> to send this escape sequence to the terminal
-before doing anything else. This escape sequence switches the console
-character set to a user-defined one, which can be modified by running
-the <command>setfont</command> program. The <command>console</command>
-initscript from the LFS-Bootscripts package calls the <command>setfont</command>
-program during system startup. Sending this escape sequence is
-necessary for people who use non-ISO 8859-1 screen fonts, but it does
-not affect native English speakers.</para>
-
 </sect2>
 
Index: chapter06/texinfo.xml
===================================================================
--- chapter06/texinfo.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/texinfo.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -29,4 +29,12 @@
 <sect2 role="installation">
 <title>Installation of Texinfo</title>
+
+<para>The <command>info</command> program makes assumptions such as that
+a string occupies the same number of character cells on the screen and bytes
+in memory and that one can break the string anywhere, which fail in
+UTF-8 based locales. The patch below makes them valid
+by falling back to English messages when a multibyte locale is in use:</para>
+
+<screen><userinput>patch -Np1 -i ../&texinfo-multibyte-patch;</userinput></screen>
 
 <para>Texinfo allows local users to overwrite arbitrary files via a symlink
@@ -64,4 +72,5 @@
 </varlistentry>
 </variablelist>
+<!-- FIXME: doesn't the TeX installation in BLFS overwrite files there? -->
 
 <para>The Info documentation system uses a plain text file to hold its
Index: chapter06/udev.xml
===================================================================
--- chapter06/udev.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/udev.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -79,4 +79,5 @@
 <screen><userinput>install -m644 -D -v docs/writing_udev_rules/index.html /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
 
+<!-- Not for the LiveCD -->
 <!-- Edit Me -->
 <para>Run the <command>udevstart</command> program to create our full
Index: chapter06/vim.xml
===================================================================
--- chapter06/vim.xml	(revision 1714f1afcae03cc55205629ee59f105852c15f3d)
+++ chapter06/vim.xml	(revision 46a2e9c7d603a2a160f8de8741a7750de935d848)
@@ -54,5 +54,5 @@
 <varlistentry>
 <term><parameter>--enable-multibyte</parameter></term>
-<listitem><para>This optional but highly recommended switch enables support for
+<listitem><para>This switch enables support for
 editing files in multibyte character encodings.  This is needed if using a
 locale with a multibyte character set. This switch is also helpful to be able to
@@ -74,23 +74,17 @@
 <para>Install the package:</para>
 
-<screen><userinput>make HELPSUBLOC=/usr/share/doc/vim-&vim-version; install</userinput></screen>
-
-<para>The meaning of the make option:</para>
-
-<variablelist>
-  <varlistentry>
-    <term><parameter>HELPSUBLOC=/usr/share/doc/vim-&vim-version;</parameter>
-    </term>
-    <listitem>
-      <para>This defines the directory that Vim's documentation will be
-        installed in.  By default, Vim's documentation is installed in the
-        <filename class="directory">/usr/share/vim</filename> hierarchy. Other
-        packages install their documentation in the
-        <filename class="directory">/usr/share/doc</filename> hierarchy, so the
-        <parameter>HELPSUBLOC</parameter> option is used to ensure consistency.
-      </para>
-    </listitem>
-  </varlistentry>
-</variablelist>
+<screen><userinput>make install</userinput></screen>
+
+<para>In UTF-8 locales, the <command>vimtutor</command> program
+tries to convert the tutorials from ISO-8859-1 to UTF-8. Since
+some tutorials are not in ISO-8859-1, the text in them is thus made unreadable.
+If you unpacked the <filename>vim-&vim-version;-lang.tar.gz</filename>
+archive and are going to use a UTF-8 based locale, remove non-ISO-8859-1
+tutorials. An English tutorial will be used instead.</para>
+<!-- Removal is used instead of conversion in order for the user to be able to
+painlessly revert his UTF-8 locale choice. -->
+
+<screen><userinput>rm -f /usr/share/vim/vim63/tutor/tutor.{gr,pl,ru,sk}
+rm -f /usr/share/vim/vim63/tutor/tutor.??.*</userinput></screen>
 
 <para>Many users are used to using <command>vi</command> instead of
@@ -100,4 +94,12 @@
 
 <screen><userinput>ln -sv vim /usr/bin/vi</userinput></screen>
+
+<para>By default, Vim's documentation is installed in
+<filename class="directory">/usr/share/vim</filename>.  The following symlink
+allows the documentation to be accessed via
+<filename class="directory">/usr/share/doc/vim-&vim-version;</filename>, making
+it consistent with the location of documentation for other packages:</para>
+
+<screen><userinput>ln -sv ../vim/vim64/doc /usr/share/doc/vim-&vim-version;</userinput></screen>
 
 <para>If an X Window System is going to be installed on the LFS
