glfs/general/genlib/libxml2.xml
Pierre Labastie 0b312a78d3 Remove reference to python2 in libxml2 (except in a note), and do some cleaning
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@24343 af4574ff-66df-0310-9fd7-8a98e5e911e0
2021-03-05 16:33:24 +00:00

362 lines
12 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!-- Also update the download, md5, size entities in libxml2py2.xml -->
<!ENTITY libxml2-download-http "http://xmlsoft.org/sources/libxml2-&libxml2-version;.tar.gz">
<!ENTITY libxml2-download-ftp "ftp://xmlsoft.org/libxml2/libxml2-&libxml2-version;.tar.gz">
<!ENTITY libxml2-md5sum "10942a1dc23137a8aa07f0639cbfece5">
<!ENTITY libxml2-size "5.4 MB">
<!ENTITY libxml2-buildsize "87 MB (add 15 MB for tests)">
<!ENTITY libxml2-time "0.2 SBU (add 0.3 SBU for tests)">
<!ENTITY testsuite-version "20130923">
]>
<sect1 id="libxml2" xreflabel="libxml2-&libxml2-version;">
<?dbhtml filename="libxml2.html"?>
<sect1info>
<othername>$LastChangedBy$</othername>
<date>$Date$</date>
</sect1info>
<title>libxml2-&libxml2-version;</title>
<indexterm zone="libxml2">
<primary sortas="a-libxml2">libxml2</primary>
</indexterm>
<sect2 role="package">
<title>Introduction to libxml2</title>
<para>
The <application>libxml2</application> package contains libraries
and utilities used for parsing XML files.
</para>
&lfs101_checked;
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>
Download (HTTP): <ulink url="&libxml2-download-http;"/>
</para>
</listitem>
<listitem>
<para>
Download (FTP): <ulink url="&libxml2-download-ftp;"/>
</para>
</listitem>
<listitem>
<para>
Download MD5 sum: &libxml2-md5sum;
</para>
</listitem>
<listitem>
<para>
Download size: &libxml2-size;
</para>
</listitem>
<listitem>
<para>
Estimated disk space required: &libxml2-buildsize;
</para>
</listitem>
<listitem>
<para>
Estimated build time: &libxml2-time;
</para>
</listitem>
</itemizedlist>
<bridgehead renderas="sect3">Additional Downloads</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>
Required patch:
<ulink url="&patch-root;/libxml2-&libxml2-version;-security_fixes-1.patch"/>
</para>
</listitem>
<listitem>
<para>
Optional Testsuite:
<ulink url="http://www.w3.org/XML/Test/xmlts&testsuite-version;.tar.gz"/> - This
enables <command>make check</command> to do complete testing.
</para>
</listitem>
</itemizedlist>
<bridgehead renderas="sect3">libxml2 Dependencies</bridgehead>
<!-- do not advertize python2 here, except in the note below
<bridgehead renderas="sect4">Optional</bridgehead>
<para role="optional">
<xref linkend="python2"/>
</para>
-->
<bridgehead renderas="sect4">Optional</bridgehead>
<para role="optional">
<xref linkend="icu"/> (see below) and
<xref linkend="valgrind"/> (may be used in the tests)
</para>
<note>
<!-- python3 is always available now
<para>
Some packages which utilize <application>libxml2</application> (such as
<application>GNOME Doc Utils</application>) need the
<application>Python3</application> module installed to function properly
and some packages will not build properly if the
<application>Python3</application> module is not available.
</para>
-->
<para>
The old <application>Python2</application> module can be built after
<filename class="libraryfile">libxml2.so</filename> has been installed,
see <xref linkend="libxml2py2"/>.
</para>
</note>
<para condition="html" role="usernotes">
User Notes: <ulink url="&blfs-wiki;/libxml2"/>
</para>
</sect2>
<sect2 role="installation">
<title>Installation of libxml2</title>
<para>
Apply a patch to fix various errors:
</para>
<screen><userinput remap="pre">patch -p1 -i ../libxml2-&libxml2-version;-security_fixes-1.patch</userinput></screen>
<para>
Fix a problem generating the Python3 module with Python-3.9.0 and
later:
</para>
<screen><userinput>sed -i '/if Py/{s/Py/(Py/;s/)/))/}' python/{types.c,libxml.c}</userinput></screen>
<para>
If you are going to run the tests, disable one test that causes the Python
tests to terminate early with an error:
</para>
<screen><userinput>sed -i 's/test.test/#&amp;/' python/tests/tstLastError.py</userinput></screen>
<para>
If, and only if, you are using <xref linkend="icu"/>, fix a
build breakage caused by that version by running the following command:
</para>
<screen><userinput>sed -i 's/ TRUE/ true/' encoding.c</userinput></screen>
<para>
Install <application>libxml2</application> by running the following
commands:
</para>
<screen><userinput>./configure --prefix=/usr \
--disable-static \
--with-history \
--with-python=/usr/bin/python3 &amp;&amp;
make</userinput></screen>
<para>
If you downloaded the testsuite, issue the following command:
</para>
<screen><userinput>tar xf ../xmlts&testsuite-version;.tar.gz</userinput></screen>
<para>
To test the results, issue: <command>make check &gt; check.log</command>.
A summary of the results can be obtained with <command>grep -E
'^Total|expected' check.log</command>. If <xref linkend="valgrind"/> is
installed and you want to check memory leaks, replace
<command>check</command> with <command>check-valgrind</command>.
</para>
<note>
<para>
The tests use <ulink url="http://localhost/">http://localhost/</ulink>
to test parsing of external entities. If the machine where you run the
tests serves as a web site, the tests may hang, depending on the
content of the file served. It is therefore recommended to shut down
the server during the tests, as the <systemitem
class="username">root</systemitem> user:
</para>
<screen role="nodump" revision="sysv"><userinput>/etc/init.d/httpd stop</userinput></screen>
<screen role="nodump" revision="systemd"><userinput>systemctl stop httpd.service</userinput></screen>
</note>
<para>
Now, as the <systemitem class="username">root</systemitem> user:
</para>
<screen role="root"><userinput>make install</userinput></screen>
</sect2>
<sect2 role="commands">
<title>Command Explanations</title>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="../../xincludes/static-libraries.xml"/>
<para>
<parameter>--with-history</parameter>: This switch enables
<application>Readline</application> support when running
<command>xmlcatalog</command> or <command>xmllint</command> in shell mode.
</para>
<para>
<parameter>--with-python=/usr/bin/python3</parameter>: Allows building
the libxml2 module with Python3 instead of Python2.
</para>
<para>
<option>--with-icu</option>: Add this switch if you have built
<xref linkend="icu"/>, for better unicode support.
</para>
<para>
<option>--with-threads</option>: Add this switch to enable multithread
support.
</para>
</sect2>
<sect2 role="content">
<title>Contents</title>
<segmentedlist>
<segtitle>Installed Programs</segtitle>
<segtitle>Installed Libraries</segtitle>
<segtitle>Installed Directories</segtitle>
<seglistitem>
<seg>
xml2-config,
xmlcatalog, and
xmllint <!--and the
drv_libxml2.py and libxml2.py <application>Python3</application>
modules. These are pythin modules, not programs -->
</seg>
<seg>
libxml2.so and
libxml2mod.so (<application>Python3</application> module)
</seg>
<seg>
/usr/include/libxml2,
/usr/lib/cmake/libxml2,
/usr/share/doc/libxml2-&libxml2-version;,
/usr/share/doc/libxml2-python-&libxml2-version;, and
/usr/share/gtk-doc/html/libxml2
</seg>
</seglistitem>
</segmentedlist>
<variablelist>
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
<varlistentry id="xml2-config">
<term><command>xml2-config</command></term>
<listitem>
<para>
determines the compile and linker flags that should be used to
compile and link programs that use
<filename class="libraryfile">libxml2</filename>
</para>
<indexterm zone="libxml2 xml2-config">
<primary sortas="b-xml2-config">xml2-config</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="xmlcatalog">
<term><command>xmlcatalog</command></term>
<listitem>
<para>
is used to monitor and manipulate XML and SGML catalogs
</para>
<indexterm zone="libxml2 xmlcatalog">
<primary sortas="b-xmlcatalog">xmlcatalog</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="xmllint">
<term><command>xmllint</command></term>
<listitem>
<para>
parses XML files and outputs reports (based upon options) to detect
errors in XML coding
</para>
<indexterm zone="libxml2 xmllint">
<primary sortas="b-xmllint">xmllint</primary>
</indexterm>
</listitem>
</varlistentry>
<!--
<varlistentry id="drv_libxml2.py3">
<term><command>drv_libxml2.py</command></term>
<listitem>
<para>
is a SAX <application>Python3</application> driver for libxml2.
</para>
<indexterm zone="libxml2 drv_libxml2.py3">
<primary sortas="b-drv_libxml2.py3">drv_libxml2.py for Python3</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="libxml2.py3">
<term><command>libxml2.py</command></term>
<listitem>
<para>
is the <application>Python3</application> binding for libxml2.
</para>
<indexterm zone="libxml2 libxml2.py3">
<primary sortas="b-libxml2.py3">libxml2.py for Python3</primary>
</indexterm>
</listitem>
</varlistentry>
-->
<varlistentry id="libxml2-lib">
<term><filename class="libraryfile">libxml2.so</filename></term>
<listitem>
<para>
provides functions for programs to parse files that use the XML
format
</para>
<indexterm zone="libxml2 libxml2-lib">
<primary sortas="c-libxml2">libxml2.so</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="libxml2mod3">
<term><filename class="libraryfile">libxml2mod.so</filename></term>
<listitem>
<para>
is the interface for <application>Python3</application>
to use <filename class="libraryfile">libxml2.so</filename>
</para>
<indexterm zone="libxml2 libxml2mod3">
<primary sortas="c-libxml2mod">libxml2mod.so</primary>
</indexterm>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>