diff options
author | Henning Heinold <heinold@inf.fu-berlin.de> | 2012-11-22 18:44:06 +0100 |
---|---|---|
committer | Henning Heinold <heinold@inf.fu-berlin.de> | 2012-11-22 18:44:06 +0100 |
commit | e6e59540e4540dfca17c5904aad6fdc23cf6934e (patch) | |
tree | c72bc47a8726d3f7ef782402eb1fe2d0beade43b /recipes-core/openjdk/openjdk-7-common.inc | |
parent | 8ef1ab1273b331d0d39bcfc24a1fe80d77a588c7 (diff) | |
download | meta-java-e6e59540e4540dfca17c5904aad6fdc23cf6934e.tar.gz |
openjdk7: copy over the openjdk7 from openjdk7-branch
The branches differed to much and I wanted to
keep openjdk-6.
We will loose some history, but
I think that is not a great problem
Thanks to khem for working on the recipes too.
Diffstat (limited to 'recipes-core/openjdk/openjdk-7-common.inc')
-rw-r--r-- | recipes-core/openjdk/openjdk-7-common.inc | 496 |
1 files changed, 496 insertions, 0 deletions
diff --git a/recipes-core/openjdk/openjdk-7-common.inc b/recipes-core/openjdk/openjdk-7-common.inc new file mode 100644 index 0000000..eb0a817 --- /dev/null +++ b/recipes-core/openjdk/openjdk-7-common.inc | |||
@@ -0,0 +1,496 @@ | |||
1 | DESCRIPTION = "Java runtime based upon the OpenJDK- and Icedtea Project" | ||
2 | HOMEPAGE = "http://icedtea.classpath.org" | ||
3 | LICENSE = "GPL-2.0-with-classpath-exception" | ||
4 | PRIORITY = "optional" | ||
5 | SECTION = "libs" | ||
6 | |||
7 | # Name of the icedtea tarball and top-level directory. | ||
8 | ICEDTEA = "NEEDS TO BE SET" | ||
9 | |||
10 | S = "${WORKDIR}/${ICEDTEA}" | ||
11 | B = "${S}/build" | ||
12 | |||
13 | INC_PR = "r2" | ||
14 | |||
15 | SRC_URI = " \ | ||
16 | ${ICEDTEA_URI} \ | ||
17 | ${OPENJDK_URI} \ | ||
18 | ${HOTSPOT_URI} \ | ||
19 | ${CORBA_URI} \ | ||
20 | ${JAXP_URI} \ | ||
21 | ${JAXWS_URI} \ | ||
22 | ${JDK_URI} \ | ||
23 | ${LANGTOOLS_URI} \ | ||
24 | ${CACAO_URI} \ | ||
25 | ${JAMVM_URI} \ | ||
26 | ${OEPATCHES} \ | ||
27 | ${ICEDTEAPATCHES} \ | ||
28 | file://jvm.cfg \ | ||
29 | " | ||
30 | |||
31 | JDKPN = "openjdk-7" | ||
32 | JDK_DIR = "java-7-openjdk" | ||
33 | |||
34 | PN = "${JDKPN}-jre" | ||
35 | PROVIDES += "${JDKPN}" | ||
36 | |||
37 | DEPENDS = " \ | ||
38 | icedtea7-native zip-native ant-native \ | ||
39 | zlib \ | ||
40 | jpeg libpng giflib \ | ||
41 | gtk+ glib-2.0 \ | ||
42 | cups fontconfig \ | ||
43 | rhino \ | ||
44 | libxt libxp libxinerama libxrender libxtst libxi \ | ||
45 | freetype alsa-lib libffi llvm2.8 \ | ||
46 | " | ||
47 | DEPENDS_arm = " \ | ||
48 | icedtea7-native zip-native ant-native \ | ||
49 | zlib \ | ||
50 | jpeg libpng giflib \ | ||
51 | gtk+ glib-2.0 \ | ||
52 | cups fontconfig \ | ||
53 | rhino \ | ||
54 | libxt libxp libxinerama libxrender libxtst libxi \ | ||
55 | freetype alsa-lib libffi \ | ||
56 | " | ||
57 | |||
58 | DEPENDS_append_libc-uclibc = " virtual/libiconv " | ||
59 | |||
60 | # The OpenJDK build with interpreter optimizations for ARM depends on a binary | ||
61 | # that generates constants for an assembler source file. There is no other | ||
62 | # way than to generate this on a pseudo machine. Cross-compiling would not help | ||
63 | # because structure sizes and/or alignment may differ. | ||
64 | DEPENDS_append = " qemu-native " | ||
65 | |||
66 | |||
67 | # No package should directly depend on this (it should require | ||
68 | # java2-runtime instead). | ||
69 | PRIVATE_LIBS = "\ | ||
70 | libunpack.so libverify.so libjava.so libzip.so libnpt.so \ | ||
71 | libjava_crw_demo.so libhprof.so libnet.so libnio.so \ | ||
72 | libmanagement.so libinstrument.so libjsound.so libjsoundalsa.so \ | ||
73 | libj2pcsc.so libj2pkcs11.so libj2gss.so libmlib_image.so \ | ||
74 | libawt.so libsplashscreen.so libfreetype.so.6 libfontmanager.so \ | ||
75 | libjpeg.so liblcms.so librmi.so libjawt.so libjaas_unix.so \ | ||
76 | libattach.so libjdwp.so libdt_socket.so libhpi.so libjli.so \ | ||
77 | libmawt.so libjvm.so \ | ||
78 | libversionCheck.so libcompiledMethodLoad.so libgctest.so \ | ||
79 | libheapViewer.so libheapTracker.so libminst.so libmtrace.so \ | ||
80 | libwaiters.so libhprof.so \ | ||
81 | " | ||
82 | inherit java autotools gettext qemu | ||
83 | |||
84 | export ALT_CUPS_HEADERS_PATH = "${STAGING_INCDIR}" | ||
85 | export ALT_FREETYPE_HEADERS_PATH = "${STAGING_INCDIR}/freetype2" | ||
86 | export ALT_FREETYPE_LIB_PATH = "${STAGING_LIBDIR}" | ||
87 | export CACAO_CONFIGURE_ARGS = " \ | ||
88 | ${@['','--enable-softfloat'][bb.data.getVar('TARGET_FPU',d,1) == 'soft']}" | ||
89 | |||
90 | JAVA_HOME[unexport] = "1" | ||
91 | |||
92 | WITH_ADDITIONAL_VMS ?= "--with-additional-vms=shark,cacao,jamvm" | ||
93 | |||
94 | WITH_ADDITIONAL_VMS_arm = "--with-additional-vms=cacao,jamvm" | ||
95 | |||
96 | # OpenJDK supports parallel compilation but uses a plain number for this. | ||
97 | # In OE we have PARALLEL_MAKE which is the actual option passed to make, | ||
98 | # e.g. "-j 4". | ||
99 | |||
100 | OPENJDK_PARALLEL_MAKE := "${PARALLEL_MAKE}" | ||
101 | PARALLEL_MAKE = "" | ||
102 | |||
103 | def get_jdk7_jobs(d): | ||
104 | import bb | ||
105 | |||
106 | pm = bb.data.getVar('OPENJDK_PARALLEL_MAKE', d, 1); | ||
107 | if not pm: | ||
108 | return "1" | ||
109 | |||
110 | pm = pm.split("j"); | ||
111 | if (len(pm) == 2): | ||
112 | return pm[1].strip() | ||
113 | |||
114 | # Whatever found in PARALLEL_MAKE was not suitable. | ||
115 | return "1" | ||
116 | |||
117 | JDK_JOBS = "${@get_jdk7_jobs(d)}" | ||
118 | |||
119 | EXTRA_OECONF = " \ | ||
120 | --disable-tests \ | ||
121 | --disable-hotspot-tests \ | ||
122 | --disable-langtools-tests \ | ||
123 | --disable-jdk-tests \ | ||
124 | --disable-pulse-java \ | ||
125 | --disable-docs \ | ||
126 | --disable-nss \ | ||
127 | --disable-system-lcms \ | ||
128 | --disable-bootstrap \ | ||
129 | \ | ||
130 | --enable-zero \ | ||
131 | \ | ||
132 | --with-jdk-home=${STAGING_LIBDIR_JVM_NATIVE}/icedtea7-native \ | ||
133 | --with-rhino=${STAGING_DATADIR_JAVA}/rhino.jar \ | ||
134 | \ | ||
135 | --with-openjdk-src-zip=${WORKDIR}/${OPENJDK_FILE} \ | ||
136 | --with-hotspot-src-zip=${WORKDIR}/${HOTSPOT_FILE} \ | ||
137 | --with-corba-src-zip=${WORKDIR}/${CORBA_FILE} \ | ||
138 | --with-jaxp-src-zip=${WORKDIR}/${JAXP_FILE} \ | ||
139 | --with-jaxws-src-zip=${WORKDIR}/${JAXWS_FILE} \ | ||
140 | --with-jdk-src-zip=${WORKDIR}/${JDK_FILE} \ | ||
141 | --with-langtools-src-zip=${WORKDIR}/${LANGTOOLS_FILE} \ | ||
142 | --with-cacao-src-zip=${WORKDIR}/${CACAO_FILE} \ | ||
143 | --with-jamvm-src-zip=${WORKDIR}/${JAMVM_FILE} \ | ||
144 | \ | ||
145 | --with-parallel-jobs=${JDK_JOBS} \ | ||
146 | \ | ||
147 | --with-pkgversion=${PV} \ | ||
148 | --with-cc-for-build=${BUILD_CC} \ | ||
149 | " | ||
150 | |||
151 | # OpenJDK uses slightly different names for certain arches. We need to know | ||
152 | # this to create some files which are expected by the build. | ||
153 | def get_jdk_arch(d): | ||
154 | import bb | ||
155 | |||
156 | jdk_arch = bb.data.getVar('TRANSLATED_TARGET_ARCH', d, 1) | ||
157 | if jdk_arch == "x86-64": | ||
158 | jdk_arch = "amd64" | ||
159 | elif jdk_arch == "powerpc": | ||
160 | jdk_arch = "ppc" | ||
161 | elif jdk_arch == "powerpc64": | ||
162 | jdk_arch = "ppc64" | ||
163 | elif (jdk_arch == "i486" or jdk_arch == "i586" or jdk_arch == "i686"): | ||
164 | jdk_arch = "i386" | ||
165 | |||
166 | return jdk_arch | ||
167 | |||
168 | JDK_ARCH = "${@get_jdk_arch(d)}" | ||
169 | JDK_HOME = "${libdir_jvm}/${JDK_DIR}" | ||
170 | JDK_FAKE = "${WORKDIR}/fake-jdk" | ||
171 | |||
172 | # A function that is needed in the Shark builds. | ||
173 | def get_llvm_configure_arch(d): | ||
174 | import bb; | ||
175 | |||
176 | arch = bb.data.getVar('TRANSLATED_TARGET_ARCH', d, 1) | ||
177 | if arch == "x86-64" or arch == "i486" or arch == "i586" or arch == "i686": | ||
178 | arch = "x86" | ||
179 | elif arch == "arm": | ||
180 | arch = "arm" | ||
181 | elif arch == "mipsel" or arch == "mips": | ||
182 | arch = "mips" | ||
183 | elif arch == "powerpc" or arch == "powerpc64": | ||
184 | arch = "powerpc" | ||
185 | else: | ||
186 | bb.error("%s does not support %s yet" % (bb.data.getVar('PN', d, 1), arch) ); | ||
187 | |||
188 | return arch | ||
189 | |||
190 | do_configure_prepend() { | ||
191 | echo "Configure with parallel-jobs: ${JDK_JOBS}" | ||
192 | |||
193 | # Automatically copy everything that starts with "icedtea" (or "cacao") and ends with | ||
194 | # ".patch" into the patches directory. | ||
195 | find ${WORKDIR} -maxdepth 1 -name "icedtea*.patch" -exec cp {} ${S}/patches \; | ||
196 | find ${WORKDIR} -maxdepth 1 -name "cacao*.patch" -exec cp {} ${S}/patches \; | ||
197 | } | ||
198 | |||
199 | do_configure_append() { | ||
200 | oe_runmake patch | ||
201 | } | ||
202 | |||
203 | # Work around broken variable quoting in oe-stable 2009 and provide the variable | ||
204 | # via the environment which then overrides the erroneous value that was written | ||
205 | # into '${ICETDEA}/Makefile'. | ||
206 | # Icedtea's makefile is not compatible to parallelization so we cannot allow | ||
207 | # passing a valid ${PARALLEL_MAKE} to it. OTOH OpenJDK's makefiles are | ||
208 | # parallelizable and we need ${PARALLEL_MAKE} to derive the proper value. | ||
209 | # The base for this quirk is that GNU Make only considers the last "-j" option. | ||
210 | EXTRA_OEMAKE = 'CC="${CC}" CCC="${CXX}" CPP="${CPP}" CXX="${CXX}" CC_FOR_BUILD="${BUILD_CC}"' | ||
211 | |||
212 | EXTRA_OEMAKE += ' \ | ||
213 | OE_CFLAGS="${TARGET_CFLAGS}" \ | ||
214 | OE_CPPFLAGS="${TARGET_CPPFLAGS}" \ | ||
215 | OE_CXXFLAGS="${TARGET_CXXFLAGS}" \ | ||
216 | OE_LDFLAGS="${TARGET_LDFLAGS}" \ | ||
217 | ZIPEXE="${STAGING_BINDIR_NATIVE}/zip" \ | ||
218 | CROSS_COMPILE_ARCH="${JDK_ARCH}" \ | ||
219 | REQUIRED_ALSA_VERSION="" \ | ||
220 | ' | ||
221 | |||
222 | # Puts an OE specific string into the binary making it possible for the user | ||
223 | # to know where it comes from (and blame the right people ...). | ||
224 | DIST_ID = "Built for ${DISTRO}" | ||
225 | DIST_NAME = "${DISTRO}" | ||
226 | EXTRA_OEMAKE += 'DIST_NAME="${DIST_NAME}" DIST_ID="${DIST_ID}"' | ||
227 | |||
228 | |||
229 | # llvm configure and compiles stuff | ||
230 | |||
231 | export WANT_LLVM_RELEASE = "2.8" | ||
232 | |||
233 | # Provides the target architecture to the configure script. | ||
234 | export LLVM_CONFIGURE_ARCH="${@get_llvm_configure_arch(d)}" | ||
235 | |||
236 | OE_LAUNCHER_LDFLAGS = "-Wl,-rpath-link,${STAGING_LIBDIR}/llvm${WANT_LLVM_RELEASE} -Wl,-rpath,${libdir}/llvm${WANT_LLVM_RELEASE}" | ||
237 | |||
238 | OE_LAUNCHER_LDFLAGS_arm = "" | ||
239 | |||
240 | EXTRA_OEMAKE += 'OE_LAUNCHER_LDFLAGS="${OE_LAUNCHER_LDFLAGS}"' | ||
241 | |||
242 | # Large stack is required at least on x86_64 host, otherwise random segfaults appear: | ||
243 | QEMU = "${@qemu_target_binary(d)} ${QEMU_OPTIONS} -s 2097152 -L ${STAGING_DIR_TARGET} -E LD_LIBRARY_PATH=${STAGING_BASELIBDIR}" | ||
244 | |||
245 | EXTRA_OEMAKE += 'QEMU="${QEMU}"' | ||
246 | |||
247 | do_compile() { | ||
248 | |||
249 | bbnote "3/3 Building final JDK" | ||
250 | |||
251 | # Build the final Hotspot + OpenJDK | ||
252 | oe_runmake icedtea | ||
253 | } | ||
254 | |||
255 | do_install() { | ||
256 | install -d ${D}${libdir_jvm} | ||
257 | cp -R ${S}/build/${BUILD_DIR}/j2sdk-image ${D}${JDK_HOME} | ||
258 | |||
259 | chmod u+rw -R ${D}${JDK_HOME} | ||
260 | |||
261 | # Fix symlink which would point into staging in the binary package. | ||
262 | ln -sf ${datadir_java}/rhino.jar ${D}${JDK_HOME}/jre/lib/rhino.jar | ||
263 | |||
264 | # JRE is a subset of JDK. So to save space and resemble what the BIG distros | ||
265 | # do we create symlinks from the JDK binaries to their counterparts in the | ||
266 | # JRE folder (which have to exist by that time b/c of dependencies). | ||
267 | for F in `find ${D}${JDK_HOME}/jre/bin -type f` | ||
268 | do | ||
269 | bf=`basename $F` | ||
270 | bbnote "replace:" $bf | ||
271 | rm ${D}${JDK_HOME}/bin/$bf | ||
272 | ln -s ${JDK_HOME}/jre/bin/$bf ${D}${JDK_HOME}/bin/$bf | ||
273 | done | ||
274 | |||
275 | install -m644 ${WORKDIR}/jvm.cfg ${D}${JDK_HOME}/jre/lib/${JDK_ARCH}/ | ||
276 | } | ||
277 | |||
278 | # Notes about the ideas behind packaging: | ||
279 | # 1) User should install openjdk-7-jre. This is a provider of 'java2-runtime'. | ||
280 | # 2) This lets package mgmt install: openjdk-7-java | ||
281 | # -> openjdk-7-vm-shark|openjdk-7-vm-zero|openjdk-7-vm-cacao -> openjdk-7-common | ||
282 | # | ||
283 | # With opkg the zero VM is chosen which is good b/c that is the best known (= compatible) | ||
284 | # runtime. Installing other runtimes side-by-side is possible. Through jvm.cfg the following | ||
285 | # order of precedence is enforced: zero, shark, cacao. User can chose a different runtime | ||
286 | # by adding '-shark' or '-cacao' to the Java command (or by deinstalling an otherwise preferred | ||
287 | # runtime) | ||
288 | # 3) All other packages, including -jdk, are optional and not needed for normal Java apps. | ||
289 | PACKAGES = " \ | ||
290 | ${JDKPN}-jre \ | ||
291 | ${JDKPN}-jre-dbg \ | ||
292 | ${JDKPN}-dbg \ | ||
293 | ${JDKPN}-demo-dbg \ | ||
294 | ${JDKPN}-demo \ | ||
295 | ${JDKPN}-source \ | ||
296 | ${JDKPN}-doc \ | ||
297 | ${JDKPN}-jdk \ | ||
298 | ${JDKPN}-java \ | ||
299 | ${JDKPN}-vm-shark \ | ||
300 | ${JDKPN}-vm-zero \ | ||
301 | ${JDKPN}-vm-cacao \ | ||
302 | ${JDKPN}-vm-jamvm \ | ||
303 | ${JDKPN}-common \ | ||
304 | " | ||
305 | |||
306 | FILES_${JDKPN}-dbg = "\ | ||
307 | ${JDK_HOME}/bin/.debug \ | ||
308 | ${JDK_HOME}/lib/.debug \ | ||
309 | ${JDK_HOME}/jre/bin/.debug \ | ||
310 | ${JDK_HOME}/jre/lib/.debug \ | ||
311 | ${JDK_HOME}/jre/lib/${JDK_ARCH}/.debug \ | ||
312 | ${JDK_HOME}/jre/lib/${JDK_ARCH}/jli/.debug \ | ||
313 | ${JDK_HOME}/jre/lib/${JDK_ARCH}/native_threads/.debug \ | ||
314 | ${JDK_HOME}/jre/lib/${JDK_ARCH}/server/.debug \ | ||
315 | ${JDK_HOME}/jre/lib/${JDK_ARCH}/shark/.debug \ | ||
316 | ${JDK_HOME}/jre/lib/${JDK_ARCH}/headless/.debug \ | ||
317 | ${JDK_HOME}/jre/lib/${JDK_ARCH}/xawt/.debug \ | ||
318 | " | ||
319 | |||
320 | FILES_${JDKPN}-demo = "${JDK_HOME}/demo ${JDK_HOME}/sample" | ||
321 | RDEPENDS_${JDKPN}-demo = "java2-runtime" | ||
322 | FILES_${JDKPN}-demo-dbg = "\ | ||
323 | ${JDK_HOME}/demo/jvmti/gctest/lib/.debug \ | ||
324 | ${JDK_HOME}/demo/jvmti/heapTracker/lib/.debug \ | ||
325 | ${JDK_HOME}/demo/jvmti/heapViewer/lib/.debug \ | ||
326 | ${JDK_HOME}/demo/jvmti/hprof/lib/.debug \ | ||
327 | ${JDK_HOME}/demo/jvmti/minst/lib/.debug \ | ||
328 | ${JDK_HOME}/demo/jvmti/mtrace/lib/.debug \ | ||
329 | ${JDK_HOME}/demo/jvmti/versionCheck/lib/.debug \ | ||
330 | ${JDK_HOME}/demo/jvmti/waiters/lib/.debug \ | ||
331 | ${JDK_HOME}/demo/jvmti/compiledMethodLoad/lib/.debug \ | ||
332 | " | ||
333 | |||
334 | FILES_${JDKPN}-source = "${JDK_HOME}/src.zip" | ||
335 | |||
336 | FILES_${JDKPN}-java = "${JDK_HOME}/jre/bin/java" | ||
337 | |||
338 | FILES_${JDKPN}-vm-zero = "${JDK_HOME}/jre/lib/${JDK_ARCH}/server/" | ||
339 | |||
340 | FILES_${JDKPN}-vm-shark = "${JDK_HOME}/jre/lib/${JDK_ARCH}/shark/" | ||
341 | |||
342 | FILES_${JDKPN}-vm-cacao = "${JDK_HOME}/jre/lib/${JDK_ARCH}/cacao/" | ||
343 | |||
344 | FILES_${JDKPN}-vm-jamvm = "${JDK_HOME}/jre/lib/${JDK_ARCH}/jamvm/" | ||
345 | |||
346 | FILES_${JDKPN}-common = "${JDK_HOME}/jre/ASSEMBLY_EXCEPTION \ | ||
347 | ${JDK_HOME}/jre/THIRD_PARTY_README \ | ||
348 | ${JDK_HOME}/jre/LICENSE \ | ||
349 | ${JDK_HOME}/ASSEMBLY_EXCEPTION \ | ||
350 | ${JDK_HOME}/THIRD_PARTY_README \ | ||
351 | ${JDK_HOME}/LICENSE \ | ||
352 | ${JDK_HOME}/release \ | ||
353 | ${JDK_HOME}/jre/lib \ | ||
354 | " | ||
355 | |||
356 | FILES_openjdk-7-jre_append = " \ | ||
357 | ${JDK_HOME}/jre/bin/keytool \ | ||
358 | ${JDK_HOME}/jre/bin/orbd \ | ||
359 | ${JDK_HOME}/jre/bin/pack200 \ | ||
360 | ${JDK_HOME}/jre/bin/rmid \ | ||
361 | ${JDK_HOME}/jre/bin/rmiregistry \ | ||
362 | ${JDK_HOME}/jre/bin/servertool \ | ||
363 | ${JDK_HOME}/jre/bin/tnameserv \ | ||
364 | ${JDK_HOME}/jre/bin/unpack200 \ | ||
365 | ${JDK_HOME}/jre/bin/policytool \ | ||
366 | ${JDK_HOME}/jre/bin/javaws \ | ||
367 | " | ||
368 | |||
369 | RDEPENDS_${JDKPN}-common = "librhino-java" | ||
370 | |||
371 | RPROVIDES_${JDKPN}-vm-shark = "java2-vm" | ||
372 | RPROVIDES_${JDKPN}-vm-zero = "java2-vm" | ||
373 | RPROVIDES_${JDKPN}-vm-cacao = "java2-vm" | ||
374 | RPROVIDES_${JDKPN}-vm-jamvm = "java2-vm" | ||
375 | |||
376 | # Even though a vm is a hard dependency it is set as RRECOMMENDS so a single vm can get uninstalled: | ||
377 | # root@beaglebone:~/java# opkg remove openjdk-7-vm-shark | ||
378 | # No packages removed. | ||
379 | # Collected errors: | ||
380 | # * print_dependents_warning: Package openjdk-7-vm-shark is depended upon by packages: | ||
381 | # * print_dependents_warning: openjdk-7-java | ||
382 | # * print_dependents_warning: These might cease to work if package openjdk-7-vm-shark is removed. | ||
383 | RRECOMMENDS_${JDKPN}-java = "java2-vm" | ||
384 | |||
385 | # For some reason shark and cacao do not automatically depends on -common. | ||
386 | # So we add that manually. | ||
387 | RDEPENDS_${JDKPN}-vm-shark = "${JDKPN}-common" | ||
388 | RDEPENDS_${JDKPN}-vm-cacao = "${JDKPN}-common" | ||
389 | RDEPENDS_${JDKPN}-vm-jamvm = "${JDKPN}-common" | ||
390 | |||
391 | # There is a symlink to a .so but this one is valid. | ||
392 | INSANE_SKIP_${JDKPN}-vm-shark = "dev-so" | ||
393 | INSANE_SKIP_${JDKPN}-vm-zero = "dev-so" | ||
394 | INSANE_SKIP_${JDKPN}-vm-cacao = "dev-so" | ||
395 | INSANE_SKIP_${JDKPN}-vm-jamvm = "dev-so" | ||
396 | INSANE_SKIP_${JDKPN}-common = "dev-so" | ||
397 | |||
398 | FILES_${JDKPN}-jdk = " \ | ||
399 | ${JDK_HOME}/bin \ | ||
400 | ${JDK_HOME}/lib \ | ||
401 | ${JDK_HOME}/include \ | ||
402 | " | ||
403 | RDEPENDS_${JDKPN}-jre = "${JDKPN}-java" | ||
404 | RPROVIDES_${JDKPN}-jre = "java2-runtime" | ||
405 | |||
406 | RDEPENDS_${JDKPN}-jdk = "${JDKPN}-jre" | ||
407 | |||
408 | FILES_${JDKPN}-doc = "${JDK_HOME}/man" | ||
409 | |||
410 | pkg_postinst_${JDKPN}-vm-shark () { | ||
411 | if grep -q "\-server ERROR" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && ! grep -q "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
412 | sed -i -e "/\-shark.*/d" -e "s|\(^\-server*\)|\-shark KNOWN\n\1|" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
413 | else | ||
414 | sed -i -e "s/\-shark.*/\-shark KNOWN/" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
415 | fi | ||
416 | } | ||
417 | |||
418 | pkg_prerm_${JDKPN}-vm-shark () { | ||
419 | sed -i -e "/^\-shark.*/d" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
420 | if grep -q "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && grep -q "\-server ERROR" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
421 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -1` | ||
422 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
423 | fi | ||
424 | |||
425 | echo "-shark ERROR" >> ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
426 | } | ||
427 | |||
428 | pkg_postinst_${JDKPN}-vm-cacao () { | ||
429 | if grep -q "\-server ERROR" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && ! grep -q "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
430 | sed -i -e "/\-cacao.*/d" -e "s|\(^\-server*\)|\-cacao KNOWN\n\1|" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
431 | else | ||
432 | sed -i -e "s/\-cacao.*/\-cacao KNOWN/" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
433 | fi | ||
434 | } | ||
435 | |||
436 | pkg_prerm_${JDKPN}-vm-cacao () { | ||
437 | sed -i -e "/^\-cacao.*/d" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
438 | if grep -q "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && grep -q "\-server ERROR" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
439 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -1` | ||
440 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
441 | fi | ||
442 | |||
443 | echo "-cacao ERROR" >> ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
444 | } | ||
445 | |||
446 | pkg_postinst_${JDKPN}-vm-jamvm () { | ||
447 | if grep -q "\-server ERROR" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && ! grep -q "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
448 | sed -i -e "/\-jamvm.*/d" -e "s|\(^\-server*\)|\-jamvm KNOWN\n\1|" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
449 | else | ||
450 | sed -i -e "s/\-jamvm.*/\-jamvm KNOWN/" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
451 | fi | ||
452 | } | ||
453 | |||
454 | pkg_prerm_${JDKPN}-vm-jamvm () { | ||
455 | sed -i -e "/^\-jamvm.*/d" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
456 | if grep -q "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && grep -q "\-server ERROR" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
457 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -1` | ||
458 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
459 | fi | ||
460 | |||
461 | echo "-jamvm ERROR" >> ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
462 | } | ||
463 | |||
464 | pkg_postinst_${JDKPN}-vm-zero () { | ||
465 | if grep -q "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && grep -q "\-server ERROR" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
466 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -1` | ||
467 | sed -i -e "/${FIRST_KNOWN}/d" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
468 | echo ${FIRST_KNOWN} >> ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
469 | fi | ||
470 | |||
471 | sed -i -e "s|^\-server.*|\-server KNOWN|" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
472 | } | ||
473 | |||
474 | pkg_prerm_${JDKPN}-vm-zero () { | ||
475 | sed -i -e "/^\-server.*/\-server ERROR" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
476 | if grep -q "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
477 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -1` | ||
478 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
479 | fi | ||
480 | } | ||
481 | |||
482 | pkg_postinst_${JDKPN}-jre () { | ||
483 | update-alternatives --install ${bindir}/java java ${JDK_HOME}/jre/bin/java 15 | ||
484 | } | ||
485 | |||
486 | pkg_prerm_${JDKPN}-jre () { | ||
487 | update-alternatives --remove java ${JDK_HOME}/jre/bin/java | ||
488 | } | ||
489 | |||
490 | pkg_postinst_${JDKPN}-jdk () { | ||
491 | update-alternatives --install ${bindir}/javac javac ${JDK_HOME}/bin/javac 15 | ||
492 | } | ||
493 | |||
494 | pkg_prerm_${JDKPN}-jdk () { | ||
495 | update-alternatives --remove javac ${JDK_HOME}/bin/javac | ||
496 | } | ||