glfs/shareddeps/security/libxml2.xml
2024-10-19 15:42:14 -06:00

265 lines
7.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!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 "https://download.gnome.org/sources/libxml2/2.13/libxml2-&libxml2-version;.tar.xz">
<!-- <!ENTITY libxml2-download-http "http://xmlsoft.org/sources/libxml2-&libxml2-version;.tar.xz">-->
<!ENTITY libxml2-download-ftp " ">
]>
<sect1 id="libxml2" xreflabel="libxml2-&libxml2-version;">
<?dbhtml filename="libxml2.html"?>
<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>
<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>
</itemizedlist>
<bridgehead renderas="sect3">libxml2 Dependencies</bridgehead>
<bridgehead renderas="sect4">Recommended</bridgehead>
<para role="recommended">
<xref linkend="icu"/>
</para>
</sect2>
<sect2 role="installation">
<title>Installation of libxml2</title>
<para>
Install <application>libxml2</application> by running the following
commands:
</para>
<screen><userinput>./configure --prefix=/usr \
--sysconfdir=/etc \
--disable-static \
--with-history \
--with-icu \
PYTHON=/usr/bin/python3 \
--docdir=/usr/share/doc/libxml2-&libxml2-version; &amp;&amp;
make</userinput></screen>
<para>
Now, as the <systemitem class="username">root</systemitem> user:
</para>
<screen role="root"><userinput>make install</userinput></screen>
<para>
Finally, prevent some packages from unnecessarily linking to ICU using
the following commands as the &root; user:
</para>
<screen role="root"><userinput>rm -vf /usr/lib/libxml2.la &amp;&amp;
sed '/libs=/s/xml2.*/xml2"/' -i /usr/bin/xml2-config</userinput></screen>
</sect2>
<sect2 role="installation">
<title>32-bit Installation of libxml2</title>
<para>
First clean the directory:
</para>
<screen><userinput>make distclean</userinput></screen>
<para>
Install lib32-<application>libxml2</application> by running the following
commands:
</para>
<screen><userinput>CC="gcc -m32" CXX="g++ -m32" \
PKG_CONFIG_PATH=/usr/lib32/pkgconfig \
./configure --prefix=/usr \
--libdir=/usr/lib32 \
--host=i686-pc-linux-gnu \
--sysconfdir=/etc \
--disable-static \
--with-history \
--with-icu \
--without-python &amp;&amp;
make</userinput></screen>
<para>
Now, as the <systemitem class="username">root</systemitem> user:
</para>
<screen role="root"><userinput>make DESTDIR=$PWD/DESTDIR install &amp;&amp;
rm -vf DESTDIR/usr/lib32/libxml2.la &amp;&amp;
cp -Rv DESTDIR/usr/lib32/* /usr/lib32 &amp;&amp;
rm -rf DESTDIR &amp;&amp;
ldconfig</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-icu</parameter>: This switch enables support for
<application>ICU</application>, which provides additional Unicode support.
This is needed for some packages outside of GLFS, such as for QtWebEngine.
</para>
<para>
<parameter>PYTHON=/usr/bin/python3</parameter>: Allows building
the libxml2 module with Python3 instead of Python2.
</para>
<para>
<parameter>--without-python</parameter>: This switch disables building
this package for 32-bit on a 64-bit system with Python support as it
cannot find Python.
</para>
<!--
<para>
<option>- -with-icu</option>: Add this switch if you have built
<xref linkend="icu"/>, for better unicode support.
</para>
<note>
<para>
If the <option>- -with-icu</option> switch is used, the BLFS editors
recommend removing unneeded references to the ICU libraries. This
will prevent many packages that use libxml2 from unnecessarily linking
to the ICU libraries. This, in turn, will prevent the need for
rebuilding many packages when upgrading ICU to a new major version.
After installing libxml2, as the &root; user, issue:
</para>
<screen role="nodump"><userinput>rm -vf /usr/lib/libxml2.la &amp;&amp;
sed '/libs=/s/xml2.*/xml2"/' -i /usr/bin/xml2-config</userinput></screen>
</note>
-->
</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
</seg>
<seg>
libxml2.so
</seg>
<seg>
/usr/include/libxml2,
/usr/lib/cmake/libxml2,
/usr/share/doc/libxml2-&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="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>
</variablelist>
</sect2>
</sect1>