# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils toolchain-funcs
DESCRIPTION="Program to convert XML to into Lisp S-Exp"
HOMEPAGE="http://www.pmsf.de/resources/lisp/expat.html"
SRC_URI="http://www.pmsf.de/pub/download/elements.c"
LICENSE="public-domain"
SLOT="0"
KEYWORDS="x86 amd64"

IUSE=""

RESTRICT="mirror"

RDEPEND="dev-libs/expat"

DEPEND="${RDEPEND}
	sys-apps/sed"

S="${WORKDIR}/${P}"

src_unpack() {
	mkdir ${S}
	sed ${DISTDIR}/${A} -e 's/xmlparse\.h/expat\.h/' > ${S}/${A}
}

src_compile() {
	CC=$(tc-getCC)
	${CC} -O2 -o ${S}/xml-to-sexp ${S}/${A} -lexpat \
	|| die "compiling failed"
}

src_install() {
	dobin xml-to-sexp
}
