diff options
Diffstat (limited to 'recipes-core/openjdk')
-rw-r--r-- | recipes-core/openjdk/openjdk-7-common.inc | 100 | ||||
-rw-r--r-- | recipes-core/openjdk/openjdk-postinst.inc | 100 |
2 files changed, 99 insertions, 101 deletions
diff --git a/recipes-core/openjdk/openjdk-7-common.inc b/recipes-core/openjdk/openjdk-7-common.inc index 6005394..56180e2 100644 --- a/recipes-core/openjdk/openjdk-7-common.inc +++ b/recipes-core/openjdk/openjdk-7-common.inc | |||
@@ -356,6 +356,104 @@ JDK_URI = "${ICEDTEA_DROP_URL}/${JDK_FILE};name=jdk;unpack=false" | |||
356 | LANGTOOLS_FILE = "langtools.tar.bz2" | 356 | LANGTOOLS_FILE = "langtools.tar.bz2" |
357 | LANGTOOLS_URI = "${ICEDTEA_DROP_URL}/${LANGTOOLS_FILE};name=langtools;unpack=false" | 357 | LANGTOOLS_URI = "${ICEDTEA_DROP_URL}/${LANGTOOLS_FILE};name=langtools;unpack=false" |
358 | 358 | ||
359 | require openjdk-postinst.inc | 359 | # handles all postinst action for openjdk |
360 | # some of the former results in a build error because "ERR" is in the first line. | ||
361 | |||
362 | pkg_postinst_${JDKPN}-vm-shark () { | ||
363 | true | ||
364 | if grep -q "\-server ERROR" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && ! grep -q "KNOWN" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
365 | sed -i -e "/\-shark.*/d" -e "s|\(^\-server*\)|\-shark KNOWN\n\1|" -e "/^$/d" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
366 | else | ||
367 | sed -i -e "s/\-shark.*/\-shark KNOWN/" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
368 | fi | ||
369 | } | ||
370 | |||
371 | pkg_prerm_${JDKPN}-vm-shark () { | ||
372 | true | ||
373 | sed -i -e "/^\-shark.*/d" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
374 | 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 | ||
375 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -n 1` | ||
376 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
377 | fi | ||
378 | |||
379 | echo "-shark ERROR" >> ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
380 | } | ||
381 | |||
382 | pkg_postinst_${JDKPN}-vm-cacao () { | ||
383 | true | ||
384 | if grep -q "\-server ERROR" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && ! grep -q "KNOWN" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
385 | sed -i -e "/\-cacao.*/d" -e "s|\(^\-server*\)|\-cacao KNOWN\n\1|" -e "/^$/d" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
386 | else | ||
387 | sed -i -e "s/\-cacao.*/\-cacao KNOWN/" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
388 | fi | ||
389 | } | ||
390 | |||
391 | pkg_prerm_${JDKPN}-vm-cacao () { | ||
392 | true | ||
393 | sed -i -e "/^\-cacao.*/d" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
394 | 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 | ||
395 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -n 1` | ||
396 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
397 | fi | ||
398 | |||
399 | echo "-cacao ERROR" >> ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
400 | } | ||
401 | |||
402 | pkg_postinst_${JDKPN}-vm-jamvm () { | ||
403 | true | ||
404 | if grep -q "\-server ERROR" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && ! grep -q "KNOWN" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
405 | sed -i -e "/\-jamvm.*/d" -e "s|\(^\-server*\)|\-jamvm KNOWN\n\1|" -e "/^$/d" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
406 | else | ||
407 | sed -i -e "s/\-jamvm.*/\-jamvm KNOWN/" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
408 | fi | ||
409 | } | ||
410 | |||
411 | pkg_prerm_${JDKPN}-vm-jamvm () { | ||
412 | true | ||
413 | sed -i -e "/^\-jamvm.*/d" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
414 | 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 | ||
415 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -n 1` | ||
416 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
417 | fi | ||
418 | |||
419 | echo "-jamvm ERROR" >> ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
420 | } | ||
421 | |||
422 | pkg_postinst_${JDKPN}-vm-zero () { | ||
423 | true | ||
424 | if grep -q "KNOWN" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && grep -q "\-server ERROR" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
425 | FIRST_KNOWN=`grep "KNOWN" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -n 1` | ||
426 | sed -i -e "/${FIRST_KNOWN}/d" -e "/^$/d" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
427 | echo ${FIRST_KNOWN} >> $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
428 | fi | ||
429 | |||
430 | sed -i -e "s|^\-server.*|\-server KNOWN|" -e "/^$/d" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
431 | } | ||
432 | |||
433 | pkg_prerm_${JDKPN}-vm-zero () { | ||
434 | true | ||
435 | sed -i -e "/^\-server.*/\-server ERROR" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
436 | if grep -q "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
437 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -n 1` | ||
438 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
439 | fi | ||
440 | } | ||
441 | |||
442 | pkg_postinst_${JDKPN}-jre () { | ||
443 | ln -s ${JDK_HOME}/jre $D/${libdir}/jvm/jre | ||
444 | } | ||
445 | |||
446 | inherit update-alternatives | ||
447 | |||
448 | ALTERNATIVE_${JDKPN}-jre = "java keytool" | ||
449 | ALTERNATIVE_${JDKPN}-jdk = "javac" | ||
450 | |||
451 | ALTERNATIVE_TARGET[java] = "${JDK_HOME}/jre/bin/java" | ||
452 | ALTERNATIVE_TARGET[javac] = "${JDK_HOME}/bin/javac" | ||
453 | ALTERNATIVE_TARGET[keytool] = "${JDK_HOME}/jre/bin/keytool" | ||
454 | |||
455 | ALTERNATIVE_LINK_NAME[java] = "${bindir}/java" | ||
456 | ALTERNATIVE_LINK_NAME[javac] = "${bindir}/javac" | ||
457 | ALTERNATIVE_LINK_NAME[keytool] = "${bindir}/keytool" | ||
360 | 458 | ||
361 | ALTERNATIVE_PRIORITY = "50" | 459 | ALTERNATIVE_PRIORITY = "50" |
diff --git a/recipes-core/openjdk/openjdk-postinst.inc b/recipes-core/openjdk/openjdk-postinst.inc deleted file mode 100644 index be88714..0000000 --- a/recipes-core/openjdk/openjdk-postinst.inc +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | # handles all postinst action for openjdk | ||
2 | |||
3 | # some of the former results in a build error because "ERR" is in the first line. | ||
4 | |||
5 | pkg_postinst_${JDKPN}-vm-shark () { | ||
6 | true | ||
7 | if grep -q "\-server ERROR" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && ! grep -q "KNOWN" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
8 | sed -i -e "/\-shark.*/d" -e "s|\(^\-server*\)|\-shark KNOWN\n\1|" -e "/^$/d" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
9 | else | ||
10 | sed -i -e "s/\-shark.*/\-shark KNOWN/" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
11 | fi | ||
12 | } | ||
13 | |||
14 | pkg_prerm_${JDKPN}-vm-shark () { | ||
15 | true | ||
16 | sed -i -e "/^\-shark.*/d" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
17 | 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 | ||
18 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -n 1` | ||
19 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
20 | fi | ||
21 | |||
22 | echo "-shark ERROR" >> ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
23 | } | ||
24 | |||
25 | pkg_postinst_${JDKPN}-vm-cacao () { | ||
26 | true | ||
27 | if grep -q "\-server ERROR" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && ! grep -q "KNOWN" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
28 | sed -i -e "/\-cacao.*/d" -e "s|\(^\-server*\)|\-cacao KNOWN\n\1|" -e "/^$/d" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
29 | else | ||
30 | sed -i -e "s/\-cacao.*/\-cacao KNOWN/" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
31 | fi | ||
32 | } | ||
33 | |||
34 | pkg_prerm_${JDKPN}-vm-cacao () { | ||
35 | true | ||
36 | sed -i -e "/^\-cacao.*/d" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
37 | 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 | ||
38 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -n 1` | ||
39 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
40 | fi | ||
41 | |||
42 | echo "-cacao ERROR" >> ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
43 | } | ||
44 | |||
45 | pkg_postinst_${JDKPN}-vm-jamvm () { | ||
46 | true | ||
47 | if grep -q "\-server ERROR" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && ! grep -q "KNOWN" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
48 | sed -i -e "/\-jamvm.*/d" -e "s|\(^\-server*\)|\-jamvm KNOWN\n\1|" -e "/^$/d" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
49 | else | ||
50 | sed -i -e "s/\-jamvm.*/\-jamvm KNOWN/" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
51 | fi | ||
52 | } | ||
53 | |||
54 | pkg_prerm_${JDKPN}-vm-jamvm () { | ||
55 | true | ||
56 | sed -i -e "/^\-jamvm.*/d" -e "/^$/d" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
57 | 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 | ||
58 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -n 1` | ||
59 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
60 | fi | ||
61 | |||
62 | echo "-jamvm ERROR" >> ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
63 | } | ||
64 | |||
65 | pkg_postinst_${JDKPN}-vm-zero () { | ||
66 | true | ||
67 | if grep -q "KNOWN" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg && grep -q "\-server ERROR" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
68 | FIRST_KNOWN=`grep "KNOWN" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -n 1` | ||
69 | sed -i -e "/${FIRST_KNOWN}/d" -e "/^$/d" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
70 | echo ${FIRST_KNOWN} >> $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
71 | fi | ||
72 | |||
73 | sed -i -e "s|^\-server.*|\-server KNOWN|" -e "/^$/d" $D/${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
74 | } | ||
75 | |||
76 | pkg_prerm_${JDKPN}-vm-zero () { | ||
77 | true | ||
78 | sed -i -e "/^\-server.*/\-server ERROR" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
79 | if grep -q "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg; then | ||
80 | FIRST_KNOWN=`grep "KNOWN" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | head -n 1` | ||
81 | sed -i -e "/${FIRST_KNOWN}/d" -e "s|\(^\-server*\)|${FIRST_KNOWN}\n\1|" ${JDK_HOME}/jre/lib/${JDK_ARCH}/jvm.cfg | ||
82 | fi | ||
83 | } | ||
84 | |||
85 | pkg_postinst_${JDKPN}-jre () { | ||
86 | ln -s ${JDK_HOME}/jre $D/${libdir}/jvm/jre | ||
87 | } | ||
88 | |||
89 | inherit update-alternatives | ||
90 | |||
91 | ALTERNATIVE_${JDKPN}-jre = "java keytool" | ||
92 | ALTERNATIVE_${JDKPN}-jdk = "javac" | ||
93 | |||
94 | ALTERNATIVE_TARGET[java] = "${JDK_HOME}/jre/bin/java" | ||
95 | ALTERNATIVE_TARGET[javac] = "${JDK_HOME}/bin/javac" | ||
96 | ALTERNATIVE_TARGET[keytool] = "${JDK_HOME}/jre/bin/keytool" | ||
97 | |||
98 | ALTERNATIVE_LINK_NAME[java] = "${bindir}/java" | ||
99 | ALTERNATIVE_LINK_NAME[javac] = "${bindir}/javac" | ||
100 | ALTERNATIVE_LINK_NAME[keytool] = "${bindir}/keytool" | ||