# Distributed under the terms of the GNU General Public License v2

EAPI=4

inherit versionator

YEAR_LONG="$(get_major_version)"
YEAR_SHORT="${YEAR_LONG#20}"

if [ $(get_version_component_range 2) == 12 ] ; then
	MONTH="December"
elif [ $(get_version_component_range 2) == 11 ] ; then
	MONTH="November"
elif [ $(get_version_component_range 2) == 10 ] ; then
	MONTH="October"
elif [ $(get_version_component_range 2) == 9 ] ; then
	MONTH="September"
elif [ $(get_version_component_range 2) == 8 ] ; then
	MONTH="August"
elif [ $(get_version_component_range 2) == 7 ] ; then
	MONTH="July"
elif [ $(get_version_component_range 2) == 6 ] ; then
	MONTH="June"
elif [ $(get_version_component_range 2) == 5 ] ; then
	MONTH="May"
elif [ $(get_version_component_range 2) == 4 ] ; then
	MONTH="April"
elif [ $(get_version_component_range 2) == 3 ] ; then
	MONTH="March"
elif [ $(get_version_component_range 2) == 2 ] ; then
	MONTH="February"
elif [ $(get_version_component_range 2) == 1 ] ; then
	MONTH="January"
fi

DESCRIPTION="An XML and HTML processing toolkit, providing SAX, DOM, XPath, and XSLT implementations, written in Standard C++."
HOMEPAGE="http://www.jezuk.co.uk/cgi-bin/view/arabica"
SRC_URI="mirror://sourceforge/${PN}/${PN}/${MONTH}-${YEAR_SHORT}/${PN}-"$(get_major_version)"-${MONTH}.tar.bz2"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+boost examples expat xerces xml test"
REQUIRED_USE="|| ( expat xerces xml )"

DEPEND="boost? ( dev-libs/boost )
	expat? ( dev-libs/expat )
	xerces? ( dev-libs/xerces-c )
	xml? ( dev-libs/libxml2 )"
RDEPEND="${DEPEND}"

S=${WORKDIR}/${PN}-${YEAR_LONG}-${MONTH}

src_configure() {
	econf \
		$(use_with boost) \
		--without-elephant \
		$(use_with examples dom) \
		$(use_with expat) \
		$(use_with xerces) \
		$(use_with xml libxml2) \
		$(use_with test tests)
}