--- expat-2.0.1.orig/lib/xmlparse.c +++ expat-2.0.1/lib/xmlparse.c @@ -3703,6 +3703,9 @@ return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; + case -XML_TOK_PROLOG_S: + tok = -tok; + break; case XML_TOK_NONE: #ifdef XML_DTD /* for internal PE NOT referenced between declarations */ --- expat-2.0.1.orig/lib/xmltok_impl.c +++ expat-2.0.1/lib/xmltok_impl.c @@ -1744,7 +1744,7 @@ const char *end, POSITION *pos) { - while (ptr != end) { + while (ptr < end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ --- expat-2.0.1.orig/debian/compat +++ expat-2.0.1/debian/compat @@ -0,0 +1 @@ +5 --- expat-2.0.1.orig/debian/lib64expat1.install +++ expat-2.0.1/debian/lib64expat1.install @@ -0,0 +1 @@ +usr/lib64/*.so.* --- expat-2.0.1.orig/debian/expat.install +++ expat-2.0.1/debian/expat.install @@ -0,0 +1,2 @@ +usr/bin +usr/share/man/man1 --- expat-2.0.1.orig/debian/control +++ expat-2.0.1/debian/control @@ -0,0 +1,76 @@ +Source: expat +Section: text +Priority: optional +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Debian XML/SGML Group +Uploaders: Ardo van Rangelrooij +Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 5.0.22), gcc-multilib [i386 powerpc sparc s390] + +Package: libexpat1-dev +Section: libdevel +Priority: optional +Architecture: any +Provides: libexpat-dev +Conflicts: libexpat-dev +Depends: libexpat1 (= ${binary:Version}), libc6-dev | libc-dev +Description: XML parsing C library - development kit + This package contains the header file and development libraries of + expat, the C library for parsing XML. Expat is a stream oriented XML + parser. This means that you register handlers with the parser prior + to starting the parse. These handlers are called when the parser + discovers the associated structures in the document being parsed. A + start tag is an example of the kind of structures for which you may + register handlers. + +Package: libexpat1 +Section: libs +Priority: optional +Architecture: any +Depends: ${shlibs:Depends} +Description: XML parsing C library - runtime library + This package contains the runtime, shared library of expat, the C + library for parsing XML. + +Package: libexpat1-udeb +XC-Package-Type: udeb +Section: debian-installer +Priority: extra +Architecture: any +Depends: ${shlibs:Depends} +Description: XML parsing C library - runtime library + This package contains the runtime, shared library of expat, the C + library for parsing XML. + +Package: lib64expat1-dev +Section: libdevel +Priority: optional +Architecture: i386 powerpc sparc s390 +Depends: lib64expat1 (= ${binary:Version}), gcc-multilib +Description: XML parsing C library - development kit (64bit) + This package contains the header file and development libraries of + expat, the C library for parsing XML. Expat is a stream oriented XML + parser. This means that you register handlers with the parser prior + to starting the parse. These handlers are called when the parser + discovers the associated structures in the document being parsed. A + start tag is an example of the kind of structures for which you may + register handlers. + +Package: lib64expat1 +Section: libs +Priority: optional +Architecture: i386 powerpc sparc s390 +Depends: ${shlibs:Depends} +Description: XML parsing C library - runtime library (64bit) + This package contains the runtime, shared library of expat, the C + library for parsing XML. + +Package: expat +Section: text +Priority: optional +Architecture: any +Depends: ${shlibs:Depends} +Description: XML parsing C library - example application + This package contains xmlwf, an example application of expat, the C + library for parsing XML. The arguments to xmlwf are one or more + files which are each to be checked for XML well-formedness. --- expat-2.0.1.orig/debian/TODO +++ expat-2.0.1/debian/TODO @@ -0,0 +1,20 @@ +------------------------------------------------------------------------------ +To do list for expat +------------------------------------------------------------------------------ + +BUGS: +------------------------------------------------------------------------------ +Number Description +------------------------------------------------------------------------------ +245840 incorrect pointer adjustments on buffer reallocation +------------------------------------------------------------------------------ + +WISHLIST: +------------------------------------------------------------------------------ +Number Description +------------------------------------------------------------------------------ +230856 please build libexpat1-pic package for library reduction +277133 Request for XML_UNICODE support +429175 New upstream version 2.0.1 + add pkgconfig support +------------------------------------------------------------------------------ --- expat-2.0.1.orig/debian/lib64expat1-dev.install +++ expat-2.0.1/debian/lib64expat1-dev.install @@ -0,0 +1,3 @@ +usr/lib64/*.a +usr/lib64/*.la +usr/lib64/*.so --- expat-2.0.1.orig/debian/libexpat1-udeb.install +++ expat-2.0.1/debian/libexpat1-udeb.install @@ -0,0 +1 @@ +usr/lib/*.so.* --- expat-2.0.1.orig/debian/lib64expat1.shlibs +++ expat-2.0.1/debian/lib64expat1.shlibs @@ -0,0 +1 @@ +libexpat 1 lib64expat1 (>= 1.95.8) --- expat-2.0.1.orig/debian/libexpat1-dev.examples +++ expat-2.0.1/debian/libexpat1-dev.examples @@ -0,0 +1 @@ +examples/* --- expat-2.0.1.orig/debian/libexpat1.shlibs +++ expat-2.0.1/debian/libexpat1.shlibs @@ -0,0 +1,2 @@ +libexpat 1 libexpat1 (>= 1.95.8) +udeb: libexpat 1 libexpat1-udeb (>= 1.95.8) --- expat-2.0.1.orig/debian/libexpat1.install +++ expat-2.0.1/debian/libexpat1.install @@ -0,0 +1 @@ +usr/lib/*.so.* --- expat-2.0.1.orig/debian/libexpat1-dev.doc-base +++ expat-2.0.1/debian/libexpat1-dev.doc-base @@ -0,0 +1,9 @@ +Document: expat +Title: Expat XML Parser +Author: Clark Cooper +Abstract: This manual describes the Expat XML Parser library. +Section: Text + +Format: HTML +Index: /usr/share/doc/libexpat1-dev/expat.html/index.html +Files: /usr/share/doc/libexpat1-dev/expat.html/*.html --- expat-2.0.1.orig/debian/copyright +++ expat-2.0.1/debian/copyright @@ -0,0 +1,28 @@ +This is the Debian package of expat, the C library for parsing XML. + +The source package was downloaded from . + +The original packager is Adam Di Carlo . The current +maintainer is Ardo van Rangelrooij . + +Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd + and Clark Cooper + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- expat-2.0.1.orig/debian/libexpat1-dev.docs +++ expat-2.0.1/debian/libexpat1-dev.docs @@ -0,0 +1 @@ +README --- expat-2.0.1.orig/debian/changelog +++ expat-2.0.1/debian/changelog @@ -0,0 +1,363 @@ +expat (2.0.1-0ubuntu1.1) hardy-security; urgency=low + + * SECURITY UPDATE: fix DoS via malformed XML + - update lib/xmltok_impl.c to not access beyond end of input string + - http://expat.cvs.sourceforge.net/viewvc/expat/expat/lib/xmltok_impl.c?r1=1.15&r2=1.13 + - CVE-2009-2625 + * SECURITY UPDATE: fix DoS via malformed UTF-8 sequences + - update lib/xmlparse.c to properly recognize the end of a token + - http://expat.cvs.sourceforge.net/viewvc/expat/expat/lib/xmlparse.c?r1=1.164&r2=1.166 + - http://expat.cvs.sourceforge.net/viewvc/expat/expat/lib/xmlparse.c?view=log#rev1.166 + - http://expat.cvs.sourceforge.net/viewvc/expat/expat/lib/xmlparse.c?view=log#rev1.165 + - CVE-2009-3560 + + -- Jamie Strandboge Tue, 19 Jan 2010 11:42:04 -0600 + +expat (2.0.1-0ubuntu1) hardy; urgency=low + + * New upstream version. LP: #133808. + * Remove the old libexpat.so.0 symlink; this bug predates Ubuntu (was + fixed in version 1.95.5-1). + * Drop the extra build files in bcb5/. + + -- Matthias Klose Wed, 05 Dec 2007 17:37:50 +0100 + +expat (1.95.8-4ubuntu1) gutsy; urgency=low + + * Build 64bit packages. + + -- Matthias Klose Sat, 22 Sep 2007 10:00:04 +0200 + +expat (1.95.8-4) unstable; urgency=low + + * Acknowledged NMUs 1.95.8-3.1 - 1.95.8-3.4 + ( closes: Bug#355937, Bug#354244, Bug#342684) + * lib/expat.h: removed trailing comma from enum XML_Status + (closes: Bug#344298) + * debian/control: removed 'Provides' from libexpat1-udeb stanza + (closes: Bug#419606) + * xmlwf/xmlwf.1: removed incorrect statement on well-formedness + (closes: Bug#412786 + * debian/TODO: updated + * debian/control: upgraded to Debian Policy 3.7.2 (no changes) + (thanks Bryan Donlan !) + * debian/rules: replaced $(PWD) by $(CURDIR) + * debian/control: replaced ${Source-Version} by ${Source-Version} + (thanks Bryan Donlan !) + + -- Ardo van Rangelrooij Sun, 22 Jul 2007 17:59:57 -0500 + +expat (1.95.8-3.4) unstable; urgency=low + + * Porter NMU. + * Libtool update (closes: bug#342684). + + -- Aurelien Jarno Sun, 10 Dec 2006 20:04:23 +0100 + +expat (1.95.8-3.3) unstable; urgency=low + + * NMU + * Use fixed watch file from Bart Martens. closes: #354244. + + -- Clint Adams Thu, 7 Sep 2006 22:04:05 -0400 + +expat (1.95.8-3.2) unstable; urgency=low + + * Non Maintainer Upload + * Correct mistake in patch for #355937 so that udeb: lines in shlibs file + actually refer to the udeb package + + -- Frans Pop Tue, 28 Mar 2006 22:09:52 +0200 + +expat (1.95.8-3.1) unstable; urgency=low + + * Non Maintainer Upload (closes: #355937) + * Add support for udeb dependency resolution in shlibs file + * Simplify debian/rules by making use of udeb support in debhelper + * Update debhelper compatibility to level 5 + + -- Frans Pop Sat, 18 Mar 2006 01:21:09 +0100 + +expat (1.95.8-3) unstable; urgency=low + + * Makefile.in: added $(srcdir)/expat_config.h to APIHEADER + (closes: Bug#302191) + * rebuild against latest libtool for kfreebsd-gnu + (closes: Bug#295825) + + -- Ardo van Rangelrooij Tue, 19 Apr 2005 21:50:50 -0500 + +expat (1.95.8-2) unstable; urgency=low + + * rebuild against latest libtool for kfreebsd-gnu + + -- Ardo van Rangelrooij Sat, 19 Feb 2005 13:45:36 -0600 + +expat (1.95.8-1) unstable; urgency=low + + * New upstream release + (closes: Bug#263858) + * debian/rules: added '-pthread -D_REENTRANT' to 'CFLAGS' + * Added debian/watch + + -- Ardo van Rangelrooij Tue, 19 Oct 2004 19:31:03 -0500 + +expat (1.95.6-8) unstable; urgency=low + + * debian/control: fixed typo in maintainer's email address + + -- Ardo van Rangelrooij Sun, 29 Feb 2004 11:01:15 -0600 + +expat (1.95.6-7) unstable; urgency=low + + * debian/control: upgraded to Debian Policy 3.6.1 (no changes) + * debian/control: changed 'Maintainer' to 'Debian XML/SGML Group + ' and added current + maintainer as 'Uploader' + + -- Ardo van Rangelrooij Sun, 29 Feb 2004 10:51:47 -0600 + +expat (1.95.6-6) unstable; urgency=low + + * debian/control: changed section of 'libexpat1-dev' from 'devel' + to 'libdevel' to align with override + * debian/control: changed priority of 'libexpat1-udeb' from 'optional' + to 'extra' to aliagn with override + + -- Ardo van Rangelrooij Tue, 29 Jul 2003 19:53:02 -0500 + +expat (1.95.6-5) unstable; urgency=low + + * debian/control: changed build dependency on 'debhelper' to '(>= 4.1)' + * debian/control: upgraded to Debian Policy 3.6.0 (no changes) + + -- Ardo van Rangelrooij Mon, 28 Jul 2003 22:45:43 -0500 + +expat (1.95.6-4) unstable; urgency=low + + * Added support to generate a 'libexpat1-udeb' package for the upcoming + gtk frontend for the new debian installer + (closes: Bug#183830) + * debian/rules: moved debhelper compatibility level setting to + 'debian/compat' per latest debhelper best practices + + -- Ardo van Rangelrooij Sun, 9 Mar 2003 20:42:31 -0600 + +expat (1.95.6-3) unstable; urgency=low + + * lib/expat.h: moved declaration of 'enum XML_Status' up + (closes: Bug#179914) + + -- Ardo van Rangelrooij Mon, 17 Feb 2003 19:28:14 -0600 + +expat (1.95.6-2) unstable; urgency=low + + * debian/libexpat1.shlibs: changed to 1.95.6 (oops!) + + -- Ardo van Rangelrooij Sun, 2 Feb 2003 18:24:54 -0600 + +expat (1.95.6-1) unstable; urgency=low + + * New upstream release + - fixes frequent segfault on nontrivial documents using namespaces + (closes: Bug#179462) + + -- Ardo van Rangelrooij Sun, 2 Feb 2003 14:53:04 -0600 + +expat (1.95.5-1) unstable; urgency=low + + * New upstream release + (closes: Bug#164202) + * debian/control: changed dependency for package 'libexpat1-dev' on the + C library from 'libc6-dev' to 'libc6-dev | libc-dev' + * debian/libexpat1.shlibs: added to provide info about libexpat.so.0 + (which is a symlink to libexpat.so.1 due to an NMU mishap, see below) + (closes: Bug#147751) + + -- Ardo van Rangelrooij Wed, 25 Dec 2002 14:46:32 -0600 + +expat (1.95.2-10) unstable; urgency=low + + * autogen.sh: upgraded to 'automake1.7' + * debian/rules: removed 'autotools' target as its function is now handled + by 'autogen.sh' + * debian/control: removed obsolete build dependency on 'autotools-dev' + * debian/control: added 'Provides' and 'Conflicts' with 'libexpat-dev' + for package 'libexpat1-dev' + * debian/control: upgraded to Debian Policy 3.5.8 + + -- Ardo van Rangelrooij Sat, 21 Dec 2002 23:33:34 -0600 + +expat (1.95.2-9) unstable; urgency=low + + * debian/rules: migrated documentation installation handling to debhelper + + -- Ardo van Rangelrooij Sun, 6 Oct 2002 22:52:54 -0500 + +expat (1.95.2-8) unstable; urgency=low + + * debian/rules: migrated to autoconf 2.52 and above + + -- Ardo van Rangelrooij Sun, 6 Oct 2002 15:37:04 -0500 + +expat (1.95.2-7) unstable; urgency=low + + * debian/rules: upgraded to debhelper v4 + * debian/control: changed build dependency on debhelper accordingly + * debian/rules: migrated from 'dh_movefiles' to 'dh_install' + * debian/rules: split off 'install' target from 'binary-arch' target + + -- Ardo van Rangelrooij Sat, 10 Aug 2002 11:02:25 -0500 + +expat (1.95.2-6) unstable; urgency=low + + * debian/control: removed unnecessary build dependency on 'autoconf' + + -- Ardo van Rangelrooij Sun, 9 Dec 2001 12:19:40 -0600 + +expat (1.95.2-5) unstable; urgency=low + + * Added man page for 'xmlwf' + (closes: Bug#39461) + * Converted to autotools-dev + * debian/control: added build dependency on 'autotools-dev' + * debian/control: removed build dependency on 'automake' and 'libtool' + + -- Ardo van Rangelrooij Fri, 7 Dec 2001 23:35:47 -0600 + +expat (1.95.2-4) unstable; urgency=low + + * Removed explicit 'dhelp' support since 'doc-base' now takes care of this + * debian/control: upgraded to Debian Policy 3.5.6 + + -- Ardo van Rangelrooij Sun, 4 Nov 2001 11:22:19 -0600 + +expat (1.95.2-3) unstable; urgency=high + + * Includes NMU 1.95.2-2.1 + (closes: Bug#111957) + * Added symlink from libexpat.so.0 to libexpat.so.1 to handle the + problems caused by the library soname change introduced by this NMU + (closes: Bug#116724, Bug#116727) + + -- Ardo van Rangelrooij Wed, 31 Oct 2001 11:09:47 -0600 + +expat (1.95.2-2.1) unstable; urgency=low + + * NMU. + * Added call to aclocal before call to autoconf in Makefile.in. + Closes: #111957. + * Ran 'libtoolize --force --copy' to update libtool info. This + works around problem with libtool version skew during build. + Should this be done in Makefile.in? + + -- Jeff Licquia Wed, 17 Oct 2001 10:35:46 -0600 + +expat (1.95.2-2) unstable; urgency=low + + * debian/control: added build dependency on 'libtool' + (closes: Bug#111693) + + -- Ardo van Rangelrooij Sat, 8 Sep 2001 14:29:55 -0500 + +expat (1.95.2-1) unstable; urgency=low + + * New upstream release + * debian/copyright: updated + + -- Ardo van Rangelrooij Thu, 6 Sep 2001 20:26:55 -0500 + +expat (1.95.1-6) unstable; urgency=low + + * debian/rules: fixed doc directory handling + (closes: Bug#104460) + * debian/control: upgraded to Debian Policy 3.5.5 + * xmlwf/xmlwf.c: changed to return error code 2 upon the first + processing error + (closes: Bug#82763) + + -- Ardo van Rangelrooij Sun, 15 Jul 2001 10:10:05 -0500 + +expat (1.95.1-5) unstable; urgency=low + + * conftools/config.*: updated to latest version + (closes: Bug#94772) + + -- Ardo van Rangelrooij Tue, 1 May 2001 21:49:55 -0500 + +expat (1.95.1-4) unstable; urgency=low + + * debian/control: added build dependency on 'autoconf' and 'automake' + (closes: Bug#95296) + + -- Ardo van Rangelrooij Thu, 26 Apr 2001 11:25:16 -0500 + +expat (1.95.1-3) unstable; urgency=low + + * debian/control: updated debhelper dependency to remove 'dh_testversion' + * debian/control: upgraded to Debian Policy 3.5.2 + + -- Ardo van Rangelrooij Tue, 24 Apr 2001 20:56:35 -0500 + +expat (1.95.1-2) unstable; urgency=low + + * debian/control: fixed section override disparity + + -- Ardo van Rangelrooij Mon, 29 Jan 2001 19:31:30 -0600 + +expat (1.95.1-1) unstable; urgency=low + + * New upstream release + (closes: Bug#74383, Bug#81866) + * Added doc-base and dhelp support + + -- Ardo van Rangelrooij Sun, 28 Jan 2001 09:02:53 -0600 + +expat (1.1-3) unstable; urgency=low + + * New maintainer + + -- Ardo van Rangelrooij Sat, 7 Oct 2000 13:40:57 -0500 + +expat (1.1-2) unstable; urgency=low + + * debian/rules: more debhelperification and use more FHS stuff + * debian/control: standards bumped to 3.2.1 (closes: Bug#70336) + + -- Adam Di Carlo Wed, 27 Sep 2000 00:56:10 -0400 + +expat (1.1-1) unstable; urgency=low + + * new upstream version + * debian/rules: aesthetic cleanups, use a bit more debhelper stuff to + reduce complexity + + -- Adam Di Carlo Tue, 1 Jun 1999 22:36:29 -0400 + +expat (1.0.2-1) unstable; urgency=low + + * new upstream version + * maintainer name change + * standards-version: bumped to 2.5.0 (no changes required) + + -- Adam Di Carlo Wed, 13 Jan 1999 18:35:53 -0500 + +expat (1.0-2) unstable; urgency=low + + * debian/rules: fix symlink for docdir of libxmltok1-dev + + -- Adam P. Harris Sun, 23 Aug 1998 15:51:43 -0400 + +expat (1.0-1) unstable; urgency=low + + * Initial release. + * Makefile: added MPL notice as required by license, modifications to + enable building of xmltok and xmlparse as shared and static + libraries. + * xmltok/Makefile: created to enable building libxmltok.a and + libxmltok.so + * xmlparse/Makefile: created to enable building libxmlparse.a and and + libxmlparse.so + * debian/*: Debian-specific files + + -- Adam P. Harris Mon, 17 Aug 1998 01:12:09 -0400 --- expat-2.0.1.orig/debian/libexpat1-dev.install +++ expat-2.0.1/debian/libexpat1-dev.install @@ -0,0 +1,5 @@ +usr/include +usr/lib/*.a +usr/lib/*.la +usr/lib/*.so +../../doc/* usr/share/doc/libexpat1-dev/expat.html/ --- expat-2.0.1.orig/debian/libexpat1-dev.links +++ expat-2.0.1/debian/libexpat1-dev.links @@ -0,0 +1 @@ +usr/share/doc/libexpat1-dev/expat.html/reference.html usr/share/doc/libexpat1-dev/expat.html/index.html --- expat-2.0.1.orig/debian/watch +++ expat-2.0.1/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://sf.net/expat/expat-(.*)\.tar\.gz debian uupdate --- expat-2.0.1.orig/debian/rules +++ expat-2.0.1/debian/rules @@ -0,0 +1,136 @@ +#!/usr/bin/make -f +## ---------------------------------------------------------------------- +## debian/rules : package script for expat +## ---------------------------------------------------------------------- + +## ---------------------------------------------------------------------- +## uncomment this to turn on verbose mode +#export DH_VERBOSE=1 + +## ---------------------------------------------------------------------- +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) + +BUILD64 = $(filter $(DEB_HOST_ARCH), i386 powerpc sparc s390) + +## ---------------------------------------------------------------------- +CONFFLAGS = +ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) + CONFFLAGS += --build $(DEB_HOST_GNU_TYPE) +else + CONFFLAGS += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) +endif +ifeq ($(DEB_HOST_ARCH),i386) + HOST64FLAG = --host=x86_64-linux-gnu +endif + +## ---------------------------------------------------------------------- +INSTALL = install +INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644 +INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755 +INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755 +INSTALL_DIR = $(INSTALL) -p -o root -g root -m 755 -d + +## ---------------------------------------------------------------------- +CFLAGS = -Wall -g -pthread -D_REENTRANT +LDFLAGS = -Wl,-Bsymbolic-functions + +## ---------------------------------------------------------------------- +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +## ---------------------------------------------------------------------- +UPACKAGE = $(shell dh_listpackages | grep -- -udeb$$) + +## ---------------------------------------------------------------------- +TMP_DIR = $(CURDIR)/debian/tmp + +## ---------------------------------------------------------------------- +## targets + +clean: #configure + dh_testdir + dh_testroot + rm -rf build build64 + rm -rf $(TMP_DIR)64 + dh_clean *-stamp + +configure: + ./autogen.sh + +configure-stamp: + dh_testdir +# touch configure.in && touch aclocal.m4 && touch configure + rm -rf build + mkdir -p build + cd build && \ + CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ + ../configure $(CONFFLAGS) --prefix=/usr + touch configure-stamp + +configure64-stamp: + dh_testdir + rm -rf build64 + mkdir -p build64 + cd build64 && \ + CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CC="$(CC) -m64" \ + ../configure $(CONFFLAGS) --prefix=/usr $(HOST64FLAG) + touch configure64-stamp + +build: build-stamp $(if $(BUILD64), build64-stamp) +build-stamp: configure-stamp + dh_testdir + $(MAKE) -C build + touch build-stamp + +build64-stamp: configure64-stamp + dh_testdir + $(MAKE) -C build64 + touch build64-stamp + +install: install-stamp +install-stamp: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + $(MAKE) -C build install prefix=$(TMP_DIR)/usr \ + man1dir=$(TMP_DIR)/usr/share/man/man1 +ifneq (,$(BUILD64)) + $(MAKE) -C build64 install prefix=$(TMP_DIR)64/usr + mv $(TMP_DIR)64/usr/lib $(TMP_DIR)/usr/lib64 +endif + touch install-stamp + +binary-indep: + +binary-arch: build install + dh_testdir + dh_testroot + dh_install -s --sourcedir=$(TMP_DIR) + dh_installdocs -s + dh_installexamples -s + dh_installchangelogs -s Changes + dh_link -s + dh_strip -s + dh_compress -s + dh_fixperms -s + dh_makeshlibs -s -V --add-udeb=$(UPACKAGE) + dh_installdeb -s + dh_shlibdeps -s -l $(CURDIR)/debian/libexpat1/usr/lib:$(CURDIR)/debian/lib64expat1/usr/lib + dh_gencontrol -s + dh_md5sums -s + dh_builddeb -s + +binary: binary-indep binary-arch + +.PHONY: clean build install binary-indep binary-arch binary + +## ---------------------------------------------------------------------- --- expat-2.0.1.orig/Makefile.in +++ expat-2.0.1/Makefile.in @@ -41,7 +41,7 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs MANFILE = $(srcdir)/doc/xmlwf.1 -APIHEADER = $(srcdir)/lib/expat.h $(srcdir)/lib/expat_external.h +APIHEADER = $(srcdir)/lib/expat.h $(srcdir)/lib/expat_external.h expat_config.h LIBRARY = libexpat.la DESTDIR = $(INSTALL_ROOT) --- expat-2.0.1.orig/xmlwf/xmlwf.c +++ expat-2.0.1/xmlwf/xmlwf.c @@ -849,8 +849,10 @@ if (outputType == 'm') metaEndDocument(parser); fclose(fp); - if (!result) - tremove(outName); + if (!result) { + tremove(outName); + exit(2); + } free(outName); } XML_ParserFree(parser); --- expat-2.0.1.orig/xmlwf/xmlwf.1 +++ expat-2.0.1/xmlwf/xmlwf.1 @@ -0,0 +1,292 @@ +.\" This -*- nroff -*- file has been generated from +.\" DocBook SGML with docbook-to-man on Debian GNU/Linux. +...\" +...\" transcript compatibility for postscript use. +...\" +...\" synopsis: .P! +...\" +.de P! +\\&. +.fl \" force out current output buffer +\\!%PB +\\!/showpage{}def +...\" the following is from Ken Flowers -- it prevents dictionary overflows +\\!/tempdict 200 dict def tempdict begin +.fl \" prolog +.sy cat \\$1\" bring in postscript file +...\" the following line matches the tempdict above +\\!end % tempdict % +\\!PE +\\!. +.sp \\$2u \" move below the image +.. +.de pF +.ie \\*(f1 .ds f1 \\n(.f +.el .ie \\*(f2 .ds f2 \\n(.f +.el .ie \\*(f3 .ds f3 \\n(.f +.el .ie \\*(f4 .ds f4 \\n(.f +.el .tm ? font overflow +.ft \\$1 +.. +.de fP +.ie !\\*(f4 \{\ +. ft \\*(f4 +. ds f4\" +' br \} +.el .ie !\\*(f3 \{\ +. ft \\*(f3 +. ds f3\" +' br \} +.el .ie !\\*(f2 \{\ +. ft \\*(f2 +. ds f2\" +' br \} +.el .ie !\\*(f1 \{\ +. ft \\*(f1 +. ds f1\" +' br \} +.el .tm ? font underflow +.. +.ds f1\" +.ds f2\" +.ds f3\" +.ds f4\" +'\" t +.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n +.TH "XMLWF" "1" +.SH "NAME" +xmlwf \(em Determines if an XML document is well-formed +.SH "SYNOPSIS" +.PP +\fBxmlwf\fP [\fB-s\fP] [\fB-n\fP] [\fB-p\fP] [\fB-x\fP] [\fB-e \fIencoding\fP\fP] [\fB-w\fP] [\fB-d \fIoutput-dir\fP\fP] [\fB-c\fP] [\fB-m\fP] [\fB-r\fP] [\fB-t\fP] [file ...] +.SH "DESCRIPTION" +.PP +\fBxmlwf\fP uses the Expat library to determine +if an XML document is well-formed. It is non-validating. + +.PP +If you do not specify any files on the command-line, +and you have a recent version of xmlwf, the input +file will be read from stdin. + +.SH "WELL-FORMED DOCUMENTS" +.PP +A well-formed document must adhere to the +following rules: + +.IP " \(bu" 6 +The file begins with an XML declaration. For instance, +\fB\fP. +\fINOTE:\fP xmlwf does not currently +check for a valid XML declaration. + +.IP " \(bu" 6 +Every start tag is either empty () +or has a corresponding end tag. + +.IP " \(bu" 6 +There is exactly one root element. This element must contain +all other elements in the document. Only comments, white +space, and processing instructions may come after the close +of the root element. + +.IP " \(bu" 6 +All elements nest properly. + +.IP " \(bu" 6 +All attribute values are enclosed in quotes (either single +or double). + +.PP +If the document has a DTD, and it strictly complies with that +DTD, then the document is also considered \fIvalid\fP. +xmlwf is a non-validating parser -- it does not check the DTD. +However, it does support external entities (see the -x option). + +.SH "OPTIONS" +.PP +When an option includes an argument, you may specify the argument either +separate ("d output") or mashed ("-doutput"). xmlwf supports both. +.IP "\fB-c\fP" 10 +If the input file is well-formed and xmlwf doesn't +encounter any errors, the input file is simply copied to +the output directory unchanged. +This implies no namespaces (turns off -n) and +requires -d to specify an output file. + +.IP "\fB-d output-dir\fP" 10 +Specifies a directory to contain transformed +representations of the input files. +By default, -d outputs a canonical representation +(described below). +You can select different output formats using -c and -m. + +.IP "" 10 +The output filenames will +be exactly the same as the input filenames or "STDIN" if the input is +coming from STDIN. Therefore, you must be careful that the +output file does not go into the same directory as the input +file. Otherwise, xmlwf will delete the input file before +it generates the output file (just like running +\fBcat < file > file\fP in most shells). + +.IP "" 10 + +Two structurally equivalent XML documents have a byte-for-byte +identical canonical XML representation. +Note that ignorable white space is considered significant and +is treated equivalently to data. +More on canonical XML can be found at +http://www.jclark.com/xml/canonxml.html . + +.IP "\fB-e encoding\fP" 10 +Specifies the character encoding for the document, overriding +any document encoding declaration. xmlwf +has four built-in encodings: +\fBUS-ASCII\fP, +\fBUTF-8\fP, +\fBUTF-16\fP, and +\fBISO-8859-1\fP. +Also see the -w option. + +.IP "\fB-m\fP" 10 +Outputs some strange sort of XML file that completely +describes the the input file, including character postitions. +Requires -d to specify an output file. + +.IP "\fB-n\fP" 10 +Turns on namespace processing. (describe namespaces) +-c disables namespaces. + +.IP "\fB-p\fP" 10 +Tells xmlwf to process external DTDs and parameter +entities. + +.IP "" 10 +Normally xmlwf never parses parameter entities. +-p tells it to always parse them. +-p implies -x. + +.IP "\fB-r\fP" 10 +Normally xmlwf memory-maps the XML file before parsing. +-r turns off memory-mapping and uses normal file IO calls instead. +Of course, memory-mapping is automatically turned off +when reading from STDIN. + +.IP "\fB-s\fP" 10 +Prints an error if the document is not standalone. +A document is standalone if it has no external subset and no +references to parameter entities. + +.IP "\fB-t\fP" 10 +Turns on timings. This tells Expat to parse the entire file, +but not perform any processing. +This gives a fairly accurate idea of the raw speed of Expat itself +without client overhead. +-t turns off most of the output options (-d, -m -c, ...) + +.IP "\fB-w\fP" 10 +Enables Windows code pages. +Normally, xmlwf will throw an error if it runs across +an encoding that it is not equipped to handle itself. With +-w, xmlwf will try to use a Windows code page. See +also -e. + +.IP "\fB-x\fP" 10 +Turns on parsing external entities. + +.IP "" 10 +Non-validating parsers are not required to resolve external +entities, or even expand entities at all. +Expat always expands internal entities (?), +but external entity parsing must be enabled explicitly. + +.IP "" 10 +External entities are simply entities that obtain their +data from outside the XML file currently being parsed. + +.IP "" 10 +This is an example of an internal entity: +.PP +.nf +.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n + +.fi + +.IP "" 10 +And here are some examples of external entities: + +.PP +.nf +.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n + (parsed) + (unparsed) +.fi + + +.IP "\fB--\fP" 10 +For some reason, xmlwf specifically ignores "--" +anywhere it appears on the command line. + +.PP +Older versions of xmlwf do not support reading from STDIN. + +.SH "OUTPUT" +.PP +If an input file is not well-formed, xmlwf outputs +a single line describing the problem to STDOUT. +If a file is well formed, xmlwf outputs nothing. +Note that the result code is \fInot\fP set. + +.SH "BUGS" +.PP +xmlwf returns a 0 - noerr result, even if the file is +not well-formed. There is no good way for a program to use +xmlwf to quickly check a file -- it must parse xmlwf's STDOUT. + +.PP +The errors should go to STDERR, not stdout. + +.PP +There should be a way to get -d to send its output to STDOUT +rather than forcing the user to send it to a file. + +.PP +I have no idea why anyone would want to use the -d, -c +and -m options. If someone could explain it to me, I'd +like to add this information to this manpage. + +.SH "ALTERNATIVES" +.PP +Here are some XML validators on the web: + +.PP +.nf +.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n +http://www.hcrc.ed.ac.uk/~richard/xml-check.html +http://www.stg.brown.edu/service/xmlvalid/ +http://www.scripting.com/frontier5/xml/code/xmlValidator.html +http://www.xml.com/pub/a/tools/ruwf/check.html +\ (on a page with no less than 15 ads! Shame!) +.fi + + +.SH "SEE ALSO" +.PP +.PP +.nf +.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n +The Expat home page: http://expat.sourceforge.net/ +The W3 XML specification: http://www.w3.org/TR/REC-xml +.fi + + +.SH "AUTHOR" +.PP +This manual page was written by Scott Bronson bronson@rinspin.com for +the \fBDebian GNU/Linux\fP system (but may be used by others). Permission is +granted to copy, distribute and/or modify this document under +the terms of the GNU Free Documentation +License, Version 1.1. + +...\" created by instant / docbook-to-man, Sun 02 Dec 2001, 13:56