aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/java-common/APKBUILD24
-rw-r--r--main/java-common/java-common.trigger13
2 files changed, 37 insertions, 0 deletions
diff --git a/main/java-common/APKBUILD b/main/java-common/APKBUILD
new file mode 100644
index 0000000000..d5e3e4d383
--- /dev/null
+++ b/main/java-common/APKBUILD
@@ -0,0 +1,24 @@
+# Contributor: Timo Teras <timo.teras@iki.fi>
+# Maintainer: Timo Teras <timo.teras@iki.fi>
+pkgname=java-common
+pkgver=0.1
+pkgrel=0
+pkgdesc="Java common (updates java links)"
+url="http://git.alpinelinux.org/aports.git"
+arch="noarch"
+license="GPL2"
+depends=
+makedepends=""
+install=""
+subpackages=""
+source=""
+triggers="java-common.trigger:/usr/lib/jvm"
+
+package() {
+ mkdir -p "$pkgdir"/usr/bin
+ ln -sf ../lib/jvm/default-jvm/jre/bin/java "$pkgdir"/usr/bin
+ ln -sf ../lib/jvm/default-jvm/jre/bin/rmiregistry "$pkgdir"/usr/bin
+ ln -sf ../lib/jvm/default-jvm/jre/bin/keytool "$pkgdir"/usr/bin
+ ln -sf ../lib/jvm/default-jvm/bin/appletviewer "$pkgdir"/usr/bin
+}
+
diff --git a/main/java-common/java-common.trigger b/main/java-common/java-common.trigger
new file mode 100644
index 0000000000..6d0613d48e
--- /dev/null
+++ b/main/java-common/java-common.trigger
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ -x /usr/lib/jvm/forced-jvm ]; then
+ ln -sfn forced-jvm default-jvm
+ exit 0
+fi
+
+cd /usr/lib/jvm
+LATEST=`ls -d java-* | sort -r | head -1`
+if [ "$LATEST" ]; then
+ ln -sfn $LATEST default-jvm
+fi
+