Репозитории ALT

S: | 2.9.14-alt1 |
5.1: | 2.7.8-alt3.M50P.1 |
4.1: | 2.7.2-alt1.M41.2 |
+updates: | 2.6.32-alt2.M41.2 |
4.0: | 2.7.2-alt1.M40.1 |
+updates: | 2.6.31-alt1 |
3.0: | 2.6.20-alt1 |
Группа :: Система/Библиотеки
Пакет: libxml2
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: libxml2-2.9.12-alt1.patch
Скачать
Скачать
.gear/rules | 3 +
.../tags/adf8e7ce9659c5d7e8401b1962fdbd3183413970 | 17 +
.gear/tags/list | 2 +
.gear/upstream/remotes | 3 +
HTMLtree.c | 55 +-
Makefile.am | 14 +-
buf.h | 5 +
configure.ac | 15 +-
enc.h | 5 +
encoding.c | 5 +-
fuzz/Makefile.am | 2 +-
libxml.h | 4 +
libxml2.spec | 815 +++++++++++++++++++++
python/Makefile.am | 2 +-
python/libxml.c | 11 +-
python/tests/Makefile.am | 2 +-
python/types.c | 4 +
save.h | 5 +
testStructuredErrorFunc.c | 69 ++
timsort.h | 4 +
xml2-config.1 | 1 -
xml2-config.in | 8 +-
xml2Conf.sh.in | 2 +-
xmlIO.c | 3 +-
xmlsave.c | 31 +-
xpath.c | 4 +-
xzlib.h | 2 +
27 files changed, 1035 insertions(+), 58 deletions(-)
diff --git a/.gear/rules b/.gear/rules
new file mode 100644
index 00000000..cd8fa28a
--- /dev/null
+++ b/.gear/rules
@@ -0,0 +1,3 @@
+tar: v@version@:.
+diff: v@version@:. . name=@name@-@version@-@release@.patch
+tar: xmlts:xmlconf name=xmlts base=xmlconf
diff --git a/.gear/tags/adf8e7ce9659c5d7e8401b1962fdbd3183413970 b/.gear/tags/adf8e7ce9659c5d7e8401b1962fdbd3183413970
new file mode 100644
index 00000000..287d4b6a
--- /dev/null
+++ b/.gear/tags/adf8e7ce9659c5d7e8401b1962fdbd3183413970
@@ -0,0 +1,17 @@
+object b48e77cf4f6fa0792c5f4b639707a2b0675e461b
+type commit
+tag v2.9.12
+tagger Daniel Veillard <veillard@redhat.com> 1620932334 +0200
+
+Release of libxml2 2.9.12
+-----BEGIN PGP SIGNATURE-----
+
+iQFLBAABCAA1FiEE20ZoG7ka3OoXD6LUFViLJllr6l0FAmCddvkXHGRhbmllbC52
+ZWlsbGFyZEB3My5vcmcACgkQFViLJllr6l19+gf/YSGis9qEZiZELpzIaccgNAcR
+J0gVi6ozuDP82Qk69XJp8cv9VYLjACFmGotE+VnmMXansmdNBZSlOBvNKw3HZNxD
+8GoiQJnONsT9xw4EyBmCotsdY/0FMqPqtxIf91DCSHWgJQh9TMFDwOBw8N+BXYmg
+8Uhow+8dufkQ8dfMCaGxNcER0JJDetVZYPxkZYCAijq5SxzPKFV9yZKLdFhKyefx
+Kg0CUYJfxPHIeYfQVTAMiIUbx2dJs08vICCE5Lr2dMs5QsFnY4fcdt/TklRT8AG4
+J3yPZtP0lkBybJUMFwoCFsKCxOc/EiVjLqcU8JqwHUOQWyWv/PVQ7YH+4z7e6g==
+=hxw0
+-----END PGP SIGNATURE-----
diff --git a/.gear/tags/list b/.gear/tags/list
new file mode 100644
index 00000000..ac8c8332
--- /dev/null
+++ b/.gear/tags/list
@@ -0,0 +1,2 @@
+7a8ebc2a61021b118d39381b4af612a650601da9 xmlts
+adf8e7ce9659c5d7e8401b1962fdbd3183413970 v2.9.12
diff --git a/.gear/upstream/remotes b/.gear/upstream/remotes
new file mode 100644
index 00000000..1da74b14
--- /dev/null
+++ b/.gear/upstream/remotes
@@ -0,0 +1,3 @@
+[remote "upstream"]
+ url = https://gitlab.gnome.org/GNOME/libxml2.git
+ fetch = +refs/heads/*:refs/remotes/upstream/*
diff --git a/HTMLtree.c b/HTMLtree.c
index 24434d45..b7459317 100644
--- a/HTMLtree.c
+++ b/HTMLtree.c
@@ -337,7 +337,8 @@ htmlIsBooleanAttr(const xmlChar *name)
* private routine exported from xmlIO.c
*/
xmlOutputBufferPtr
-xmlAllocOutputBufferInternal(xmlCharEncodingHandlerPtr encoder);
+xmlAllocOutputBufferInternal(xmlCharEncodingHandlerPtr encoder)
+ __attribute((visibility("hidden")));
/************************************************************************
* *
* Output error handlers *
@@ -744,7 +745,7 @@ void
htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
xmlNodePtr cur, const char *encoding ATTRIBUTE_UNUSED,
int format) {
- xmlNodePtr root;
+ xmlNodePtr root, parent;
xmlAttrPtr attr;
const htmlElemDesc * info;
@@ -755,6 +756,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
}
root = cur;
+ parent = cur->parent;
while (1) {
switch (cur->type) {
case XML_HTML_DOCUMENT_NODE:
@@ -763,12 +765,28 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL);
}
if (cur->children != NULL) {
- cur = cur->children;
- continue;
+ /* Always validate cur->parent when descending. */
+ if (cur->parent == parent) {
+ parent = cur;
+ cur = cur->children;
+ continue;
+ }
+ } else {
+ xmlOutputBufferWriteString(buf, "\n");
}
break;
case XML_ELEMENT_NODE:
+ /*
+ * Some users like lxml are known to pass nodes with a corrupted
+ * tree structure. Fall back to a recursive call to handle this
+ * case.
+ */
+ if ((cur->parent != parent) && (cur->children != NULL)) {
+ htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
+ break;
+ }
+
/*
* Get specific HTML info for that node.
*/
@@ -817,6 +835,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
(cur->name != NULL) &&
(cur->name[0] != 'p')) /* p, pre, param */
xmlOutputBufferWriteString(buf, "\n");
+ parent = cur;
cur = cur->children;
continue;
}
@@ -825,9 +844,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
(info != NULL) && (!info->isinline)) {
if ((cur->next->type != HTML_TEXT_NODE) &&
(cur->next->type != HTML_ENTITY_REF_NODE) &&
- (cur->parent != NULL) &&
- (cur->parent->name != NULL) &&
- (cur->parent->name[0] != 'p')) /* p, pre, param */
+ (parent != NULL) &&
+ (parent->name != NULL) &&
+ (parent->name[0] != 'p')) /* p, pre, param */
xmlOutputBufferWriteString(buf, "\n");
}
@@ -842,9 +861,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
break;
if (((cur->name == (const xmlChar *)xmlStringText) ||
(cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
- ((cur->parent == NULL) ||
- ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) &&
- (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) {
+ ((parent == NULL) ||
+ ((xmlStrcasecmp(parent->name, BAD_CAST "script")) &&
+ (xmlStrcasecmp(parent->name, BAD_CAST "style"))))) {
xmlChar *buffer;
buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
@@ -902,13 +921,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
break;
}
- /*
- * The parent should never be NULL here but we want to handle
- * corrupted documents gracefully.
- */
- if (cur->parent == NULL)
- return;
- cur = cur->parent;
+ cur = parent;
+ /* cur->parent was validated when descending. */
+ parent = cur->parent;
if ((cur->type == XML_HTML_DOCUMENT_NODE) ||
(cur->type == XML_DOCUMENT_NODE)) {
@@ -939,9 +954,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
(cur->next != NULL)) {
if ((cur->next->type != HTML_TEXT_NODE) &&
(cur->next->type != HTML_ENTITY_REF_NODE) &&
- (cur->parent != NULL) &&
- (cur->parent->name != NULL) &&
- (cur->parent->name[0] != 'p')) /* p, pre, param */
+ (parent != NULL) &&
+ (parent->name != NULL) &&
+ (parent->name[0] != 'p')) /* p, pre, param */
xmlOutputBufferWriteString(buf, "\n");
}
}
diff --git a/Makefile.am b/Makefile.am
index a9284b95..cd39206c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,6 +13,7 @@ AM_CFLAGS = $(EXTRA_CFLAGS) $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS)
check_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \
testThreads testC14N testAutomata testRegexp \
testReader testapi testModule runtest runsuite testchar \
+ testStructuredErrorFunc \
testdict runxmlconf testrecurse testlimits
bin_PROGRAMS = xmllint xmlcatalog
@@ -33,7 +34,7 @@ libxml2_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) \
-version-info $(LIBXML_VERSION_INFO) \
$(MODULE_PLATFORM_LIBS)
-if WITH_SAX1_SOURCES
+if WITH_DOCB
docb_sources = DOCBparser.c
else
docb_sources =
@@ -188,6 +189,11 @@ testapi_LDFLAGS =
testapi_DEPENDENCIES = $(DEPS)
testapi_LDADD= $(LDADDS)
+testStructuredErrorFunc_SOURCES=testStructuredErrorFunc.c
+testStructuredErrorFunc_LDFLAGS =
+testStructuredErrorFunc_DEPENDENCIES = $(DEPS)
+testStructuredErrorFunc_LDADD= $(LDADDS)
+
runxmlconf_SOURCES=runxmlconf.c
runxmlconf_LDFLAGS =
runxmlconf_DEPENDENCIES = $(DEPS)
@@ -199,12 +205,13 @@ runxmlconf_LDADD= $(LDADDS)
#testOOM_LDADD= $(LDADDS)
runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
- testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT)
+ testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT) testStructuredErrorFunc$(EXEEXT)
[ -d test ] || $(LN_S) $(srcdir)/test .
[ -d result ] || $(LN_S) $(srcdir)/result .
$(CHECKER) ./runtest$(EXEEXT) && \
$(CHECKER) ./testrecurse$(EXEEXT) && \
ASAN_OPTIONS="$$ASAN_OPTIONS:detect_leaks=0" $(CHECKER) ./testapi$(EXEEXT) && \
+ $(CHECKER) ./testStructuredErrorFunc$(EXEEXT) && \
$(CHECKER) ./testchar$(EXEEXT) && \
$(CHECKER) ./testdict$(EXEEXT) && \
$(CHECKER) ./runxmlconf$(EXEEXT)
@@ -1217,7 +1224,7 @@ dist-source: distdir
dist-test: distdir
(mkdir -p $(distdir))
(cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn --exclude .git xstc/Tests) | (cd $(distdir); tar xf -)
- tar -cf - $(distdir)/test $(distdir)/result $(distdir)/xstc/Tests $(distdir)/Makefile.tests $(distdir)/README $(distdir)/README.tests $(distdir)/AUTHORS $(distdir)/testapi.c $(distdir)/runtest.c $(distdir)/runsuite.c | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-tests+"`.tar.gz
+ tar -cf - $(distdir)/test $(distdir)/result $(distdir)/xstc/Tests $(distdir)/Makefile.tests $(distdir)/README $(distdir)/README.tests $(distdir)/AUTHORS $(distdir)/testapi.c $(distdir)/testStructuredErrorFunc.c $(distdir)/runtest.c $(distdir)/runsuite.c | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-tests+"`.tar.gz
@(rm -rf $(distdir)/xstc/Test)
cleantar:
@@ -1237,7 +1244,6 @@ xml2Conf.sh: xml2Conf.sh.in Makefile
-e 's?\@XML_INCLUDEDIR\@?$(XML_INCLUDEDIR)?g' \
-e 's?\@VERSION\@?$(VERSION)?g' \
-e 's?\@XML_LIBS\@?$(XML_LIBS)?g' \
- -e 's?\@XML_PRIVATE_LIBS\@?$(XML_PRIVATE_LIBS)?g' \
< $(srcdir)/xml2Conf.sh.in > xml2Conf.tmp \
&& mv xml2Conf.tmp xml2Conf.sh
diff --git a/buf.h b/buf.h
index ebdc9781..546eb06e 100644
--- a/buf.h
+++ b/buf.h
@@ -15,6 +15,8 @@
#include <libxml/tree.h>
+#pragma GCC visibility push(hidden)
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -68,5 +70,8 @@ int xmlBufSetInputBaseCur(xmlBufPtr buf, xmlParserInputPtr input,
#ifdef __cplusplus
}
#endif
+
+#pragma GCC visibility pop
+
#endif /* __XML_BUF_H__ */
diff --git a/configure.ac b/configure.ac
index 5b161a54..2f142285 100644
--- a/configure.ac
+++ b/configure.ac
@@ -457,6 +457,15 @@ else
LZMA_LIBS="-llzma"
fi])
)
+ else
+ # we still need to check for lzma.h header
+ SAVE_CFLAGS="${CFLAGS}"
+ CFLAGS="${CFLAGS} ${LZMA_CFLAGS}"
+ AC_CHECK_HEADERS([lzma.h],, [
+ have_liblzma=no
+ LZMA_CFLAGS=
+ LZMA_LIBS=])
+ CFLAGS="${SAVE_CFLAGS}"
fi
fi
@@ -905,7 +914,7 @@ if test "$with_python" != "no" ; then
fi
fi
pythondir='$(PYTHON_SITE_PACKAGES)'
- PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags`
+ PYTHON_LIBS=`python$PYTHON_VERSION-config --libs`
else
PYTHON=
fi
@@ -1237,7 +1246,6 @@ else
TEST_SAX=SAXtests
fi
AC_SUBST(WITH_SAX1)
-AM_CONDITIONAL(WITH_SAX1_SOURCES, test "${WITH_TRIO}" = "1")
AC_SUBST(TEST_SAX)
if test "$with_push" = "no" ; then
@@ -1309,6 +1317,7 @@ else
fi
AC_SUBST(WITH_DOCB)
AC_SUBST(DOCB_OBJ)
+AM_CONDITIONAL(WITH_DOCB, test "${WITH_DOCB}" = "1")
if test "$with_xptr" = "no" ; then
@@ -1550,7 +1559,6 @@ else
fi
fi
XML_LIBS="-lxml2"
-XML_PRIVATE_LIBS="$Z_LIBS $LZMA_LIBS $THREAD_LIBS $ICONV_LIBS $ICU_LIBS $M_LIBS $LIBS"
XML_LIBTOOLLIBS="libxml2.la"
AC_SUBST(WITH_ICU)
@@ -1695,7 +1703,6 @@ AC_SUBST(XML_CFLAGS)
AC_SUBST(XML_LIBDIR)
AC_SUBST(XML_LIBS)
-AC_SUBST(XML_PRIVATE_LIBS)
AC_SUBST(XML_LIBTOOLLIBS)
AC_SUBST(ICONV_LIBS)
AC_SUBST(ICU_LIBS)
diff --git a/enc.h b/enc.h
index a69a5d03..3b7df247 100644
--- a/enc.h
+++ b/enc.h
@@ -14,6 +14,8 @@
#include <libxml/tree.h>
+#pragma GCC visibility push(hidden)
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -27,6 +29,9 @@ int xmlCharEncOutput(xmlOutputBufferPtr output, int init);
#ifdef __cplusplus
}
#endif
+
+#pragma GCC visibility pop
+
#endif /* __XML_ENC_H__ */
diff --git a/encoding.c b/encoding.c
index cdff6ae7..ff0991e9 100644
--- a/encoding.c
+++ b/encoding.c
@@ -2045,7 +2045,7 @@ xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
* -2 if the transcoding fails (for *in is not valid utf8 string or
* the result of transformation can't fit into the encoding we want), or
*/
-int
+int __attribute((visibility("hidden")))
xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out,
xmlBufferPtr in, int len) {
int ret;
@@ -2629,7 +2629,6 @@ xmlCharEncOutFunc(xmlCharEncodingHandler *handler, xmlBufferPtr out,
int written;
int writtentot = 0;
int toconv;
- int output = 0;
if (handler == NULL) return(-1);
if (out == NULL) return(-1);
@@ -2682,8 +2681,6 @@ retry:
ret = -3;
}
- if (ret >= 0) output += ret;
-
/*
* Attempt to handle error cases
*/
diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am
index 6f487137..6051a4fe 100644
--- a/fuzz/Makefile.am
+++ b/fuzz/Makefile.am
@@ -4,7 +4,7 @@ check_PROGRAMS = testFuzzer
EXTRA_DIST = html.dict regexp.dict schema.dict xml.dict xpath.dict \
seed/uri seed/regexp fuzz.h
CLEANFILES = $(EXTRA_PROGRAMS)
-AM_CPPFLAGS = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)/include
DEPENDENCIES = $(top_builddir)/libxml2.la
LDADD = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD)
diff --git a/libxml.h b/libxml.h
index 1090729c..811a1e54 100644
--- a/libxml.h
+++ b/libxml.h
@@ -79,6 +79,8 @@ int vfprintf(FILE *, const char *, va_list);
#define ATTRIBUTE_NO_SANITIZE(arg)
#endif
+#pragma GCC visibility push(hidden)
+
/*
* Internal variable indicating if a callback has been registered for
* node creation/destruction. It avoids spending a lot of time in locking
@@ -117,6 +119,8 @@ int __xmlRandom(void);
XMLPUBFUN xmlChar * XMLCALL xmlEscapeFormatString(xmlChar **msg);
int xmlInputReadCallbackNop(void *context, char *buffer, int len);
+#pragma GCC visibility pop
+
#ifdef IN_LIBXML
#ifdef __GNUC__
#ifdef PIC
diff --git a/libxml2.spec b/libxml2.spec
new file mode 100644
index 00000000..a32b7a30
--- /dev/null
+++ b/libxml2.spec
@@ -0,0 +1,815 @@
+Name: libxml2
+Version: 2.9.12
+Release: alt1
+Epoch: 1
+
+Summary: The library for manipulating XML files
+License: MIT
+Group: System/Libraries
+Url: http://xmlsoft.org/
+
+%def_with python2
+%def_disable static
+%define srcname %name-%version
+
+Source: %srcname.tar
+# https://www.w3.org/XML/Test/xmlts20130923.tar.gz
+Source1: xmlts.tar
+Patch: %name-%version-%release.patch
+
+Requires: xml-common
+
+BuildRequires: liblzma-devel zlib-devel
+
+%if_with python2
+BuildRequires(pre): rpm-build-python
+BuildRequires: python-devel
+%endif
+
+BuildRequires(pre): rpm-build-python3
+BuildRequires: python3-devel
+
+%package devel
+Summary: Development environment for building applications manipulating XML files
+Group: Development/C
+Requires: %name = %EVR
+
+%package devel-static
+Summary: Static library for building applications manipulating XML files
+Group: Development/C
+Requires: %name-devel = %EVR
+
+%package -n xml-utils
+Summary: Various XML utilities
+Group: Text tools
+Requires: %name = %EVR
+Provides: xmllint = %epoch:%version
+Obsoletes: xmllint < %epoch:%version
+
+%package -n python-module-%name
+Summary: Python bindings for the %name library
+Group: Development/Python
+Requires: %name = %EVR
+Provides: libxml2-python = %epoch:%version, python-modules-%name = %epoch:%version
+Obsoletes: libxml2-python < %epoch:%version, python-modules-%name < %epoch:%version
+
+%package -n python3-module-%name
+Summary: Python3 bindings for the %name library
+Group: Development/Python3
+Requires: %name = %EVR
+
+%package doc
+Summary: Documentation for the %name library
+Group: Development/C
+Conflicts: %name < %epoch:%version, %name > %epoch:%version
+BuildArch: noarch
+
+%description
+This library allows to manipulate XML files. It includes support
+to read, modify and write XML and HTML files. There is DTDs support
+this includes parsing and validation even with complex DtDs, either
+at parse time or later once the document has been modified. The output
+can be a simple SAX stream or and in-memory DOM like representations.
+In this case one can use the built-in XPath and XPointer implementation
+to select subnodes or ranges. A flexible Input/Output mechanism is
+available, with existing HTTP and FTP modules and combined to an
+URI library.
+
+This package contains the shared library required to run
+applications manipulating XML files.
+
+%description devel
+This library allows to manipulate XML files. It includes support
+to read, modify and write XML and HTML files. There is DTDs support
+this includes parsing and validation even with complex DtDs, either
+at parse time or later once the document has been modified. The output
+can be a simple SAX stream or and in-memory DOM like representations.
+In this case one can use the built-in XPath and XPointer implementation
+to select subnodes or ranges. A flexible Input/Output mechanism is
+available, with existing HTTP and FTP modules and combined to an
+URI library.
+
+This package contains the libraries, include and other files
+you can use to develop applications manipulating XML files.
+
+%description devel-static
+This library allows to manipulate XML files. It includes support
+to read, modify and write XML and HTML files. There is DTDs support
+this includes parsing and validation even with complex DtDs, either
+at parse time or later once the document has been modified. The output
+can be a simple SAX stream or and in-memory DOM like representations.
+In this case one can use the built-in XPath and XPointer implementation
+to select subnodes or ranges. A flexible Input/Output mechanism is
+available, with existing HTTP and FTP modules and combined to an
+URI library.
+
+This package contains the static library you can use to develop
+statically linked applications manipulating XML files.
+
+%description -n xml-utils
+This package contains xml tools:
++ xmllint - utility for parsing and validating XML files;
++ xmlcatalog - command line tool to parse and manipulate XML or SGML
+catalog files.
+
+%description -n python-module-%name
+This package contains a module that permits applications
+written in the Python programming language to use the interface
+supplied by the %name library to manipulate XML files.
+
+This library allows to manipulate XML files. It includes support
+to read, modify and write XML and HTML files. There is DTDs support
+this includes parsing and validation even with complex DTDs, either
+at parse time or later once the document has been modified.
+
+%description -n python3-module-%name
+This package contains a module that permits applications
+written in the Python3 programming language to use the interface
+supplied by the %name library to manipulate XML files.
+
+This library allows to manipulate XML files. It includes support
+to read, modify and write XML and HTML files. There is DTDs support
+this includes parsing and validation even with complex DTDs, either
+at parse time or later once the document has been modified.
+
+%description doc
+This package contains documentation on the XML C library.
+
+%prep
+%setup -n %srcname -a1
+%patch -p1
+
+%build
+export ac_cv_path_WGET=/usr/bin/wget
+export ac_cv_path_XMLLINT=/usr/bin/xmllint
+export ac_cv_path_XSLTPROC=/usr/bin/xsltproc
+# disable dependency on binutils-devel
+export ac_cv_header_ansidecl_h=no
+mkdir -p m4
+%autoreconf
+mkdir build
+pushd build
+ln -s ../xmlconf
+mkdir -p fuzz
+ln -s ../../fuzz/seed fuzz/seed
+%define _configure_script ../configure
+%configure \
+ --with-python=%_bindir/python3 \
+ --with-python-install-dir=%python3_sitelibdir \
+ --with-html-dir=%_docdir \
+ --with-html-subdir=%name-%version \
+ %{subst_enable static} \
+ --disable-silent-rules
+%make_build DOC_MODULE=%name-%version
+popd
+%if_with python2
+mkdir python2
+pushd python2
+%configure \
+ --with-python=%_bindir/python2 \
+ --with-python-install-dir=%python_sitelibdir \
+ --with-html-dir=%_docdir \
+ --with-html-subdir=%name-%version \
+ --disable-static \
+ --disable-silent-rules
+cp -la ../build/{*.la,.libs} .
+%make_build -C python
+popd
+%endif
+
+%check
+%make_build DOC_MODULE=%name-%version -k check -C build
+
+%install
+%makeinstall_std DOC_MODULE=%name-%version -C build
+%if_with python2
+%makeinstall_std -C python2/python
+%endif
+find %buildroot -type f -name '*.la' -print -delete
+mv %buildroot%_datadir/aclocal/libxml{,2}.m4
+
+%define pkgdocdir %_docdir/%name-%version
+install -p -m644 AUTHORS Copyright NEWS README %buildroot%pkgdocdir/
+install -p -m644 doc/*.html %buildroot%pkgdocdir/
+
+%files
+%_libdir/*.so.*
+%dir %pkgdocdir
+%pkgdocdir/AUTHORS
+%pkgdocdir/Copyright
+%pkgdocdir/NEWS
+%pkgdocdir/README
+
+%files -n xml-utils
+%_bindir/xmllint
+%_bindir/xmlcatalog
+%_man1dir/xmllint.*
+%_man1dir/xmlcatalog.*
+
+%files devel
+%_bindir/*-config
+%_libdir/*.so
+%_libdir/*.sh
+%_includedir/*
+%_pkgconfigdir/*
+%_libdir/cmake/*
+%_aclocaldir/*
+%_man1dir/*-config*
+%_man3dir/*
+
+%if_enabled static
+%files devel-static
+%_libdir/*.a
+%endif #enabled static
+
+%if_with python2
+%files -n python-module-%name
+%python_sitelibdir/*
+%endif
+
+%files -n python3-module-%name
+%python3_sitelibdir/*
+
+%files doc
+%dir %pkgdocdir
+%pkgdocdir/*.html
+%pkgdocdir/*.gif
+%pkgdocdir/*.png
+%pkgdocdir/*.xml
+%pkgdocdir/*.xsl
+%pkgdocdir/*.c
+%pkgdocdir/*.res
+%pkgdocdir/html
+%pkgdocdir/examples
+%pkgdocdir/tutorial
+%pkgdocdir/python
+%doc %_datadir/gtk-doc/html/libxml2/
+
+%changelog
+* Tue Jun 15 2021 Alexey Shabalin <shaba@altlinux.org> 1:2.9.12-alt1
+- 2.9.12 (Fixes: CVE-2021-3516, CVE-2021-3517, CVE-2021-3518, CVE-2021-3537, CVE-2021-3541)
+
+* Sun Feb 14 2021 Ivan A. Melnikov <iv@altlinux.org> 1:2.9.10-alt6
+- Address upstream #132 by cherry-picking the fix from master; see:
+ + https://gitlab.gnome.org/GNOME/libxml2/-/issues/132
+ + https://github.com/shlomif/perl-XML-LibXSLT/issues/2
+
+* Wed Jan 27 2021 Grigory Ustinov <grenka@altlinux.org> 1:2.9.10-alt5
+- Add patch for python3.9 support.
+
+* Fri Nov 06 2020 Aleksei Nikiforov <darktemplar@altlinux.org> 1:2.9.10-alt4
+- Applied security fixes from upstream (Fixes: CVE-2019-20388, CVE-2020-7595,
+ CVE-2020-24977).
+
+* Mon Dec 23 2019 Ivan A. Melnikov <iv@altlinux.org> 1:2.9.10-alt3
+- Fix building without python-base.
+
+* Sat Nov 02 2019 Dmitry V. Levin <ldv@altlinux.org> 1:2.9.10-alt2
+- xml2-config: fixed regressions introduced in v2.9.10.
+
+* Fri Nov 01 2019 Alexey Shabalin <shaba@altlinux.org> 1:2.9.10-alt1
+- Updated to v2.9.10
+
+* Wed May 22 2019 Alexey Shabalin <shaba@altlinux.org> 1:2.9.9.0.52.f824-alt1
+- v2.9.4-12-ge905f08 -> v2.9.9-52-gf824a4bd
+ (fixes: CVE-2017-9047, CVE-2017-9048, CVE-2017-9049, CVE-2017-9050,
+ CVE-2017-5969, CVE-2018-14404, CVE-2018-9251, CVE-2018-14567).
+
+* Thu Mar 22 2018 Aleksei Nikiforov <darktemplar@altlinux.org> 1:2.9.4.0.12.e905-alt1.1
+- (NMU) Rebuilt with python-3.6.4.
+
+* Fri Mar 03 2017 Dmitry V. Levin <ldv@altlinux.org> 1:2.9.4.0.12.e905-alt1
+- v2.9.3-5-g65112cb -> v2.9.4-12-ge905f08
+ (fixes: CVE-2016-1833, CVE-2016-1834, CVE-2016-1835, CVE-2016-1836,
+ CVE-2016-1837, CVE-2016-1838, CVE-2016-1839, CVE-2016-1840,
+ CVE-2016-3627, CVE-2016-3705, CVE-2016-4449, CVE-2016-4483,
+ CVE-2016-4658, CVE-2016-5131).
+
+* Fri Apr 08 2016 Ivan Zakharyaschev <imz@altlinux.org> 1:2.9.3.0.5.6511-alt1.1.1
+- (NMU) Rebuild with python3-3.5.1-alt3 to get rid of the meaningless __pycache__/ dep
+ (it is meaningless because arbitrary packages package that dir).
+
+* Thu Mar 17 2016 Ivan Zakharyaschev <imz@altlinux.org> 1:2.9.3.0.5.6511-alt1.1
+- (NMU) rebuild with python3-3.5 & rpm-build-python3-0.1.10
+ (for ABI dependence and new python3(*) reqs)
+
+* Fri Mar 11 2016 Dmitry V. Levin <ldv@altlinux.org> 1:2.9.3.0.5.6511-alt1
+- v2.9.3 -> v2.9.3-5-g65112cb.
+
+* Fri Nov 20 2015 Dmitry V. Levin <ldv@altlinux.org> 1:2.9.3-alt1
+- Updated to v2.9.3.
+
+* Wed Nov 12 2014 Dmitry V. Levin <ldv@altlinux.org> 1:2.9.2-alt1
+- Updated to v2.9.2-5-g7580ce0 (closes: #30267).
+- Built and packaged python3-module-%name.
+
+* Wed Mar 27 2013 Dmitry V. Levin <ldv@altlinux.org> 1:2.9.0-alt1
+- Updated to v2.9.0-42-gf7aeda2.
+
+* Tue Jul 17 2012 Dmitry V. Levin <ldv@altlinux.org> 1:2.8.0-alt1
+- Updated to v2.8.0-3-g549f06a.
+- Unexported 13 internal functions which are not supposed to be exported.
+
+* Thu Feb 09 2012 Dmitry V. Levin <ldv@altlinux.org> 1:2.7.8-alt8
+- Updated to v2.7.8-48-gca03efc.
+
+* Thu Jan 12 2012 Dmitry V. Levin <ldv@altlinux.org> 1:2.7.8-alt7
+- Updated to v2.7.8-41-g81809d5.
+- tests: added w3.org xmlts testsuite for runxmlconf.
+
+* Fri Oct 21 2011 Vitaly Kuznetsov <vitty@altlinux.ru> 1:2.7.8-alt6.1
+- Rebuild with Python-2.7
+
+* Mon Apr 25 2011 Dmitry V. Levin <ldv@altlinux.org> 1:2.7.8-alt6
+- Updated to v2.7.8-15-gd7958b2.
+
+* Sun Feb 27 2011 Alexey Tourbin <at@altlinux.ru> 1:2.7.8-alt5
+- Disabled dependency on zlib-devel.
+
+* Mon Feb 07 2011 Alexey Tourbin <at@altlinux.ru> 1:2.7.8-alt4.1
+- Rebuilt for debuginfo.
+
+* Wed Jan 12 2011 Dmitry V. Levin <ldv@altlinux.org> 1:2.7.8-alt4
+- Fixed structured error handlers interoperability regression introduced
+ between 2.7.3 and 2.7.4 libxml2 releases (closes: #24379).
+
+* Mon Dec 27 2010 Dmitry V. Levin <ldv@altlinux.org> 1:2.7.8-alt3
+- Updated to v2.7.8-7-gfec31bc (fixes CVE-2010-4494).
+
+* Wed Dec 15 2010 Dmitry V. Levin <ldv@altlinux.org> 1:2.7.8-alt2
+- Build without libbfd-devel.
+
+* Fri Nov 05 2010 Dmitry V. Levin <ldv@altlinux.org> 1:2.7.8-alt1
+- Updated to v2.7.8-1-g0081987.
+
+* Thu Oct 07 2010 Alexey Tourbin <at@altlinux.ru> 1:2.7.7-alt1
+- 2.7.3 -> v2.7.7-11-gd2190fa
+- libxml2.lds: fixup transition to upstream ABI versioning
+
+* Fri Nov 06 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1:2.7.3-alt2.1
+- Rebuilt with python 2.6
+
+* Mon Aug 17 2009 Dmitry V. Levin <ldv@altlinux.org> 1:2.7.3-alt2
+- Applied FICORA #245608 patches for CVE-2009-2414 and CVE-2009-2416.
+- xmlversion.h: Removed ATTRIBUTE_PRINTF redefinition.
+- Fixed some compiler warnings.
+
+* Sat Mar 07 2009 Alexey Tourbin <at@altlinux.ru> 1:2.7.3-alt1
+- 2.7.2+svn3803 -> 2.7.3
+
+* Tue Nov 25 2008 Alexey Tourbin <at@altlinux.ru> 1:2.7.2-alt2
+- updated to svn revision 3803 (fixes CVE-2008-4225, CVE-2008-4226)
+
+* Tue Oct 07 2008 Alexey Tourbin <at@altlinux.ru> 1:2.7.2-alt1
+- 2.6.32 -> 2.7.2
+- made libxml2-doc subpackage noarch
+
+* Mon Sep 01 2008 Alexey Tourbin <at@altlinux.ru> 1:2.6.32-alt3
+- upstream update for CVE-2008-3281 to avoid ABI issues
+
+* Thu Aug 21 2008 Alexey Tourbin <at@altlinux.ru> 1:2.6.32-alt2
+- applied upstream fix for recursive evaluation of entities (CVE-2008-3281)
+
+* Tue Apr 22 2008 Alexey Tourbin <at@altlinux.ru> 1:2.6.32-alt1
+- 2.6.31 -> 2.6.32
+
+* Sat Feb 09 2008 Grigory Batalov <bga@altlinux.ru> 1:2.6.31-alt1.1
+- Rebuilt with python-2.5.
+
+* Mon Jan 14 2008 Alexey Tourbin <at@altlinux.ru> 1:2.6.31-alt1
+- 2.6.30+svn3661 -> 2.6.31 (fixes CVE-2007-6284)
+
+* Fri Oct 26 2007 Alexey Tourbin <at@altlinux.ru> 1:2.6.30-alt2
+- 2.6.30+svn3659 -> 2.6.30+svn3661 (20071016)
+- python-module-libxml2: removed manual dependency on python
+
+* Tue Oct 02 2007 Alexey Tourbin <at@altlinux.ru> 1:2.6.30-alt1
+- 2.6.29+svn3647 -> 2.6.30+svn3659 (20070904)
+
+* Sun Aug 05 2007 Alexey Tourbin <at@altlinux.ru> 1:2.6.29-alt2
+- 2.6.29+svn3644 -> 2.6.29+svn3647 (20070801)
+- enabled 'make check' by default, except for W3C XML Schema tests
+
+* Thu Jul 19 2007 Alexey Tourbin <at@altlinux.ru> 1:2.6.29-alt1
+- updated to svn revision 3644 (20070718)
+- changed src.rpm packaging to keep separate tarball with svn snapshot
+
+* Thu Apr 19 2007 Alexey Tourbin <at@altlinux.ru> 1:2.6.28-alt1
+- updated to 2.6.28 release
+- linked libxml2mod.so python module with libpython
+
+* Sun Mar 18 2007 Alexey Tourbin <at@altlinux.ru> 1:2.6.27-alt4
+- updated to svn revision 3591 (20070314)
+- renamed python-modules-libxml2 package to python-module-libxml2,
+ to match python policy
+
+* Tue Feb 20 2007 Alexey Tourbin <at@altlinux.ru> 1:2.6.27-alt3
+- updated to svn revision 3586 (20070216)
+
+* Sun Jan 07 2007 Alexey Tourbin <at@altlinux.ru> 1:2.6.27-alt2
+- updated to 20061214 cvs snapshot
+
+* Mon Oct 30 2006 Alexey Tourbin <at@altlinux.ru> 1:2.6.27-alt1
+- 2.6.26 -> 2.6.27+
+- imported cvs sources into git and built with gear
+- introduced symbol versioning for the shared library, starting with
+ 2.6.13 release (LIBXML2_2.6.13, LIBXML2_2.6.14, ..., LIBXML2_2.6.27)
+- removed libxml.so.2 provides and symlink
+- ChangeLog not packaged, NEWS is just good enough
+
+* Sun Jun 11 2006 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.26-alt2
+- Patch2: unescape file URIs for I/O, leave others intact
+
+* Thu Jun 08 2006 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.26-alt1
+- Release 2.6.26
+- Patch1: in libxml-2.0.pc, move internally used libraries to Libs.private
+ (bug 9448)
+- Patch2 has gone upstream
+
+* Thu Jun 01 2006 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.24-alt1
+- Release 2.6.24
+- Patch1 went upstream
+- Patch2: fix a typo in configure
+
+* Tue Apr 18 2006 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.23-alt2
+- Patch1: honor --nonet when --postvalid is given (GNOME bug 337483)
+
+* Thu Feb 02 2006 ALT QA Team Robot <qa-robot@altlinux.org> 1:2.6.23-alt1.1
+- Rebuilt for new pkg-config dependencies.
+
+* Sun Jan 08 2006 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.23-alt1
+- 2.6.23
+
+* Thu Sep 15 2005 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.22-alt1
+- 2.6.22
+- Added gtk-doc files to the doc package
+- buildreq
+
+* Mon Sep 05 2005 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.21-alt1
+- New upstream release
+
+* Tue Jul 12 2005 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.20-alt1
+- New upstream release
+
+* Tue Apr 05 2005 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.19-alt1
+- New upstream release
+
+* Mon Mar 14 2005 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.18-alt1
+- New upstream release
+- Built with new Python
+
+* Mon Jan 17 2005 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.17-alt1
+- New upstream release
+
+* Thu Dec 16 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.16-alt2
+- Fixed docs install
+- Patch0 considered harmful
+
+* Thu Nov 11 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.16-alt1
+- New upstream release
+
+* Sun Oct 31 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.15-alt1
+- New upstream release
+- Patch1 is obsolete
+
+* Wed Oct 27 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.14-alt2
+- Fixes for buffer overflows from SuSE, provided by LDV [Patch1]
+
+* Fri Oct 01 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.14-alt1
+- New upstream release
+
+* Mon Sep 20 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.13-alt1
+- New upstream release
+
+* Tue Aug 24 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.12-alt1
+- New upstream release
+- Grouped xml-utils under 'Text tools'
+
+* Thu Jul 15 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.11-alt2
+- Python package renamed to comply with the New Policy
+
+* Thu Jul 08 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.11-alt1
+- New upstream release
+
+* Mon Apr 19 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.9-alt1
+- New upstream release
+
+* Sun Mar 28 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.8-alt1
+- New upstream release
+
+* Tue Feb 24 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.7-alt1
+- New upstream release
+
+* Fri Feb 13 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.6-alt1
+- New upstream release
+- Patch1 gone upstream
+
+* Wed Feb 04 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.5-alt2
+- Patch from CVS to prevent an XInclude-related crash in the XML::LibXML
+ test suite and elsewhere (GNOME bug #133106) [Patch1]
+
+* Tue Jan 27 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.5-alt1
+- New upstream release
+- Patch1 gone upstream
+- Disable check because test target is broken
+
+* Wed Jan 21 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.4-alt3
+- Buildreq against Python 2.3
+
+* Thu Jan 01 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.4-alt2
+- Fix XInclude bugs [Patch1]
+- buildreq
+
+* Wed Dec 31 2003 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.4-alt1
+- New upstream release
+- Patch1 gone upstream
+- Happy New Year :)
+
+* Thu Dec 25 2003 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.3-alt2
+- CVS patch to fix an XInclude problem (GNOME bug #129932) [Patch1]
+
+* Thu Dec 11 2003 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.3-alt1
+- New upstream release
+- Patch1 is obsolete
+- Patch2 gone upstream
+
+* Thu Dec 11 2003 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.2-alt3
+- Bugfix from CVS for Gnome Bugzilla bug #126817 [Patch2]
+
+* Thu Nov 27 2003 Alexey Tourbin <at@altlinux.ru> 1:2.6.2-alt2
+- Do not package .la files.
+
+* Mon Nov 10 2003 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.6.2-alt1
+- Updated to 2.6.2
+- Make the tests pass [Patch1]
+
+* Tue Sep 16 2003 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.5.11-alt1
+- Upstream release 2.5.11
+
+* Mon Aug 18 2003 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.5.10-alt1
+- New version
+- Eliminated duplication of doc files
+
+* Sat Jul 12 2003 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.5.8-alt1
+- New version
+
+* Sat Jun 21 2003 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.5.7-alt2
+- Fixed up the anachronistic aclocal m4 file, by request from Alexey Morozov.
+ Renamed the file libxml2.m4
+
+* Mon May 05 2003 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.5.7-alt1
+- New version
+
+* Fri Apr 04 2003 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.5.6-alt1
+- 2.5.6
+
+* Fri Jan 17 2003 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.5.1-alt1
+- Updated to 2.5.1
+- Manpage patch gone upstream
+
+* Fri Dec 13 2002 Dmitry V. Levin <ldv@altlinux.org> 1:2.4.30-alt1
+- Updated to 2.4.30
+
+* Thu Dec 05 2002 Dmitry V. Levin <ldv@altlinux.org> 1:2.4.28-alt2
+- Applied cvs patch from Marcus Clarke fixing a problem in entities
+ parsing that was detected in KDe documentations environment.
+
+* Sat Nov 30 2002 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.4.28-alt1
+- 2.4.28
+- doc subpackage
+
+* Thu Nov 21 2002 Dmitry V. Levin <ldv@altlinux.org> 1:2.4.27-alt1
+- 2.4.27
+- Added dependence on xml-common.
+
+* Sun Nov 03 2002 Mikhail Zabaluev <mhz@altlinux.ru> 1:2.4.26-alt0.1
+- 2.4.26, I hope it will behave now
+- disable static build by default
+
+* Wed Oct 09 2002 Stanislav Ievlev <inger@altlinux.ru> 1:2.4.24-alt2
+- increase release to satisfy rpm
+ (rpm ignore serial if version and release of old and new package a same)
+
+* Wed Oct 09 2002 Stanislav Ievlev <inger@altlinux.ru> 1:2.4.24-alt1
+- rollback to 2.4.24: new version is too buggy.
+
+* Mon Oct 07 2002 Dmitry V. Levin <ldv@altlinux.org> 2.4.25-alt1
+- 2.4.25
+- Fixed doc installation.
+
+* Thu Sep 12 2002 Mikhail Zabaluev <mhz@altlinux.ru> 2.4.24-alt1
+- 2.4.24
+
+* Mon Jul 22 2002 Mikhail Zabaluev <mhz@altlinux.ru> 2.4.23-alt1
+- 2.4.23
+- Fixed doc installation
+
+* Sat Jun 08 2002 Mikhail Zabaluev <mhz@altlinux.ru> 2.4.22-alt1
+- 2.4.22
+
+* Sat May 04 2002 Mikhail Zabaluev <mhz@altlinux.ru> 2.4.21-alt1
+- 2.4.21
+- Fixed BuildRequires
+- postun_ldconfig
+
+* Sat Apr 27 2002 Dmitry V. Levin <ldv@alt-linux.org> 2.4.20-alt1
+- 2.4.20
+
+* Tue Mar 19 2002 Dmitry V. Levin <ldv@alt-linux.org> 2.4.18-alt1
+- 2.4.18.
+- Repackaged docs.
+
+* Wed Feb 20 2002 Dmitry V. Levin <ldv@alt-linux.org> 2.4.16-alt1
+- 2.4.16.
+
+* Tue Feb 12 2002 Dmitry V. Levin <ldv@alt-linux.org> 2.4.15-alt1
+- 2.4.15.
+
+* Mon Feb 11 2002 Dmitry V. Levin <ldv@alt-linux.org> 2.4.14-alt1
+- 2.4.14.
+- Added python subpackage.
+
+* Wed Jan 16 2002 Dmitry V. Levin <ldv@alt-linux.org> 2.4.13-alt1
+- 2.4.13
+
+* Tue Nov 27 2001 Dmitry V. Levin <ldv@alt-linux.org> 2.4.11-alt1
+- 2.4.11
+
+* Mon Nov 12 2001 Dmitry V. Levin <ldv@alt-linux.org> 2.4.10-alt1
+- 2.4.10
+
+* Tue Nov 06 2001 Dmitry V. Levin <ldv@alt-linux.org> 2.4.8-alt1
+- 2.4.8
+- Renamed xmllint subpackage to xml-utils.
+
+* Mon Nov 05 2001 Dmitry V. Levin <ldv@alt-linux.org> 2.4.7-alt1
+- 2.4.7
+- Packaged xmlcatalog.
+- Packaged %_libdir/pkgconfig/* files.
+
+* Fri Oct 12 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.4.6-alt1
+- 2.4.6
+
+* Mon Sep 24 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.4.5-alt1
+- 2.4.5
+
+* Thu Sep 13 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.4.4-alt1
+- 2.4.4
+
+* Mon Aug 27 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.4.3-alt1
+- 2.4.3
+
+* Fri Aug 17 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.4.2-alt2
+- Rebuilt.
+
+* Thu Aug 16 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.4.2-alt1
+- 2.4.2
+
+* Thu Jul 26 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.4.1-alt1
+- 2.4.1
+
+* Wed Jul 11 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.4.0-alt1
+- 2.4.0
+
+* Thu Jul 05 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.3.13-alt1
+- 2.3.13
+
+* Mon Jun 18 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.3.11-alt1
+- 2.3.11
+
+* Mon Jun 04 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.3.10-alt1
+- 2.3.10
+
+* Tue May 22 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.3.9-alt1
+- 2.3.9
+- Moved static library to devel-static subpackage.
+
+* Sat May 05 2001 Rider <rider@altlinux.ru> 2.3.8-alt1
+- 2.3.8
+
+* Tue Mar 27 2001 Dmitry V. Levin <ldv@altlinux.ru> 2.3.5-alt1
+- 2.3.5
+
+* Sun Mar 11 2001 Dmitry V. Levin <ldv@fandra.org> 2.3.4-ipl1mdk
+- 2.3.4
+
+* Sun Mar 04 2001 Dmitry V. Levin <ldv@fandra.org> 2.3.3-ipl1mdk
+- 2.3.3
+
+* Mon Feb 26 2001 Dmitry V. Levin <ldv@fandra.org> 2.3.2-ipl1mdk
+- 2.3.2
+
+* Sat Feb 17 2001 Dmitry V. Levin <ldv@fandra.org> 2.3.1-ipl1mdk
+- 2.3.1
+
+* Sun Feb 11 2001 Dmitry V. Levin <ldv@fandra.org> 2.3.0-ipl2mdk
+- Provides libxml.so.2 for compatibility.
+
+* Fri Feb 09 2001 Dmitry V. Levin <ldv@fandra.org> 2.3.0-ipl1mdk
+- 2.3.0
+- Removed "Conflicts: libxml-devel" tag from %name-devel package.
+
+* Sat Jan 27 2001 Dmitry V. Levin <ldv@fandra.org> 2.2.12-ipl1mdk
+- 2.2.12
+
+* Sun Jan 07 2001 Dmitry V. Levin <ldv@fandra.org> 2.8.11-ipl3mdk
+- 2.8.11
+- Moved xmllint to separate subpackage.
+- Specfile cleanup; updated URL, summaries and descriptions.
+- Added libxml.m4 and manpages.
+- Relocated html documentation.
+
+* Wed Nov 29 2000 AEN <aen@logic.ru>
+- build for RE
+
+* Tue Nov 14 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 2.2.8-1mdk
+- bump up the version.
+
+* Fri Nov 03 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 2.2.7-1mdk
+- new and shiny version.
+
+* Sun Oct 29 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 2.2.6-1mdk
+- shiny version.
+
+* Sun Oct 15 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 2.2.4-1mdk
+- very new and shiny version.
+
+* Sat Aug 26 2000 Yoann Vandoorselaere <yoann@mandrakesoft.com> 2.2.2-2mdk
+- corrected bug reported by
+ Reinhard Katzmann <reinhard.katzmann@neckar-alb.de> :
+ Requires : %name = {PACKAGE_VERSION}
+
+* Tue Aug 22 2000 Yoann Vandoorselaere <yoann@mandrakesoft.com> 2.2.2-1mdk
+- updated to libxml version 2.2.2
+
+* Mon Aug 07 2000 Frederic Lepied <flepied@mandrakesoft.com> 1.8.9-3mdk
+- automatically added BuildRequires
+
+* Fri Jul 28 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 1.8.9-2mdk
+- rebuild
+
+* Sat Jul 22 2000 Geoffrey Lee <snailtalk@linux-mandrake.com> 1.8.9-1mdk
+- new version
+- big move
+
+* Thu Jul 6 2000 dam's <damien@mandrakesoft.com> 1.8.8-4mdk
+- spec cleanup.
+
+* Thu Jul 06 2000 Geoffrey Lee <snailtalk@linux-mandrake.com> 1.8.8-3mdk
+- use some macros
+
+* Tue Jul 4 2000 dam's <damien@mandrakesoft.com> 1.8.8-2mdk
+- moved xml-config to devel package. Thanx to Stefan
+
+* Tue Jul 4 2000 dam's <damien@mandrakesoft.com> 1.8.8-1mdk
+- updated.
+- spec cleanup.
+
+* Tue Apr 18 2000 Lenny Cartier <lenny@mandrakesoft.com> 1.8.7-1mdk
+- fix release tag
+
+* Sun Apr 16 2000 Daouda Lo <daouda@mandrakesoft.com> 1.8.7-1mdk
+- release from helix stuffs.
+
+* Wed Mar 22 2000 Lenny Cartier <lenny@mandrakesoft.com> 1.8.6-2mdk
+- fix group
+
+* Sun Feb 20 2000 Axalon Bloodstone <axalon@mandrakesoft.com> 1.8.6-1mdk
+- 1.8.6
+
+* Sun Oct 31 1999 Axalon Bloodstone <axalon@linux-mandrake.com>
+- SMP build/check
+- 1.7.3
+
+* Fri Sep 24 1999 Axalon Bloodstone <axalon@linux-mandrake.com>
+- 1.7.1
+
+* Thu Jul 22 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
+- 1.4.
+
+* Wed Jun 30 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
+- 1.2.0.
+
+* Tue May 11 1999 Bernhard Rosenkrц╓nzer <bero@mandrakesoft.com>
+- Mandrake adaptions
+
+* Thu Mar 04 1999 Michael Fulbright <drmike@redhat.com>
+- version 1.0.0
+
+* Fri Feb 12 1999 Michael Fulbright <drmike@redhat.com>
+- version 0.99.5 built against gnome-libs-0.99.8
+
+* Wed Feb 03 1999 Michael Fulbright <drmike@redhat.com>
+- version 0.99.5
+
+* Wed Jan 06 1999 Michael Fulbright <drmike@redhat.com>
+- made clean section work again
+
+* Wed Dec 16 1998 Michael Fulbright <drmike@redhat.com>
+- bumped to 0.99.0 for GNOME freeze
+
+* Sun Oct 4 1998 Daniel Veillard <Daniel.Veillard@w3.org>
+- Added xml-config to the package
+
+* Thu Sep 24 1998 Michael Fulbright <msf@redhat.com>
+- Built release 0.30
diff --git a/python/Makefile.am b/python/Makefile.am
index 34aed96c..8d2fd4ba 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS = 1.4 foreign
SUBDIRS = . tests
-docsdir = $(datadir)/doc/libxml2-python-$(LIBXML_VERSION)
+docsdir = @HTML_DIR@/python
dist_docs_DATA = TODO
EXTRA_DIST = \
diff --git a/python/libxml.c b/python/libxml.c
index 3b66bd61..ee6894f1 100644
--- a/python/libxml.c
+++ b/python/libxml.c
@@ -1621,6 +1621,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx, const char *msg,
PyObject *message;
PyObject *result;
char str[1000];
+ unsigned char *ptr = (unsigned char *)str;
#ifdef DEBUG_ERROR
printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
@@ -1637,12 +1638,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx, const char *msg,
str[999] = 0;
va_end(ap);
+#if PY_MAJOR_VERSION >= 3
+ /* Ensure the error string doesn't start at UTF8 continuation. */
+ while (*ptr && (*ptr & 0xc0) == 0x80)
+ ptr++;
+#endif
+
list = PyTuple_New(2);
PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
- message = libxml_charPtrConstWrap(str);
+ message = libxml_charPtrConstWrap(ptr);
PyTuple_SetItem(list, 1, message);
result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
+ /* Forget any errors caused in the error handler. */
+ PyErr_Clear();
Py_XDECREF(list);
Py_XDECREF(result);
}
diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am
index 227e24df..f5831210 100644
--- a/python/tests/Makefile.am
+++ b/python/tests/Makefile.am
@@ -1,4 +1,4 @@
-exampledir = $(datadir)/doc/libxml2-python-$(LIBXML_VERSION)/examples
+exampledir = @HTML_DIR@/python/examples
dist_example_DATA = $(PYTESTS) $(XMLS)
PYTESTS= \
diff --git a/python/types.c b/python/types.c
index ed284ec7..fa5a1814 100644
--- a/python/types.c
+++ b/python/types.c
@@ -150,6 +150,10 @@ libxml_charPtrConstWrap(const char *str)
return (Py_None);
}
ret = PY_IMPORT_STRING(str);
+ if (ret == NULL) {
+ Py_INCREF(Py_None);
+ return (Py_None);
+ }
return (ret);
}
diff --git a/save.h b/save.h
index 192b6741..ce8d41d0 100644
--- a/save.h
+++ b/save.h
@@ -14,6 +14,8 @@
#include <libxml/tree.h>
+#pragma GCC visibility push(hidden)
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -32,5 +34,8 @@ xmlChar *xmlEncodeAttributeEntities(xmlDocPtr doc, const xmlChar *input);
#ifdef __cplusplus
}
#endif
+
+#pragma GCC visibility pop
+
#endif /* __XML_SAVE_H__ */
diff --git a/testStructuredErrorFunc.c b/testStructuredErrorFunc.c
new file mode 100644
index 00000000..645334c1
--- /dev/null
+++ b/testStructuredErrorFunc.c
@@ -0,0 +1,69 @@
+#include <string.h>
+#include <libxml/SAX2.h>
+
+xmlStructuredErrorFunc called_func;
+static void *called_data;
+#define unset_code ((xmlStructuredErrorFunc) 0xbadc0ded)
+#define unset_data ((void *) 0x8badf00d)
+
+static void ctxt_error_func(void *p, xmlErrorPtr e ATTRIBUTE_UNUSED)
+{
+ called_func = ctxt_error_func;
+ called_data = p;
+}
+#define ctxt_error_data ((void *) 0xdeadbeef)
+
+static void structured_error_func(void *p, xmlErrorPtr e ATTRIBUTE_UNUSED)
+{
+ called_func = structured_error_func;
+ called_data = p;
+}
+#define structured_error_data ((void *) 0xcafebabe)
+
+static int test_error_handler(int set_cef, int set_sef)
+{
+ xmlStructuredErrorFunc expected_func = unset_code;
+ void *expected_data = unset_data;
+ int rc;
+
+ xmlParserCtxtPtr ctxt = xmlCreateDocParserCtxt((const xmlChar *) "1");
+ if (!ctxt) {
+ perror("xmlCreateMemoryParserCtxt");
+ return 1;
+ }
+
+ memset(ctxt->sax, 0, sizeof(*ctxt->sax));
+ ctxt->sax->initialized = XML_SAX2_MAGIC;
+
+ if (set_cef) {
+ expected_func = ctxt->sax->serror = ctxt_error_func;
+ expected_data = ctxt->userData = ctxt_error_data;
+ }
+
+ if (set_sef) {
+ xmlSetStructuredErrorFunc(structured_error_data,
+ structured_error_func);
+ if (!set_cef) {
+ expected_func = structured_error_func;
+ expected_data = structured_error_data;
+ }
+ } else
+ xmlSetStructuredErrorFunc(NULL, NULL);
+
+ called_func = unset_code;
+ called_data = unset_data;
+ xmlParseDocument(ctxt);
+ rc = expected_func != called_func || expected_data != called_data;
+
+ if (ctxt->myDoc)
+ xmlFreeDoc(ctxt->myDoc);
+ xmlFreeParserCtxt(ctxt);
+
+ return rc;
+}
+
+int main(void)
+{
+ return test_error_handler(0, 0) + test_error_handler(0, 1) +
+ test_error_handler(1, 0) + test_error_handler(1, 1);
+}
diff --git a/timsort.h b/timsort.h
index 383584fb..87377991 100644
--- a/timsort.h
+++ b/timsort.h
@@ -40,6 +40,8 @@
typedef unsigned __int64 uint64_t;
#endif
+#pragma GCC visibility push(hidden)
+
#ifndef SORT_NAME
#error "Must declare SORT_NAME"
#endif
@@ -599,3 +601,5 @@ void TIM_SORT(SORT_TYPE *dst, const size_t size) {
#undef TIM_SORT_COLLAPSE
#undef TIM_SORT_RUN_T
#undef TEMP_STORAGE_T
+
+#pragma GCC visibility pop
diff --git a/xml2-config.1 b/xml2-config.1
index 4dec38f9..8cf9858b 100644
--- a/xml2-config.1
+++ b/xml2-config.1
@@ -16,7 +16,6 @@ Print the currently installed version of \fIGNOME-XML\fP on the standard output.
.TP 8
.B \-\-libs
Print the linker flags that are necessary to link a \fIGNOME-XML\fP program.
-Add \-\-dynamic after --libs to print only shared library linking information.
.TP 8
.B \-\-cflags
Print the compiler flags that are necessary to compile a \fIGNOME-XML\fP program.
diff --git a/xml2-config.in b/xml2-config.in
index 5863ffa0..f55a798a 100644
--- a/xml2-config.in
+++ b/xml2-config.in
@@ -17,7 +17,6 @@ Known values for OPTION are:
--prefix=DIR change libxml prefix [default $prefix]
--exec-prefix=DIR change libxml exec prefix [default $exec_prefix]
--libs print library linking information
- add --dynamic to print only shared libraries
--cflags print pre-processor and compiler flags
--modules module support enabled
--help display this help and exit
@@ -82,12 +81,7 @@ while test $# -gt 0; do
;;
--libs)
- if [ "$2" = "--dynamic" ]; then
- shift
- libs="@XML_LIBS@"
- else
- libs="@XML_LIBS@ @XML_PRIVATE_LIBS@ @MODULE_PLATFORM_LIBS@"
- fi
+ libs="@XML_LIBS@"
if [ "@XML_LIBDIR@" != "-L/usr/lib" -a "@XML_LIBDIR@" != "-L/usr/lib64" ]; then
libs="@XML_LIBDIR@ $libs"
diff --git a/xml2Conf.sh.in b/xml2Conf.sh.in
index 31228c0b..08cb2334 100644
--- a/xml2Conf.sh.in
+++ b/xml2Conf.sh.in
@@ -2,7 +2,7 @@
# Configuration file for using the XML library in GNOME applications
#
XML2_LIBDIR="@XML_LIBDIR@"
-XML2_LIBS="@XML_LIBS@ @XML_PRIVATE_LIBS@"
+XML2_LIBS="@XML_LIBS@"
XML2_INCLUDEDIR="@XML_INCLUDEDIR@"
MODULE_VERSION="xml2-@VERSION@"
diff --git a/xmlIO.c b/xmlIO.c
index 57312b97..78d41e6f 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -121,7 +121,8 @@ static int xmlOutputCallbackNr = 0;
static int xmlOutputCallbackInitialized = 0;
xmlOutputBufferPtr
-xmlAllocOutputBufferInternal(xmlCharEncodingHandlerPtr encoder);
+xmlAllocOutputBufferInternal(xmlCharEncodingHandlerPtr encoder)
+ __attribute((visibility("hidden")));
#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************
diff --git a/xmlsave.c b/xmlsave.c
index 61a40459..489505f4 100644
--- a/xmlsave.c
+++ b/xmlsave.c
@@ -847,7 +847,7 @@ htmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
static void
xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
int format = ctxt->format;
- xmlNodePtr tmp, root, unformattedNode = NULL;
+ xmlNodePtr tmp, root, unformattedNode = NULL, parent;
xmlAttrPtr attr;
xmlChar *start, *end;
xmlOutputBufferPtr buf;
@@ -856,6 +856,7 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
buf = ctxt->buf;
root = cur;
+ parent = cur->parent;
while (1) {
switch (cur->type) {
case XML_DOCUMENT_NODE:
@@ -868,7 +869,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
break;
case XML_DOCUMENT_FRAG_NODE:
- if (cur->children != NULL) {
+ /* Always validate cur->parent when descending. */
+ if ((cur->parent == parent) && (cur->children != NULL)) {
+ parent = cur;
cur = cur->children;
continue;
}
@@ -887,12 +890,23 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
break;
case XML_ELEMENT_NODE:
- if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput))
+ if ((cur != root) && (ctxt->format == 1) &&
+ (xmlIndentTreeOutput))
xmlOutputBufferWrite(buf, ctxt->indent_size *
(ctxt->level > ctxt->indent_nr ?
ctxt->indent_nr : ctxt->level),
ctxt->indent);
+ /*
+ * Some users like lxml are known to pass nodes with a corrupted
+ * tree structure. Fall back to a recursive call to handle this
+ * case.
+ */
+ if ((cur->parent != parent) && (cur->children != NULL)) {
+ xmlNodeDumpOutputInternal(ctxt, cur);
+ break;
+ }
+
xmlOutputBufferWrite(buf, 1, "<");
if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
@@ -942,6 +956,7 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
xmlOutputBufferWrite(buf, 1, ">");
if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
if (ctxt->level >= 0) ctxt->level++;
+ parent = cur;
cur = cur->children;
continue;
}
@@ -1058,13 +1073,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
break;
}
- /*
- * The parent should never be NULL here but we want to handle
- * corrupted documents gracefully.
- */
- if (cur->parent == NULL)
- return;
- cur = cur->parent;
+ cur = parent;
+ /* cur->parent was validated when descending. */
+ parent = cur->parent;
if (cur->type == XML_ELEMENT_NODE) {
if (ctxt->level > 0) ctxt->level--;
diff --git a/xpath.c b/xpath.c
index 7497ba07..a94f2a2c 100644
--- a/xpath.c
+++ b/xpath.c
@@ -3234,7 +3234,7 @@ xmlXPathFormatNumber(double number, char buffer[], int buffersize)
/* Finally copy result back to caller */
size = strlen(work) + 1;
- if (size > buffersize) {
+ if (size > buffersize && buffersize < sizeof(work)) {
work[buffersize - 1] = 0;
size = buffersize;
}
@@ -10983,7 +10983,7 @@ xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) {
}
if (xpctxt != NULL)
- xpctxt->depth -= 1;
+ xpctxt->depth -= 10;
}
/**
diff --git a/xzlib.h b/xzlib.h
index 7b1df15c..38150f19 100644
--- a/xzlib.h
+++ b/xzlib.h
@@ -11,9 +11,11 @@
#define LIBXML2_XZLIB_H
typedef void *xzFile; /* opaque lzma file descriptor */
+#pragma GCC visibility push(hidden)
xzFile __libxml2_xzopen(const char *path, const char *mode);
xzFile __libxml2_xzdopen(int fd, const char *mode);
int __libxml2_xzread(xzFile file, void *buf, unsigned len);
int __libxml2_xzclose(xzFile file);
int __libxml2_xzcompressed(xzFile f);
+#pragma GCC visibility pop
#endif /* LIBXML2_XZLIB_H */