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

EAPI=5

JAVA_PKG_IUSE="doc source test"

inherit java-pkg-2 java-ant-2

DESCRIPTION="GNU Crypto cryptographic primitives for Java"
HOMEPAGE="https://www.gnu.org/software/gnu-crypto/"
SRC_URI="ftp://ftp.gnupg.org/GnuPG/${PN}/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ppc64 x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
IUSE=""

DEPEND=">=virtual/jdk-1.6"
RDEPEND=">=virtual/jre-1.6"

EANT_BUILD_XML="${S}/build.xml"
EANT_BUILD_TARGET="jar"

EANT_DOC_TARGET="javadoc"

java_prepare() {
	epatch "${FILESDIR}/${P}-jdk15.patch"
}

src_compile() {
	java-pkg-2_src_compile
}

src_test() {
	local TEST_TARGETS=(
		check
		ent
	)

	for target in ${TEST_TARGETS[@]}; do
		EANT_TEST_TARGET=${target} \
			java-pkg-2_src_test
	done
}

src_install() {
	local GNU_CRYPTO_JARS=(
		"${PN}"
		javax-crypto
		javax-security
	)

	if use test; then
		GNU_CRYPTO_JARS=(${GNU_CRYPTO_JARS[@]} "${PN}-test")
	fi

	for jar in ${GNU_CRYPTO_JARS[@]}; do
		java-pkg_dojar "lib/${jar}.jar"
	done

	use doc && java-pkg_dojavadoc docs/api
	use source && java-pkg_dosrc source/* jce/* security/*

	dodoc AUTHORS ChangeLog NEWS README THANKS
}