[52d29f7] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[52d29f7] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[382abcaf] | 7 | <!-- Also update the download, md5, size entities in libxml2py2.xml -->
|
---|
[8180b89] | 8 | <!ENTITY libxml2-download-http "http://xmlsoft.org/sources/libxml2-&libxml2-version;.tar.gz">
|
---|
| 9 | <!ENTITY libxml2-download-ftp "ftp://xmlsoft.org/libxml2/libxml2-&libxml2-version;.tar.gz">
|
---|
[df013c7f] | 10 | <!ENTITY libxml2-md5sum "10942a1dc23137a8aa07f0639cbfece5">
|
---|
| 11 | <!ENTITY libxml2-size "5.4 MB">
|
---|
| 12 | <!ENTITY libxml2-buildsize "87 MB (add 15 MB for tests)">
|
---|
[0065e69] | 13 | <!ENTITY libxml2-time "0.2 SBU (add 0.3 SBU for tests)">
|
---|
[6b262734] | 14 | <!ENTITY testsuite-version "20130923">
|
---|
[52d29f7] | 15 | ]>
|
---|
| 16 |
|
---|
[f45b1953] | 17 | <sect1 id="libxml2" xreflabel="libxml2-&libxml2-version;">
|
---|
[1515ed8a] | 18 | <?dbhtml filename="libxml2.html"?>
|
---|
[8e75f8b9] | 19 |
|
---|
[1515ed8a] | 20 | <sect1info>
|
---|
| 21 | <othername>$LastChangedBy$</othername>
|
---|
| 22 | <date>$Date$</date>
|
---|
| 23 | </sect1info>
|
---|
[8e75f8b9] | 24 |
|
---|
[437700ae] | 25 | <title>libxml2-&libxml2-version;</title>
|
---|
[8e75f8b9] | 26 |
|
---|
[1515ed8a] | 27 | <indexterm zone="libxml2">
|
---|
[8180b89] | 28 | <primary sortas="a-libxml2">libxml2</primary>
|
---|
[1515ed8a] | 29 | </indexterm>
|
---|
| 30 |
|
---|
| 31 | <sect2 role="package">
|
---|
[437700ae] | 32 | <title>Introduction to libxml2</title>
|
---|
[8e75f8b9] | 33 |
|
---|
[325113f8] | 34 | <para>
|
---|
[8180b89] | 35 | The <application>libxml2</application> package contains libraries
|
---|
| 36 | and utilities used for parsing XML files.
|
---|
[325113f8] | 37 | </para>
|
---|
[8e75f8b9] | 38 |
|
---|
[eeaa41b7] | 39 | &lfs10_checked;
|
---|
[7f4cdbc0] | 40 |
|
---|
[1515ed8a] | 41 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 42 | <itemizedlist spacing="compact">
|
---|
| 43 | <listitem>
|
---|
[8180b89] | 44 | <para>
|
---|
| 45 | Download (HTTP): <ulink url="&libxml2-download-http;"/>
|
---|
| 46 | </para>
|
---|
[1515ed8a] | 47 | </listitem>
|
---|
| 48 | <listitem>
|
---|
[8180b89] | 49 | <para>
|
---|
| 50 | Download (FTP): <ulink url="&libxml2-download-ftp;"/>
|
---|
| 51 | </para>
|
---|
[1515ed8a] | 52 | </listitem>
|
---|
| 53 | <listitem>
|
---|
[8180b89] | 54 | <para>
|
---|
| 55 | Download MD5 sum: &libxml2-md5sum;
|
---|
| 56 | </para>
|
---|
[1515ed8a] | 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
[8180b89] | 59 | <para>
|
---|
| 60 | Download size: &libxml2-size;
|
---|
| 61 | </para>
|
---|
[1515ed8a] | 62 | </listitem>
|
---|
| 63 | <listitem>
|
---|
[8180b89] | 64 | <para>
|
---|
| 65 | Estimated disk space required: &libxml2-buildsize;
|
---|
| 66 | </para>
|
---|
[1515ed8a] | 67 | </listitem>
|
---|
| 68 | <listitem>
|
---|
[8180b89] | 69 | <para>
|
---|
| 70 | Estimated build time: &libxml2-time;
|
---|
| 71 | </para>
|
---|
[1515ed8a] | 72 | </listitem>
|
---|
| 73 | </itemizedlist>
|
---|
[8e75f8b9] | 74 |
|
---|
[9a788838] | 75 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
[8180b89] | 76 | <itemizedlist spacing="compact">
|
---|
[277c9f4e] | 77 | <listitem>
|
---|
| 78 | <para>
|
---|
| 79 | Required patch:
|
---|
| 80 | <ulink url="&patch-root;/libxml2-&libxml2-version;-security_fixes-1.patch"/>
|
---|
| 81 | </para>
|
---|
| 82 | </listitem>
|
---|
[5da63eb] | 83 | <listitem>
|
---|
[325113f8] | 84 | <para>
|
---|
| 85 | Optional Testsuite:
|
---|
[6b262734] | 86 | <ulink url="http://www.w3.org/XML/Test/xmlts&testsuite-version;.tar.gz"/> - This
|
---|
[325113f8] | 87 | enables <command>make check</command> to do complete testing.
|
---|
| 88 | </para>
|
---|
[5da63eb] | 89 | </listitem>
|
---|
[9a788838] | 90 | </itemizedlist>
|
---|
[5da63eb] | 91 |
|
---|
[437700ae] | 92 | <bridgehead renderas="sect3">libxml2 Dependencies</bridgehead>
|
---|
[8e75f8b9] | 93 |
|
---|
[60ddbaf] | 94 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 95 | <para role="optional">
|
---|
| 96 | <xref linkend="python2"/> <!--or <xref linkend="python3"/> (to build and
|
---|
[ca25773c] | 97 | install a <application>Python</application> library module, additionally
|
---|
[60ddbaf] | 98 | it is required to run the full suite of tests)-->
|
---|
[40eb6f7] | 99 | <!-- As discovered by Bruce, itstool needs this module. -->
|
---|
[325113f8] | 100 | </para>
|
---|
[0af6ce1] | 101 |
|
---|
[1aadfdf] | 102 | <note>
|
---|
[325113f8] | 103 | <para>
|
---|
| 104 | Some packages which utilize <application>libxml2</application> (such as
|
---|
| 105 | <application>GNOME Doc Utils</application>) need the
|
---|
[cd964c8] | 106 | <application>Python3</application> module installed to function properly
|
---|
[5bee197] | 107 | and some packages will not build properly if the
|
---|
[cd964c8] | 108 | <application>Python3</application> module is not available.
|
---|
| 109 | </para>
|
---|
| 110 |
|
---|
| 111 | <para>
|
---|
| 112 | The old <application>Python2</application> module can be built after
|
---|
| 113 | <filename class="libraryfile">libxml2.so</filename> has been installed,
|
---|
| 114 | see <xref linkend="libxml2py2"/>.
|
---|
[325113f8] | 115 | </para>
|
---|
[1aadfdf] | 116 | </note>
|
---|
| 117 |
|
---|
[3fe6951] | 118 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[ec91d9f2] | 119 | <para role="optional">
|
---|
[84b29ba] | 120 | <xref linkend="icu"/> (see below) and
|
---|
[ec91d9f2] | 121 | <xref linkend="valgrind"/> (may be used in the tests)
|
---|
| 122 | </para>
|
---|
| 123 |
|
---|
[325113f8] | 124 | <para condition="html" role="usernotes">
|
---|
| 125 | User Notes: <ulink url="&blfs-wiki;/libxml2"/>
|
---|
| 126 | </para>
|
---|
[1515ed8a] | 127 | </sect2>
|
---|
[8e75f8b9] | 128 |
|
---|
[1515ed8a] | 129 | <sect2 role="installation">
|
---|
[437700ae] | 130 | <title>Installation of libxml2</title>
|
---|
[1b8bba3] | 131 |
|
---|
[cc2643e1] | 132 | <para>
|
---|
[277c9f4e] | 133 | Apply a patch to fix various errors:
|
---|
| 134 | </para>
|
---|
| 135 |
|
---|
| 136 | <screen><userinput remap="pre">patch -p1 -i ../libxml2-&libxml2-version;-security_fixes-1.patch</userinput></screen>
|
---|
| 137 |
|
---|
[4696884] | 138 | <para>
|
---|
[1b8bba3] | 139 | First fix a problem generating the Python3 module with Python-3.9.0 and later:
|
---|
[cc2643e1] | 140 | </para>
|
---|
| 141 |
|
---|
[1b8bba3] | 142 | <screen><userinput>sed -i '/if Py/{s/Py/(Py/;s/)/))/}' python/{types.c,libxml.c}</userinput></screen>
|
---|
[cc2643e1] | 143 |
|
---|
[4696884] | 144 | <!--<para>
|
---|
[cc2643e1] | 145 | To ensure that the <application>Python</application> module can be
|
---|
[cd964c8] | 146 | built by <xref linkend="python3"/>, run:
|
---|
[ca25773c] | 147 | </para>
|
---|
| 148 |
|
---|
[277c9f4e] | 149 | <screen><userinput>sed -i '/_PyVerify_fd/,+1d' python/types.c</userinput></screen>-->
|
---|
[1b8bba3] | 150 |
|
---|
[df013c7f] | 151 | <para>
|
---|
[277c9f4e] | 152 | If you are going to run the tests, disable one test that causes the Python
|
---|
| 153 | tests to terminate early with an error:
|
---|
[df013c7f] | 154 | </para>
|
---|
| 155 |
|
---|
| 156 | <screen><userinput>sed -i 's/test.test/#&/' python/tests/tstLastError.py</userinput></screen>
|
---|
| 157 |
|
---|
[84b29ba] | 158 | <para>
|
---|
| 159 | If, and only if, you are using <xref linkend="icu"/>, fix a
|
---|
| 160 | build breakage caused by that version by running the following command:
|
---|
| 161 | </para>
|
---|
| 162 |
|
---|
| 163 | <screen><userinput>sed -i 's/ TRUE/ true/' encoding.c</userinput></screen>
|
---|
| 164 |
|
---|
[325113f8] | 165 | <para>
|
---|
| 166 | Install <application>libxml2</application> by running the following
|
---|
| 167 | commands:
|
---|
| 168 | </para>
|
---|
[1515ed8a] | 169 |
|
---|
[f2e7e668] | 170 | <screen><userinput>./configure --prefix=/usr \
|
---|
[60ddbaf] | 171 | --disable-static \
|
---|
| 172 | --with-history \
|
---|
| 173 | --with-python=/usr/bin/python3 &&
|
---|
[1515ed8a] | 174 | make</userinput></screen>
|
---|
| 175 |
|
---|
[d56e7df] | 176 | <para>
|
---|
| 177 | If you downloaded the testsuite, issue the following command:
|
---|
| 178 | </para>
|
---|
[6000a3e] | 179 |
|
---|
| 180 | <screen><userinput>tar xf ../xmlts&testsuite-version;.tar.gz</userinput></screen>
|
---|
| 181 |
|
---|
[8180b89] | 182 | <para>
|
---|
[beee921] | 183 | To test the results, issue: <command>make check > check.log</command>.
|
---|
| 184 | A summary of the results can be obtained with <command>grep -E
|
---|
| 185 | '^Total|expected' check.log</command>. If <xref linkend="valgrind"/> is
|
---|
| 186 | installed and you want to check memory leaks, replace
|
---|
| 187 | <command>check</command> with <command>check-valgrind</command>.
|
---|
[8180b89] | 188 | </para>
|
---|
[8e75f8b9] | 189 |
|
---|
[cf83ea8] | 190 | <note>
|
---|
| 191 | <para>
|
---|
| 192 | The tests use <ulink url="http://localhost/">http://localhost/</ulink>
|
---|
| 193 | to test parsing of external entities. If the machine where you run the
|
---|
| 194 | tests serves as a web site, the tests may hang, depending on the
|
---|
| 195 | content of the file served. It is therefore recommended to shut down
|
---|
| 196 | the server during the tests, as the <systemitem
|
---|
| 197 | class="username">root</systemitem> user:
|
---|
| 198 | </para>
|
---|
| 199 |
|
---|
| 200 | <screen role="nodump" revision="sysv"><userinput>/etc/init.d/httpd stop</userinput></screen>
|
---|
| 201 | <screen role="nodump" revision="systemd"><userinput>systemctl stop httpd.service</userinput></screen>
|
---|
| 202 |
|
---|
| 203 | </note>
|
---|
[325113f8] | 204 | <para>
|
---|
| 205 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 206 | </para>
|
---|
[8e75f8b9] | 207 |
|
---|
[1515ed8a] | 208 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
| 209 | </sect2>
|
---|
[8e75f8b9] | 210 |
|
---|
[1515ed8a] | 211 | <sect2 role="commands">
|
---|
| 212 | <title>Command Explanations</title>
|
---|
| 213 |
|
---|
[325113f8] | 214 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 215 | href="../../xincludes/static-libraries.xml"/>
|
---|
[177d84bd] | 216 | <!--
|
---|
[cd964c8] | 217 | <para>
|
---|
| 218 | <parameter>sed -i '/_PyVerify_fd/,+1d' python/types.c</parameter>: This
|
---|
| 219 | fixes the <application>Python3</application> code to build with
|
---|
| 220 | <application>gcc-7</application>.
|
---|
| 221 | </para>
|
---|
[177d84bd] | 222 | -->
|
---|
[325113f8] | 223 | <para>
|
---|
[f48df219] | 224 | <parameter>--with-history</parameter>: This switch enables
|
---|
[325113f8] | 225 | <application>Readline</application> support when running
|
---|
| 226 | <command>xmlcatalog</command> or <command>xmllint</command> in shell mode.
|
---|
| 227 | </para>
|
---|
[8180b89] | 228 |
|
---|
[f48df219] | 229 | <para>
|
---|
[177d84bd] | 230 | <parameter>--with-python=/usr/bin/python3</parameter>: Allows building
|
---|
[6c6f393] | 231 | the libxml2 module with Python3 instead of Python2.
|
---|
[f48df219] | 232 | </para>
|
---|
| 233 |
|
---|
[ca25773c] | 234 | <para>
|
---|
| 235 | <option>--with-icu</option>: Add this switch if you have built
|
---|
| 236 | <xref linkend="icu"/>, for better unicode support.
|
---|
| 237 | </para>
|
---|
| 238 |
|
---|
| 239 | <para>
|
---|
| 240 | <option>--with-threads</option>: Add this switch to enable multithread
|
---|
| 241 | support.
|
---|
| 242 | </para>
|
---|
| 243 |
|
---|
[1515ed8a] | 244 | </sect2>
|
---|
[8e75f8b9] | 245 |
|
---|
[1515ed8a] | 246 | <sect2 role="content">
|
---|
| 247 | <title>Contents</title>
|
---|
| 248 |
|
---|
| 249 | <segmentedlist>
|
---|
| 250 | <segtitle>Installed Programs</segtitle>
|
---|
| 251 | <segtitle>Installed Libraries</segtitle>
|
---|
| 252 | <segtitle>Installed Directories</segtitle>
|
---|
[8e75f8b9] | 253 |
|
---|
[1515ed8a] | 254 | <seglistitem>
|
---|
[325113f8] | 255 | <seg>
|
---|
[177d84bd] | 256 | xml2-config,
|
---|
| 257 | xmlcatalog, and
|
---|
| 258 | xmllint <!--and the
|
---|
[cd964c8] | 259 | drv_libxml2.py and libxml2.py <application>Python3</application>
|
---|
[177d84bd] | 260 | modules. These are pythin modules, not programs -->
|
---|
[325113f8] | 261 | </seg>
|
---|
| 262 | <seg>
|
---|
[177d84bd] | 263 | libxml2.so and
|
---|
| 264 | libxml2mod.so (<application>Python3</application> module)
|
---|
[325113f8] | 265 | </seg>
|
---|
| 266 | <seg>
|
---|
| 267 | /usr/include/libxml2,
|
---|
[ec91d9f2] | 268 | /usr/lib/cmake/libxml2,
|
---|
[325113f8] | 269 | /usr/share/doc/libxml2-&libxml2-version;,
|
---|
[ec91d9f2] | 270 | /usr/share/doc/libxml2-python-&libxml2-version;, and
|
---|
[325113f8] | 271 | /usr/share/gtk-doc/html/libxml2
|
---|
| 272 | </seg>
|
---|
[1515ed8a] | 273 | </seglistitem>
|
---|
| 274 | </segmentedlist>
|
---|
[8e75f8b9] | 275 |
|
---|
[1515ed8a] | 276 | <variablelist>
|
---|
| 277 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 278 | <?dbfo list-presentation="list"?>
|
---|
| 279 | <?dbhtml list-presentation="table"?>
|
---|
[8e75f8b9] | 280 |
|
---|
[1515ed8a] | 281 | <varlistentry id="xml2-config">
|
---|
| 282 | <term><command>xml2-config</command></term>
|
---|
| 283 | <listitem>
|
---|
[325113f8] | 284 | <para>
|
---|
| 285 | determines the compile and linker flags that should be used to
|
---|
| 286 | compile and link programs that use
|
---|
| 287 | <filename class='libraryfile'>libxml2</filename>.
|
---|
| 288 | </para>
|
---|
[1515ed8a] | 289 | <indexterm zone="libxml2 xml2-config">
|
---|
| 290 | <primary sortas="b-xml2-config">xml2-config</primary>
|
---|
| 291 | </indexterm>
|
---|
| 292 | </listitem>
|
---|
| 293 | </varlistentry>
|
---|
[8e75f8b9] | 294 |
|
---|
[1515ed8a] | 295 | <varlistentry id="xmlcatalog">
|
---|
| 296 | <term><command>xmlcatalog</command></term>
|
---|
| 297 | <listitem>
|
---|
[325113f8] | 298 | <para>
|
---|
| 299 | is used to monitor and manipulate XML and SGML catalogs.
|
---|
| 300 | </para>
|
---|
[1515ed8a] | 301 | <indexterm zone="libxml2 xmlcatalog">
|
---|
| 302 | <primary sortas="b-xmlcatalog">xmlcatalog</primary>
|
---|
| 303 | </indexterm>
|
---|
| 304 | </listitem>
|
---|
| 305 | </varlistentry>
|
---|
[8e75f8b9] | 306 |
|
---|
[1515ed8a] | 307 | <varlistentry id="xmllint">
|
---|
| 308 | <term><command>xmllint</command></term>
|
---|
| 309 | <listitem>
|
---|
[325113f8] | 310 | <para>
|
---|
| 311 | parses XML files and outputs reports (based upon options) to detect
|
---|
| 312 | errors in XML coding.
|
---|
| 313 | </para>
|
---|
[1515ed8a] | 314 | <indexterm zone="libxml2 xmllint">
|
---|
| 315 | <primary sortas="b-xmllint">xmllint</primary>
|
---|
| 316 | </indexterm>
|
---|
| 317 | </listitem>
|
---|
| 318 | </varlistentry>
|
---|
[177d84bd] | 319 | <!--
|
---|
[cd964c8] | 320 | <varlistentry id="drv_libxml2.py3">
|
---|
| 321 | <term><command>drv_libxml2.py</command></term>
|
---|
| 322 | <listitem>
|
---|
| 323 | <para>
|
---|
| 324 | is a SAX <application>Python3</application> driver for libxml2.
|
---|
| 325 | </para>
|
---|
| 326 | <indexterm zone="libxml2 drv_libxml2.py3">
|
---|
[4f29081] | 327 | <primary sortas="b-drv_libxml2.py3">drv_libxml2.py for Python3</primary>
|
---|
[cd964c8] | 328 | </indexterm>
|
---|
| 329 | </listitem>
|
---|
| 330 | </varlistentry>
|
---|
| 331 |
|
---|
| 332 | <varlistentry id="libxml2.py3">
|
---|
| 333 | <term><command>libxml2.py</command></term>
|
---|
| 334 | <listitem>
|
---|
| 335 | <para>
|
---|
| 336 | is the <application>Python3</application> binding for libxml2.
|
---|
| 337 | </para>
|
---|
| 338 | <indexterm zone="libxml2 libxml2.py3">
|
---|
[4f29081] | 339 | <primary sortas="b-libxml2.py3">libxml2.py for Python3</primary>
|
---|
[cd964c8] | 340 | </indexterm>
|
---|
| 341 | </listitem>
|
---|
| 342 | </varlistentry>
|
---|
[177d84bd] | 343 | -->
|
---|
[1515ed8a] | 344 | <varlistentry id="libxml2-lib">
|
---|
[8180b89] | 345 | <term><filename class="libraryfile">libxml2.so</filename></term>
|
---|
[1515ed8a] | 346 | <listitem>
|
---|
[325113f8] | 347 | <para>
|
---|
| 348 | provides functions for programs to parse files that use the XML
|
---|
| 349 | format.
|
---|
| 350 | </para>
|
---|
[1515ed8a] | 351 | <indexterm zone="libxml2 libxml2-lib">
|
---|
[325113f8] | 352 | <primary sortas="c-libxml2">libxml2.so</primary>
|
---|
[1515ed8a] | 353 | </indexterm>
|
---|
| 354 | </listitem>
|
---|
| 355 | </varlistentry>
|
---|
[8180b89] | 356 |
|
---|
[cd964c8] | 357 | <varlistentry id="libxml2mod3">
|
---|
| 358 | <term><filename class="libraryfile">libxml2mod.so</filename></term>
|
---|
| 359 | <listitem>
|
---|
| 360 | <para>
|
---|
| 361 | is the interface for <application>Python3</application>
|
---|
| 362 | to use <filename class="libraryfile">libxml2.so</filename>.
|
---|
| 363 | </para>
|
---|
| 364 | <indexterm zone="libxml2 libxml2mod3">
|
---|
| 365 | <primary sortas="c-libxml2mod">libxml2mod.so</primary>
|
---|
| 366 | </indexterm>
|
---|
| 367 | </listitem>
|
---|
| 368 | </varlistentry>
|
---|
| 369 |
|
---|
[1515ed8a] | 370 | </variablelist>
|
---|
[8180b89] | 371 |
|
---|
[1515ed8a] | 372 | </sect2>
|
---|
[8180b89] | 373 |
|
---|
[f45b1953] | 374 | </sect1>
|
---|