bcpg-1.52-r1.ebuild 1.5 KB

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