diff options
author | André Draszik <andre.draszik@jci.com> | 2018-07-27 14:16:16 +0100 |
---|---|---|
committer | Richard Leitner <richard.leitner@skidata.com> | 2018-08-02 11:09:10 +0200 |
commit | 09a28b67f1b904b4daaad1ad8b33069eefca0880 (patch) | |
tree | a9670b610ea90493c46e10a2fb2f76c99dd597ed /recipes-core/ca-certificates-java/ca-certificates-java_20180516.bb | |
parent | c3dc179b0a3c8ce43ae6b7086b04d76815021451 (diff) | |
download | meta-java-09a28b67f1b904b4daaad1ad8b33069eefca0880.tar.gz |
ca-certificates-java: update to v20180516
This is the latest available version and contains
some fixes for Java 10 & Java 11
Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
Diffstat (limited to 'recipes-core/ca-certificates-java/ca-certificates-java_20180516.bb')
-rw-r--r-- | recipes-core/ca-certificates-java/ca-certificates-java_20180516.bb | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/recipes-core/ca-certificates-java/ca-certificates-java_20180516.bb b/recipes-core/ca-certificates-java/ca-certificates-java_20180516.bb new file mode 100644 index 0000000..2db1915 --- /dev/null +++ b/recipes-core/ca-certificates-java/ca-certificates-java_20180516.bb | |||
@@ -0,0 +1,107 @@ | |||
1 | SUMMARY = "Common CA certificates (JKS trustStore)" | ||
2 | DESCRIPTION = "This package uses the hooks of the ca-certificates \ | ||
3 | package to update the cacerts JKS trustStore used for many java runtimes." | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "\ | ||
6 | file://debian/copyright;md5=ab0f6b6900f6564dc3e273dfa36fcc72 \ | ||
7 | file://src/main/java/org/debian/security/InvalidKeystorePasswordException.java;endline=17;md5=f9150bf1ca3139a38ddb54f9e1c0eb9b \ | ||
8 | file://src/main/java/org/debian/security/KeyStoreHandler.java;endline=18;md5=3fd0e26abbca2ec481cf3698431574ae \ | ||
9 | file://src/main/java/org/debian/security/UnableToSaveKeystoreException.java;endline=17;md5=f9150bf1ca3139a38ddb54f9e1c0eb9b \ | ||
10 | file://src/main/java/org/debian/security/UnknownInputException.java;endline=17;md5=f9150bf1ca3139a38ddb54f9e1c0eb9b \ | ||
11 | file://src/main/java/org/debian/security/UpdateCertificates.java;endline=18;md5=3fd0e26abbca2ec481cf3698431574ae \ | ||
12 | " | ||
13 | DEPENDS = "virtual/javac-native fastjar-native" | ||
14 | # We can't use virtual/javac-native, because that would create a | ||
15 | # keystore that can't be read on the target (as virtual/javac-native | ||
16 | # usually is either too old, or plain incompatible with this) | ||
17 | PACKAGE_WRITE_DEPS += "openjdk-8-native" | ||
18 | |||
19 | SRC_URI = "\ | ||
20 | git://salsa.debian.org/java-team/ca-certificates-java.git \ | ||
21 | file://0001-UpdateCertificates-handle-SYSROOT-environment-variab.patch \ | ||
22 | file://${BPN}.hook.in \ | ||
23 | " | ||
24 | |||
25 | SRCREV = "793b846dcd4e79371bbe8069e4125ec2fd462e57" | ||
26 | |||
27 | inherit java allarch | ||
28 | |||
29 | S = "${WORKDIR}/git" | ||
30 | B = "${WORKDIR}/build" | ||
31 | |||
32 | JARFILENAME = "${BPN}.jar" | ||
33 | |||
34 | python () { | ||
35 | runtime = d.getVar("PREFERRED_RPROVIDER_java2-runtime") or "" | ||
36 | if not runtime in ("openjdk-8", "openjre-8"): | ||
37 | raise bb.parse.SkipRecipe("PREFERRED_RPROVIDER_java2-runtime '%s' unsupported" % runtime) | ||
38 | } | ||
39 | |||
40 | do_patch_append () { | ||
41 | bb.build.exec_func('do_fix_sysconfdir', d) | ||
42 | } | ||
43 | |||
44 | do_fix_sysconfdir () { | ||
45 | sed -e 's|/etc/ssl/certs/java|${sysconfdir}/ssl/certs/java|g' \ | ||
46 | -i ${S}/src/main/java/org/debian/security/UpdateCertificates.java | ||
47 | } | ||
48 | |||
49 | do_compile () { | ||
50 | mkdir -p build # simplify in-tree builds (externalsrc) | ||
51 | javac -g \ | ||
52 | -source 1.7 -target 1.7 -encoding ISO8859-1 \ | ||
53 | -d build \ | ||
54 | -sourcepath ${S}/src/main/java \ | ||
55 | $(find ${S}/src/main/java -name '*.java' -type f) | ||
56 | |||
57 | # needs to end with two empty lines | ||
58 | cat << EOF > ${B}/manifest | ||
59 | Manifest-Version: 1.0 | ||
60 | Main-Class: org.debian.security.UpdateCertificates | ||
61 | |||
62 | EOF | ||
63 | fastjar -cfm ${JARFILENAME} ${B}/manifest -C build . | ||
64 | } | ||
65 | |||
66 | do_install () { | ||
67 | oe_jarinstall ${JARFILENAME} | ||
68 | |||
69 | mkdir -p ${D}${sysconfdir}/ssl/certs/java | ||
70 | install -Dm0755 ${WORKDIR}/${BPN}.hook.in ${D}${sysconfdir}/ca-certificates/update.d/${BPN}-hook | ||
71 | sed -e 's|@@datadir_java@@|${datadir_java}|' \ | ||
72 | -e 's|@@libdir_jvm@@|${libdir_jvm}|' \ | ||
73 | -e 's|@@JARFILENAME@@|${JARFILENAME}|' \ | ||
74 | -i ${D}${sysconfdir}/ca-certificates/update.d/${BPN}-hook | ||
75 | |||
76 | install -d -m0755 ${D}${sbindir} | ||
77 | ln -s ${@os.path.relpath("${sysconfdir}/ca-certificates/update.d/${BPN}-hook", "${sbindir}")} \ | ||
78 | ${D}${sbindir}/create-ca-certificates-java | ||
79 | } | ||
80 | |||
81 | pkg_postinst_${PN} () { | ||
82 | if [ -n "$D" ] ; then | ||
83 | # In this case we want to use the Java in the image recipe's | ||
84 | # native sysroot (native Java, not qemu target Java) to | ||
85 | # generate the trustStore. | ||
86 | # None of the supported Java versions are in PATH, though, so | ||
87 | # we have to find a satisfactory one ourselves below $libdir_jvm. | ||
88 | # We really need the $NATIVE_ROOT variable for that to work, | ||
89 | # as STAGING_LIBDIR_JVM_NATIVE resolves to this recipe's native | ||
90 | # sysroot during recipe build time, so it's of no use during | ||
91 | # image build time. | ||
92 | if [ -z $NATIVE_ROOT ] ; then | ||
93 | echo "$0: NATIVE_ROOT not known" | ||
94 | false | ||
95 | fi | ||
96 | JVM_LIBDIR=$NATIVE_ROOT${libdir_jvm} | ||
97 | fi | ||
98 | JVM_LIBDIR=$JVM_LIBDIR $D${sbindir}/create-ca-certificates-java | ||
99 | } | ||
100 | |||
101 | RDEPENDS_${PN} = "ca-certificates" | ||
102 | RDEPENDS_${PN}_append_class-target = " java2-runtime" | ||
103 | RDEPENDS_${PN}_append_class-native = " virtual/java-native" | ||
104 | |||
105 | FILES_${PN} += "${datadir_java}" | ||
106 | |||
107 | BBCLASSEXTEND = "native" | ||