summaryrefslogtreecommitdiff
blob: dce0c45b4907c9de503c6cb5674e944830e0d55c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-java/werken-xpath/werken-xpath-0.9.4_beta-r1.ebuild,v 1.1 2006/07/19 21:39:07 nelchael Exp $

inherit java-pkg-2 java-ant-2 eutils versionator

MY_PN=${PN//-/.}
MY_PV=$(replace_version_separator 3 '-')
MY_P="${MY_PN}-${MY_PV}"
DESCRIPTION="W3C XPath-Rec implementation for DOM4J"
HOMEPAGE="http://sourceforge.net/projects/werken-xpath/"
SRC_URI="mirror://gentoo/${MY_P}-src.tar.gz"
# This tarball was acquired from jpackage's src rpm of the package by the same
# name

LICENSE="werken.xpath"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="doc source"

DEPEND=">=virtual/jdk-1.4
	dev-java/ant-core
	dev-java/antlr
	source? ( app-arch/zip )"
RDEPEND=">=virtual/jre-1.4
	~dev-java/jdom-1.0_beta9"

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

ant_src_unpack() {
	unpack ${A}
	cd ${S}

	# Courtesy of JPackages :)
	epatch ${FILESDIR}/${P}-jpp-compile.patch
	epatch ${FILESDIR}/${P}-jpp-jdom.patch
	epatch ${FILESDIR}/${P}-jpp-tests.patch
	epatch ${FILESDIR}/${P}-gentoo.patch

	cd ${S}/lib
	# In here we have ant starter scripts
	rm -fr bin
	rm -f *.jar

	# compile target needs these
	java-pkg_jar-from jdom-1.0_beta9
	java-pkg_jar-from antlr
}

src_compile() {
	local antflags="package"

	# java.class.path is used by the prepare.grammars target that
	# runs antlr
	local jdomjars="$(java-pkg_getjars jdom-1.0_beta9)"
	local antlrjars="$(java-pkg_getjars antlr)"
	local antflags="${antflags} -Djava.class.path=${jdomjars}:${antlrjars}"

	use doc && antflags="${antflags} javadoc -Dbuild.javadocs=build/api"

	eant ${antflags} || die "compile failed"
}

src_install() {
	java-pkg_dojar build/${MY_PN}.jar

	dodoc README TODO LIMITATIONS
	use doc && java-pkg_dohtml -r build/api
	use source && java-pkg_dosrc src/*
}