summaryrefslogtreecommitdiff
blob: 630d918e408f46e66f9eb3527c36ba5781080b6c (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
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-java/jsap/jsap-2.1.ebuild,v 1.8 2010/04/24 15:29:43 grobian Exp $

JAVA_PKG_IUSE="doc source"
inherit eutils java-pkg-2 java-ant-2

DESCRIPTION="Java Simple Arguments Parser (JSAP)"
HOMEPAGE="http://sourceforge.net/projects/jsap"
MY_PN=JSAP
MY_P=${MY_PN}-${PV}
SRC_URI="mirror://sourceforge/${PN}/${MY_P}-src.tar.gz"

LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="amd64 ppc ppc64 x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x86-solaris"
IUSE="test"

COMMON_DEP="
	>=dev-java/ant-core-1.7.0
	dev-java/xstream"

DEPEND=">=virtual/jdk-1.4
	${COMMON_DEP}
	=dev-java/snip-0.11*
	=dev-java/rundoc-0.11*
	test? (
		dev-java/ant-junit
		=dev-java/junit-3.8*
	)"

RDEPEND=">=virtual/jre-1.4
	${COMMON_DEP}"

S=${WORKDIR}/${MY_P}

src_unpack() {
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}/${P}-build.xml.patch"
	java-ant_rewrite-classpath
	cd "${S}/lib"

	rm -v *.jar
}

EANT_BUILD_TARGET="jar"
EANT_JAVADOC_TARGET="javadoc"
EANT_ANT_TASKS="rundoc snip"
EANT_GENTOO_CLASSPATH="ant-core xstream"

src_test() {
	ANT_TASKS="ant-junit rundoc snip" eant test
}

src_install() {
	java-pkg_newjar dist/${MY_P}.jar

	if use doc; then
		dohtml doc/*.html
		java-pkg_dojavadoc doc/javadoc
		dosym /usr/share/doc/${PF}/html/api /usr/share/doc/${PF}/html/javadoc
	fi

	use source && java-pkg_dosrc src/java/com
}