1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 JAVA_PKG_IUSE="doc source test"
9 inherit java-pkg-2 java-ant-2
11 MY_P="${PN}-jdk15on-${PV/./}"
13 DESCRIPTION="Java cryptography APIs"
14 HOMEPAGE="http://www.bouncycastle.org/java.html"
15 SRC_URI="http://www.bouncycastle.org/download/${MY_P}.tar.gz"
19 KEYWORDS="amd64 ppc ppc64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos"
21 # Tests are currently broken. Needs further investigation.
23 # - java.lang.RuntimeException: java.security.NoSuchProviderException:
24 # JCE cannot authenticate the provider BC
26 # - error: package org.bouncycastle.util.test does not exist
30 >=dev-java/bcprov-${PV}:0[test?]"
32 DEPEND=">=virtual/jdk-1.5
34 test? ( dev-java/junit:0 )
37 RDEPEND=">=virtual/jre-1.5
40 S="${WORKDIR}/${MY_P}"
52 java-pkg_jar-from --build-only junit
55 java-pkg_jar-from bcprov
59 find org -name "*.java" > "${T}"/src.list
65 sed -i '/\/test\//d' "${T}"/src.list || die "Failed to remove test classes"
68 ejavac -d "${S}"/classes -cp ${cp} "@${T}"/src.list
70 cd "${S}"/classes || die
72 jar -cf "${S}"/${PN}.jar * || die "Failed to create jar."
76 local cp="${PN}.jar:bcprov.jar:junit.jar"
77 local pkg="org.bouncycastle"
79 java -cp ${cp} ${pkg}.tsp.test.AllTests | tee tsp.tests
80 java -cp ${cp} ${pkg}.pkcs.test.AllTests | tee pkcs.tests
81 java -cp ${cp} ${pkg}.openssl.test.AllTests | tee openssl.tests
82 java -cp ${cp} ${pkg}.mozilla.test.AllTests | tee mozilla.tests
83 java -cp ${cp} ${pkg}.eac.test.AllTests | tee eac.tests
84 java -cp ${cp} ${pkg}.dvcs.test.AllTests | tee dvcs.tests
85 java -cp ${cp} ${pkg}.cms.test.AllTests | tee cms.tests
86 java -cp ${cp} ${pkg}.cert.test.AllTests | tee cert.tests
87 java -cp ${cp} ${pkg}.cert.ocsp.test.AllTests | tee cert.ocsp.tests
88 java -cp ${cp} ${pkg}.cert.crmf.test.AllTests | tee cert.crmf.tests
89 java -cp ${cp} ${pkg}.cert.cmp.test.AllTests | tee cert.cmp.tests
91 grep -q FAILURES *.tests && die "Tests failed."
95 java-pkg_dojar "${S}"/${PN}.jar
97 use source && java-pkg_dosrc org
98 use doc && java-pkg_dojavadoc docs