1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 JAVA_PKG_IUSE="doc source"
8 inherit multilib toolchain-funcs java-pkg-2
10 DESCRIPTION="Network Security Services for Java (JSS)"
11 HOMEPAGE="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/JSS"
12 # 4.3.2 was released but was seemingly never announced. The binary jar
13 # exists on Mozilla's servers but Chewi could only find a source tarball
14 # at https://obs.kolabsys.com/package/show/Kolab:3.4/jss. However, you
15 # need to register in order to download it, hence he has mirrored it.
16 SRC_URI="https://dev.gentoo.org/~chewi/distfiles/${P}.tar.bz2"
22 CDEPEND=">=dev-libs/nspr-4.7.1
23 >=dev-libs/nss-3.12.5"
29 test? ( dev-libs/nss[utils] )"
34 S="${WORKDIR}/${P}/mozilla"
37 epatch "${FILESDIR}"/${PN}-3.4-target_source.patch
38 epatch "${FILESDIR}"/${PN}-4.2.5-use_pkg-config.patch
39 epatch "${FILESDIR}"/${PN}-4.3-cflags.patch
40 epatch "${FILESDIR}"/${PN}-4.3.2-ldflags.patch
41 epatch "${FILESDIR}"/${PN}-4.3-secitem.patch
43 if java-pkg_is-vm-version-ge 1.8; then
44 epatch "${FILESDIR}"/${PN}-4.3-javadoc.patch
51 "AR=$(tc-getAR) cr \$@"
56 export JAVA_GENTOO_OPTS="$(java-pkg_javac-args)"
57 use amd64 && export USE_64=1
59 cd "${S}/security/coreconf" || die
60 emake -j1 "${ARGS[@]}"
62 cd "${S}/security/jss" || die
63 emake -j1 "${ARGS[@]}" USE_PKGCONFIG=1 NSS_PKGCONFIG=nss NSPR_PKGCONFIG=nspr
64 use doc && emake -j1 "${ARGS[@]}" javadoc
67 # Chewi has managed to reach a test pass rate of 31/40 (78%) but the
68 # remainder fail due to JSS not having kept pace with the ciphersuites
69 # in NSS. There's not much we can do about that. The suite also leaves
70 # java processes running and exits successfully on failure.
74 # Parts of NSS are required for the tests.
75 ln -snf "${EROOT}usr/$(get_libdir)/libnssckbi.so" dist/Linux*.OBJ/lib/ || die
76 ln -snf "${EROOT}usr/bin" dist/Linux*.OBJ/ || die
78 # The tests must be run from this directory.
79 cd security/jss/org/mozilla/jss/tests || die
80 BUILD_OPT=1 perl all.pl dist "${S}"/dist/Linux*.OBJ/ || die "tests failed"
84 java-pkg_dojar dist/*.jar
86 # Use this instead of the one in dist because it is a symlink
87 # and doso handles symlinks by just symlinking to the original
88 java-pkg_doso ./security/${PN}/lib/*/*.so
90 use doc && java-pkg_dojavadoc dist/jssdoc
91 use source && java-pkg_dosrc ./security/jss/org
92 use examples && java-pkg_doexamples ./security/jss/samples