dev-java/openjfx: bump to 11.0.7_p1
[gentoo.git] / dev-java / bcpg / bcpg-1.50-r1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
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://www.bouncycastle.org/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 since bcprov is not slotted, this can cause conflicts.
21 # Needs further investigation; though, only a small part has tests and there are no tests for bcpg itself.
22 RESTRICT="test"
23
24 CDEPEND="dev-java/bcprov:${SLOT}"
25
26 DEPEND=">=virtual/jdk-1.6
27         app-arch/unzip
28         test? (
29                 dev-java/ant-junit:0
30         )
31         ${CDEPEND}"
32
33 RDEPEND=">=virtual/jre-1.6
34         ${CDEPEND}"
35
36 S="${WORKDIR}/${MY_P}"
37
38 JAVA_GENTOO_CLASSPATH="bcprov-${SLOT}"
39
40 src_unpack() {
41         default
42         cd "${S}"
43         unpack ./src.zip
44 }
45
46 java_prepare() {
47         if ! use test; then
48                 local RM_TEST_FILES=(
49                         org/bouncycastle/openpgp/test
50                         org/bouncycastle/openpgp/examples/test
51                 )
52                 rm -rf "${RM_TEST_FILES[@]}" || die
53         fi
54 }
55
56 src_compile() {
57         java-pkg-simple_src_compile
58 }
59
60 src_test() {
61         local cp="${PN}.jar:bcprov.jar:junit.jar"
62         local pkg="org.bouncycastle"
63         java -cp ${cp} ${pkg}.openpgp.test.AllTests | tee openpgp.tests
64         grep -q FAILURES *.tests && die "Tests failed."
65 }
66
67 src_install() {
68         java-pkg-simple_src_install
69         use source && java-pkg_dosrc org
70 }