summaryrefslogtreecommitdiff
blob: db2a8a7959c9cf50bdbc136343b0c787bde27b6c (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
71
72
73
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5
JAVA_PKG_IUSE="doc source"

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

MY_PN="JSAP"
MY_P=${MY_PN}-${PV}

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

LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64 ~ppc64 ~x86"
IUSE="test"

CDEPEND="
	dev-java/xstream:0
	dev-java/ant-core:0"

DEPEND="
	${CDEPEND}
	>=virtual/jdk-1.6
	test? (
		dev-java/ant-junit:0
	)"

RDEPEND="
	${CDEPEND}
	>=virtual/jre-1.6"

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

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

JAVA_ANT_REWRITE_CLASSPATH="yes"

PATCHES=(
	"${FILESDIR}/${P}-build.xml.patch"
)

java_prepare() {
	java-pkg_clean
	epatch "${PATCHES[@]}"
}

src_test() {
	java-pkg-2_src_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
}