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.6
39 RDEPEND=">=virtual/jre-1.6
42 S="${WORKDIR}/${MY_P}"
54 java-pkg_jar-from --build-only junit
57 java-pkg_jar-from bcprov
61 find org -name "*.java" > "${T}"/src.list
67 sed -i '/\/test\//d' "${T}"/src.list || die "Failed to remove test classes"
70 ejavac -d "${S}"/classes -cp ${cp} "@${T}"/src.list
72 cd "${S}"/classes || die
74 jar -cf "${S}"/${PN}.jar * || die "Failed to create jar."
78 local cp="${PN}.jar:bcprov.jar:junit.jar"
79 local pkg="org.bouncycastle"
81 java -cp ${cp} ${pkg}.tsp.test.AllTests | tee tsp.tests
82 java -cp ${cp} ${pkg}.pkcs.test.AllTests | tee pkcs.tests
83 java -cp ${cp} ${pkg}.openssl.test.AllTests | tee openssl.tests
84 java -cp ${cp} ${pkg}.mozilla.test.AllTests | tee mozilla.tests
85 java -cp ${cp} ${pkg}.eac.test.AllTests | tee eac.tests
86 java -cp ${cp} ${pkg}.dvcs.test.AllTests | tee dvcs.tests
87 java -cp ${cp} ${pkg}.cms.test.AllTests | tee cms.tests
88 java -cp ${cp} ${pkg}.cert.test.AllTests | tee cert.tests
89 java -cp ${cp} ${pkg}.cert.ocsp.test.AllTests | tee cert.ocsp.tests
90 java -cp ${cp} ${pkg}.cert.crmf.test.AllTests | tee cert.crmf.tests
91 java -cp ${cp} ${pkg}.cert.cmp.test.AllTests | tee cert.cmp.tests
93 grep -q FAILURES *.tests && die "Tests failed."
97 java-pkg_dojar "${S}"/${PN}.jar
99 use source && java-pkg_dosrc org
100 use doc && java-pkg_dojavadoc docs