--- /dev/null
+# ChangeLog for app-text/xml2
+# Copyright 1999-2004 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/xml2/ChangeLog,v 1.1 2004/11/07 09:49:18 usata Exp $
+
+*xml2-0.3 (07 Nov 2004)
+
+ 07 Nov 2004; Mamoru KOMACHI <usata@gentoo.org> +metadata.xml,
+ +files/xml2-0.3-libxml2.patch, +xml2-0.3.ebuild:
+ Initial import. Ebuild submitted by James Rowe <jnrowe@ukfsn.org>;
+ bug #64494.
+
--- /dev/null
+diff -pruN a/2xml.c b/2xml.c
+--- a/2xml.c 2001-01-02 18:27:07.000000000 +0000
++++ b/2xml.c 2004-09-15 02:49:23.000000000 +0100
+@@ -24,7 +24,7 @@
+ #include <assert.h>
+ #include <ctype.h>
+
+-#include <HTMLparser.h>
++#include <libxml/HTMLparser.h>
+
+ int do_html;
+ int in_tag = 0;
+@@ -116,7 +116,7 @@ static void leave(const char *name)
+ }
+ }
+
+-static void characters(const char *stuff,const char *context)
++static void LOCAL_characters(const char *stuff,const char *context)
+ {
+ switch (context[0]) {
+ case '!':
+@@ -183,7 +183,7 @@ static void line(char *data)
+ }
+
+ if (NULL == name && NULL == *ptr && NULL != content)
+- characters("\n",context);
++ LOCAL_characters("\n",context);
+
+ release(ptr);
+
+@@ -204,7 +204,7 @@ static void line(char *data)
+ }
+
+ *ptr = NULL;
+- if (NULL != content) characters(content,context);
++ if (NULL != content) LOCAL_characters(content,context);
+ }
+
+ int main(int argc,char *argv[])
+diff -pruN a/makefile b/makefile
+--- a/makefile 2001-01-31 17:59:53.000000000 +0000
++++ b/makefile 2004-09-15 02:43:25.000000000 +0100
+@@ -4,9 +4,9 @@ FILES=xml2 html2 2html 2xml csv2 2csv
+ TAR=xml2-$(VERSION).tar.gz
+ DIR=xml2-$(VERSION)
+
+-CFLAGS=-g -Wall `xml-config --cflags`
+-# CFLAGS=-O2 `xml-config --cflags`
+-LDLIBS=`xml-config --libs`
++CFLAGS=-g -Wall $(shell pkg-config --cflags libxml-2.0)
++# CFLAGS=-O2 $(shell pkg-config --cflags libxml-2.0)
++LDLIBS=$(shell pkg-config --libs libxml-2.0)
+
+ all: $(FILES)
+
+diff -pruN a/xml2.c b/xml2.c
+--- a/xml2.c 2000-03-20 01:01:32.000000000 +0000
++++ b/xml2.c 2004-09-15 02:41:59.000000000 +0100
+@@ -24,8 +24,8 @@
+ #include <string.h>
+ #include <ctype.h>
+
+-#include <parser.h>
+-#include <HTMLparser.h>
++#include <libxml/parser.h>
++#include <libxml/HTMLparser.h>
+
+ struct node
+ {
--- /dev/null
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/xml2/xml2-0.3.ebuild,v 1.1 2004/11/07 09:49:18 usata Exp $
+
+inherit eutils
+
+DESCRIPTION="Converts XML to line-oriented file format"
+
+HOMEPAGE="http://dan.egnor.name/xml2/"
+
+SRC_URI="http://download.gale.org/${P}.tar.gz"
+
+LICENSE="GPL-2"
+
+SLOT="0"
+
+KEYWORDS="~x86"
+
+IUSE="xml2"
+
+DEPEND="xml2? ( dev-libs/libxml2 )
+ !xml2? ( dev-libs/libxml )"
+
+src_unpack() {
+ unpack ${A}; cd ${S}
+
+ if use xml2 ; then
+ epatch ${FILESDIR}/${P}-libxml2.patch
+ fi
+ sed -i -e "s:CFLAGS=-g -Wall:CFLAGS=${CFLAGS}:" makefile || die
+}
+
+src_compile() {
+ emake || die "make failed"
+}
+
+src_install() {
+ dobin 2csv 2xml csv2 xml2
+ # HTML support symlinks, upstream considers it be necessary
+ dosym /usr/bin/2xml /usr/bin/2html
+ dosym /usr/bin/xml2 /usr/bin/html2
+}