[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">
|
---|
[0065e69] | 10 | <!ENTITY libxml2-md5sum "b786e353e2aa1b872d70d5d1ca0c740d">
|
---|
[cf83ea8] | 11 | <!ENTITY libxml2-size "5.2 MB">
|
---|
[0065e69] | 12 | <!ENTITY libxml2-buildsize "83 MB (add 15 MB for tests)">
|
---|
| 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 |
|
---|
[048b9a46] | 39 | &lfs83_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">
|
---|
[5da63eb] | 77 | <listitem>
|
---|
[325113f8] | 78 | <para>
|
---|
| 79 | Optional Testsuite:
|
---|
[6b262734] | 80 | <ulink url="http://www.w3.org/XML/Test/xmlts&testsuite-version;.tar.gz"/> - This
|
---|
[325113f8] | 81 | enables <command>make check</command> to do complete testing.
|
---|
| 82 | </para>
|
---|
[5da63eb] | 83 | </listitem>
|
---|
[cc2643e1] | 84 |
|
---|
[391c170] | 85 | <listitem>
|
---|
| 86 | <para>
|
---|
[cc2643e1] | 87 | Recommended patch to prevent a segfault in itstool when using Python3:
|
---|
| 88 | <ulink url="&patch-root;/libxml2-&libxml2-version;-python3_hack-1.patch"/>
|
---|
[391c170] | 89 | </para>
|
---|
[cc2643e1] | 90 | </listitem>
|
---|
[9a788838] | 91 | </itemizedlist>
|
---|
[5da63eb] | 92 |
|
---|
[437700ae] | 93 | <bridgehead renderas="sect3">libxml2 Dependencies</bridgehead>
|
---|
[8e75f8b9] | 94 |
|
---|
[60ddbaf] | 95 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 96 | <para role="optional">
|
---|
| 97 | <xref linkend="python2"/> <!--or <xref linkend="python3"/> (to build and
|
---|
[ca25773c] | 98 | install a <application>Python</application> library module, additionally
|
---|
[60ddbaf] | 99 | it is required to run the full suite of tests)-->
|
---|
[40eb6f7] | 100 | <!-- As discovered by Bruce, itstool needs this module. -->
|
---|
[325113f8] | 101 | </para>
|
---|
[0af6ce1] | 102 |
|
---|
[1aadfdf] | 103 | <note>
|
---|
[325113f8] | 104 | <para>
|
---|
| 105 | Some packages which utilize <application>libxml2</application> (such as
|
---|
| 106 | <application>GNOME Doc Utils</application>) need the
|
---|
[cd964c8] | 107 | <application>Python3</application> module installed to function properly
|
---|
[5bee197] | 108 | and some packages will not build properly if the
|
---|
[cd964c8] | 109 | <application>Python3</application> module is not available.
|
---|
| 110 | </para>
|
---|
| 111 |
|
---|
| 112 | <para>
|
---|
| 113 | The old <application>Python2</application> module can be built after
|
---|
| 114 | <filename class="libraryfile">libxml2.so</filename> has been installed,
|
---|
| 115 | see <xref linkend="libxml2py2"/>.
|
---|
[325113f8] | 116 | </para>
|
---|
[1aadfdf] | 117 | </note>
|
---|
| 118 |
|
---|
[3fe6951] | 119 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[ec91d9f2] | 120 | <para role="optional">
|
---|
[626576d4] | 121 | <xref linkend="icu"/> and
|
---|
[ec91d9f2] | 122 | <xref linkend="valgrind"/> (may be used in the tests)
|
---|
| 123 | </para>
|
---|
| 124 |
|
---|
[325113f8] | 125 | <para condition="html" role="usernotes">
|
---|
| 126 | User Notes: <ulink url="&blfs-wiki;/libxml2"/>
|
---|
| 127 | </para>
|
---|
[1515ed8a] | 128 | </sect2>
|
---|
[8e75f8b9] | 129 |
|
---|
[1515ed8a] | 130 | <sect2 role="installation">
|
---|
[437700ae] | 131 | <title>Installation of libxml2</title>
|
---|
[1515ed8a] | 132 |
|
---|
[cc2643e1] | 133 | <para>
|
---|
| 134 | First apply a patch, which prevents segfaults in the Python module, when
|
---|
| 135 | built by <xref linkend="python3"/>:
|
---|
| 136 | </para>
|
---|
| 137 |
|
---|
| 138 | <screen><userinput>patch -Np1 -i ../libxml2-&libxml2-version;-python3_hack-1.patch</userinput></screen>
|
---|
| 139 |
|
---|
| 140 | <para>
|
---|
| 141 | To ensure that the <application>Python</application> module can be
|
---|
[cd964c8] | 142 | built by <xref linkend="python3"/>, run:
|
---|
[ca25773c] | 143 | </para>
|
---|
| 144 |
|
---|
| 145 | <screen><userinput>sed -i '/_PyVerify_fd/,+1d' python/types.c</userinput></screen>
|
---|
[cd127567] | 146 |
|
---|
[325113f8] | 147 | <para>
|
---|
| 148 | Install <application>libxml2</application> by running the following
|
---|
| 149 | commands:
|
---|
| 150 | </para>
|
---|
[1515ed8a] | 151 |
|
---|
[f2e7e668] | 152 | <screen><userinput>./configure --prefix=/usr \
|
---|
[60ddbaf] | 153 | --disable-static \
|
---|
| 154 | --with-history \
|
---|
| 155 | --with-python=/usr/bin/python3 &&
|
---|
[1515ed8a] | 156 | make</userinput></screen>
|
---|
| 157 |
|
---|
[6000a3e] | 158 | <para>If you downloaded the testsuite, issue the following command:</para>
|
---|
| 159 |
|
---|
| 160 | <screen><userinput>tar xf ../xmlts&testsuite-version;.tar.gz</userinput></screen>
|
---|
| 161 |
|
---|
[8180b89] | 162 | <para>
|
---|
[beee921] | 163 | To test the results, issue: <command>make check > check.log</command>.
|
---|
| 164 | A summary of the results can be obtained with <command>grep -E
|
---|
| 165 | '^Total|expected' check.log</command>. If <xref linkend="valgrind"/> is
|
---|
| 166 | installed and you want to check memory leaks, replace
|
---|
| 167 | <command>check</command> with <command>check-valgrind</command>.
|
---|
[8180b89] | 168 | </para>
|
---|
[8e75f8b9] | 169 |
|
---|
[cf83ea8] | 170 | <note>
|
---|
| 171 | <para>
|
---|
| 172 | The tests use <ulink url="http://localhost/">http://localhost/</ulink>
|
---|
| 173 | to test parsing of external entities. If the machine where you run the
|
---|
| 174 | tests serves as a web site, the tests may hang, depending on the
|
---|
| 175 | content of the file served. It is therefore recommended to shut down
|
---|
| 176 | the server during the tests, as the <systemitem
|
---|
| 177 | class="username">root</systemitem> user:
|
---|
| 178 | </para>
|
---|
| 179 |
|
---|
| 180 | <screen role="nodump" revision="sysv"><userinput>/etc/init.d/httpd stop</userinput></screen>
|
---|
| 181 | <screen role="nodump" revision="systemd"><userinput>systemctl stop httpd.service</userinput></screen>
|
---|
| 182 |
|
---|
| 183 | </note>
|
---|
[325113f8] | 184 | <para>
|
---|
| 185 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 186 | </para>
|
---|
[8e75f8b9] | 187 |
|
---|
[1515ed8a] | 188 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
| 189 | </sect2>
|
---|
[8e75f8b9] | 190 |
|
---|
[1515ed8a] | 191 | <sect2 role="commands">
|
---|
| 192 | <title>Command Explanations</title>
|
---|
| 193 |
|
---|
[325113f8] | 194 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 195 | href="../../xincludes/static-libraries.xml"/>
|
---|
[5da63eb] | 196 |
|
---|
[cd964c8] | 197 | <para>
|
---|
| 198 | <parameter>sed -i '/_PyVerify_fd/,+1d' python/types.c</parameter>: This
|
---|
| 199 | fixes the <application>Python3</application> code to build with
|
---|
| 200 | <application>gcc-7</application>.
|
---|
| 201 | </para>
|
---|
| 202 |
|
---|
[325113f8] | 203 | <para>
|
---|
[f48df219] | 204 | <parameter>--with-history</parameter>: This switch enables
|
---|
[325113f8] | 205 | <application>Readline</application> support when running
|
---|
| 206 | <command>xmlcatalog</command> or <command>xmllint</command> in shell mode.
|
---|
| 207 | </para>
|
---|
[8180b89] | 208 |
|
---|
[f48df219] | 209 | <para>
|
---|
[6c6f393] | 210 | <parameter>--with-python=/usr/bin/python3</parameter>: Allows to build
|
---|
| 211 | the libxml2 module with Python3 instead of Python2.
|
---|
[f48df219] | 212 | </para>
|
---|
| 213 |
|
---|
[ca25773c] | 214 | <para>
|
---|
| 215 | <option>--with-icu</option>: Add this switch if you have built
|
---|
| 216 | <xref linkend="icu"/>, for better unicode support.
|
---|
| 217 | </para>
|
---|
| 218 |
|
---|
| 219 | <para>
|
---|
| 220 | <option>--with-threads</option>: Add this switch to enable multithread
|
---|
| 221 | support.
|
---|
| 222 | </para>
|
---|
| 223 |
|
---|
[1515ed8a] | 224 | </sect2>
|
---|
[8e75f8b9] | 225 |
|
---|
[1515ed8a] | 226 | <sect2 role="content">
|
---|
| 227 | <title>Contents</title>
|
---|
| 228 |
|
---|
| 229 | <segmentedlist>
|
---|
| 230 | <segtitle>Installed Programs</segtitle>
|
---|
| 231 | <segtitle>Installed Libraries</segtitle>
|
---|
| 232 | <segtitle>Installed Directories</segtitle>
|
---|
[8e75f8b9] | 233 |
|
---|
[1515ed8a] | 234 | <seglistitem>
|
---|
[325113f8] | 235 | <seg>
|
---|
[cd964c8] | 236 | xml2-config, xmlcatalog, xmllint and the
|
---|
| 237 | drv_libxml2.py and libxml2.py <application>Python3</application>
|
---|
| 238 | modules.
|
---|
[325113f8] | 239 | </seg>
|
---|
| 240 | <seg>
|
---|
| 241 | libxml2.so and optionally, the libxml2mod.so
|
---|
[cd964c8] | 242 | <application>Python3</application> module
|
---|
[325113f8] | 243 | </seg>
|
---|
| 244 | <seg>
|
---|
| 245 | /usr/include/libxml2,
|
---|
[ec91d9f2] | 246 | /usr/lib/cmake/libxml2,
|
---|
[325113f8] | 247 | /usr/share/doc/libxml2-&libxml2-version;,
|
---|
[ec91d9f2] | 248 | /usr/share/doc/libxml2-python-&libxml2-version;, and
|
---|
[325113f8] | 249 | /usr/share/gtk-doc/html/libxml2
|
---|
| 250 | </seg>
|
---|
[1515ed8a] | 251 | </seglistitem>
|
---|
| 252 | </segmentedlist>
|
---|
[8e75f8b9] | 253 |
|
---|
[1515ed8a] | 254 | <variablelist>
|
---|
| 255 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 256 | <?dbfo list-presentation="list"?>
|
---|
| 257 | <?dbhtml list-presentation="table"?>
|
---|
[8e75f8b9] | 258 |
|
---|
[1515ed8a] | 259 | <varlistentry id="xml2-config">
|
---|
| 260 | <term><command>xml2-config</command></term>
|
---|
| 261 | <listitem>
|
---|
[325113f8] | 262 | <para>
|
---|
| 263 | determines the compile and linker flags that should be used to
|
---|
| 264 | compile and link programs that use
|
---|
| 265 | <filename class='libraryfile'>libxml2</filename>.
|
---|
| 266 | </para>
|
---|
[1515ed8a] | 267 | <indexterm zone="libxml2 xml2-config">
|
---|
| 268 | <primary sortas="b-xml2-config">xml2-config</primary>
|
---|
| 269 | </indexterm>
|
---|
| 270 | </listitem>
|
---|
| 271 | </varlistentry>
|
---|
[8e75f8b9] | 272 |
|
---|
[1515ed8a] | 273 | <varlistentry id="xmlcatalog">
|
---|
| 274 | <term><command>xmlcatalog</command></term>
|
---|
| 275 | <listitem>
|
---|
[325113f8] | 276 | <para>
|
---|
| 277 | is used to monitor and manipulate XML and SGML catalogs.
|
---|
| 278 | </para>
|
---|
[1515ed8a] | 279 | <indexterm zone="libxml2 xmlcatalog">
|
---|
| 280 | <primary sortas="b-xmlcatalog">xmlcatalog</primary>
|
---|
| 281 | </indexterm>
|
---|
| 282 | </listitem>
|
---|
| 283 | </varlistentry>
|
---|
[8e75f8b9] | 284 |
|
---|
[1515ed8a] | 285 | <varlistentry id="xmllint">
|
---|
| 286 | <term><command>xmllint</command></term>
|
---|
| 287 | <listitem>
|
---|
[325113f8] | 288 | <para>
|
---|
| 289 | parses XML files and outputs reports (based upon options) to detect
|
---|
| 290 | errors in XML coding.
|
---|
| 291 | </para>
|
---|
[1515ed8a] | 292 | <indexterm zone="libxml2 xmllint">
|
---|
| 293 | <primary sortas="b-xmllint">xmllint</primary>
|
---|
| 294 | </indexterm>
|
---|
| 295 | </listitem>
|
---|
| 296 | </varlistentry>
|
---|
[8e75f8b9] | 297 |
|
---|
[cd964c8] | 298 | <varlistentry id="drv_libxml2.py3">
|
---|
| 299 | <term><command>drv_libxml2.py</command></term>
|
---|
| 300 | <listitem>
|
---|
| 301 | <para>
|
---|
| 302 | is a SAX <application>Python3</application> driver for libxml2.
|
---|
| 303 | </para>
|
---|
| 304 | <indexterm zone="libxml2 drv_libxml2.py3">
|
---|
[4f29081] | 305 | <primary sortas="b-drv_libxml2.py3">drv_libxml2.py for Python3</primary>
|
---|
[cd964c8] | 306 | </indexterm>
|
---|
| 307 | </listitem>
|
---|
| 308 | </varlistentry>
|
---|
| 309 |
|
---|
| 310 | <varlistentry id="libxml2.py3">
|
---|
| 311 | <term><command>libxml2.py</command></term>
|
---|
| 312 | <listitem>
|
---|
| 313 | <para>
|
---|
| 314 | is the <application>Python3</application> binding for libxml2.
|
---|
| 315 | </para>
|
---|
| 316 | <indexterm zone="libxml2 libxml2.py3">
|
---|
[4f29081] | 317 | <primary sortas="b-libxml2.py3">libxml2.py for Python3</primary>
|
---|
[cd964c8] | 318 | </indexterm>
|
---|
| 319 | </listitem>
|
---|
| 320 | </varlistentry>
|
---|
| 321 |
|
---|
[1515ed8a] | 322 | <varlistentry id="libxml2-lib">
|
---|
[8180b89] | 323 | <term><filename class="libraryfile">libxml2.so</filename></term>
|
---|
[1515ed8a] | 324 | <listitem>
|
---|
[325113f8] | 325 | <para>
|
---|
| 326 | provides functions for programs to parse files that use the XML
|
---|
| 327 | format.
|
---|
| 328 | </para>
|
---|
[1515ed8a] | 329 | <indexterm zone="libxml2 libxml2-lib">
|
---|
[325113f8] | 330 | <primary sortas="c-libxml2">libxml2.so</primary>
|
---|
[1515ed8a] | 331 | </indexterm>
|
---|
| 332 | </listitem>
|
---|
| 333 | </varlistentry>
|
---|
[8180b89] | 334 |
|
---|
[cd964c8] | 335 | <varlistentry id="libxml2mod3">
|
---|
| 336 | <term><filename class="libraryfile">libxml2mod.so</filename></term>
|
---|
| 337 | <listitem>
|
---|
| 338 | <para>
|
---|
| 339 | is the interface for <application>Python3</application>
|
---|
| 340 | to use <filename class="libraryfile">libxml2.so</filename>.
|
---|
| 341 | </para>
|
---|
| 342 | <indexterm zone="libxml2 libxml2mod3">
|
---|
| 343 | <primary sortas="c-libxml2mod">libxml2mod.so</primary>
|
---|
| 344 | </indexterm>
|
---|
| 345 | </listitem>
|
---|
| 346 | </varlistentry>
|
---|
| 347 |
|
---|
[1515ed8a] | 348 | </variablelist>
|
---|
[8180b89] | 349 |
|
---|
[1515ed8a] | 350 | </sect2>
|
---|
[8180b89] | 351 |
|
---|
[f45b1953] | 352 | </sect1>
|
---|