dev-java/openjfx: bump to 11.0.7_p1
[gentoo.git] / dev-java / bcpg / bcpg-1.50-r2.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 JAVA_PKG_IUSE="doc source test"
7
8 inherit java-pkg-2 java-pkg-simple
9
10 MY_P="${PN}-jdk15on-${PV/./}"
11
12 DESCRIPTION="Java cryptography APIs"
13 HOMEPAGE="http://www.bouncycastle.org/java.html"
14 SRC_URI="http://polydistortion.net/bc/download/${MY_P}.tar.gz"
15
16 LICENSE="BSD"
17 SLOT="1.50"
18 KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-macos"
19
20 # Tests are currently broken. Appears to need older version of bcprov; but
21 # since bcprov is not slotted, this can cause conflicts.  Needs further
22 # investigation; though, only a small part has tests and there are no tests for
23 # bcpg itself.
24 RESTRICT="test"
25
26 CDEPEND="dev-java/bcprov:${SLOT}"
27
28 DEPEND="
29         ${CDEPEND}
30         >=virtual/jdk-1.6
31         test? ( dev-java/ant-junit:0 )"
32
33 RDEPEND="
34         ${CDEPEND}
35         >=virtual/jre-1.6"
36
37 S="${WORKDIR}/${MY_P}"
38
39 JAVA_GENTOO_CLASSPATH="bcprov-${SLOT}"
40
41 src_unpack() {
42         default
43         cd "${S}" || die
44         unpack ./src.zip
45 }
46
47 src_prepare() {
48         default
49         if ! use test; then
50                 local RM_TEST_FILES=(
51                         org/bouncycastle/openpgp/test
52                         org/bouncycastle/openpgp/examples/test
53                 )
54                 rm -rv "${RM_TEST_FILES[@]}" || die
55         fi
56 }
57
58 src_compile() {
59         java-pkg-simple_src_compile
60 }
61
62 src_test() {
63         local cp="${PN}.jar:bcprov.jar:junit.jar"
64         local pkg="org.bouncycastle"
65         java -cp ${cp} ${pkg}.openpgp.test.AllTests | tee openpgp.tests
66         grep -q FAILURES *.tests && die "Tests failed."
67 }
68
69 src_install() {
70         einstalldocs
71         java-pkg-simple_src_install
72         use source && java-pkg_dosrc org
73 }