summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2014-10-13 04:37:24 -0200
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2014-10-13 04:37:24 -0200
commit07ac33c000c046df51de1b1249c74ef5fbe307a5 (patch)
tree08512777c60cd485a65188d430def711a4e820e5
parentf90b5da18e958f987c30494730d4b73af31a0388 (diff)
downloadabslibre-07ac33c000c046df51de1b1249c74ef5fbe307a5.tar.gz
abslibre-07ac33c000c046df51de1b1249c74ef5fbe307a5.tar.bz2
abslibre-07ac33c000c046df51de1b1249c74ef5fbe307a5.zip
java7-openjdk-7.u65_2.5.2-3.parabola1: use new java-*-common scripts. rewrite install scripts
-rw-r--r--libre/java7-openjdk/PKGBUILD8
-rw-r--r--libre/java7-openjdk/jdk7-openjdk.install52
-rw-r--r--libre/java7-openjdk/jre7-openjdk-headless.install51
-rw-r--r--libre/java7-openjdk/jre7-openjdk.install60
4 files changed, 100 insertions, 71 deletions
diff --git a/libre/java7-openjdk/PKGBUILD b/libre/java7-openjdk/PKGBUILD
index fb4f665a4..3451acb54 100644
--- a/libre/java7-openjdk/PKGBUILD
+++ b/libre/java7-openjdk/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 221783 2014-09-15 20:19:56Z guillaume $
+# $Id: PKGBUILD 224243 2014-10-12 19:04:03Z guillaume $
# Maintainer (Arch): Andreas Radke <andyrtr@archlinux.org>
# Maintainer (Arch): Guillaume ALAUX <guillaume@archlinux.org>
# Contributor (Arch): Jan de Groot <jgc@archlinux.org>
@@ -15,7 +15,7 @@ _JDK_UPDATE_VERSION=65
_bootstrap=0 # 0/1 for quick build or full bootstrap
pkgver=${_java_ver}.u${_JDK_UPDATE_VERSION}_${_icedtea_ver}
-pkgrel=2.parabola1
+pkgrel=3.parabola1
arch=('i686' 'x86_64')
url='http://icedtea.classpath.org'
license=('custom')
@@ -117,7 +117,7 @@ check() {
package_jre7-openjdk-headless() {
pkgdesc='OpenJDK Java 7 headless runtime environment (Parabola rebranded)'
- depends=('java-common' 'libjpeg-turbo' 'lcms2' 'nss' 'ca-certificates-java')
+ depends=('java-runtime-common' 'libjpeg-turbo' 'lcms2' 'nss' 'ca-certificates-java')
optdepends=('libcups: needed for Java Mauve support - libmawt.so'
'fontconfig: needed for Java Mauve support - libmawt.so'
'java-rhino: for some JavaScript support')
@@ -246,7 +246,7 @@ package_jre7-openjdk() {
package_jdk7-openjdk() {
pkgdesc='OpenJDK Java 7 development kit (Parabola rebranded)'
- depends=("jre7-openjdk=${pkgver}-${pkgrel}")
+ depends=('java-environment-common' "jre7-openjdk=${pkgver}-${pkgrel}")
provides=('java-environment=7' 'java-environment-openjdk=7')
replaces=('openjdk6' 'jdk7-openjdk-wm')
install=jdk7-openjdk.install
diff --git a/libre/java7-openjdk/jdk7-openjdk.install b/libre/java7-openjdk/jdk7-openjdk.install
index c8503412a..b07b15053 100644
--- a/libre/java7-openjdk/jdk7-openjdk.install
+++ b/libre/java7-openjdk/jdk7-openjdk.install
@@ -1,38 +1,50 @@
-this_java='java-7-openjdk'
+THIS_JDK='java-7-openjdk'
-post_install() {
- default=$(/usr/bin/parabola-java get)
- if [ -z "${default}" ]; then
- /usr/bin/parabola-java set ${this_java}
- elif [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
- /usr/bin/parabola-java fix
+fix_default() {
+ if [ ! -x /usr/bin/java ]; then
+ /usr/bin/parabola-java unset
+ echo ""
else
- echo "Default Java environment is already set to '${default}'"
- echo "To set '${this_java}' as default, consider using:"
- echo " parabola-java set '${this_java}'"
+ /usr/bin/parabola-java get
fi
+}
+
+post_install() {
+ default=$(fix_default)
+ case ${default} in
+ "" | ${THIS_JDK}/jre)
+ /usr/bin/parabola-java set ${THIS_JDK}
+ ;;
+ ${THIS_JDK})
+ # Nothing
+ ;;
+ *)
+ echo "Default Java environment is already set to '${default}'"
+ echo "See 'parabola-java help' to change it"
+ ;;
+ esac
if [ ! -f /etc/ssl/certs/java/cacerts ]; then
- JAVA_HOME=/usr/lib/jvm/${this_java} /usr/bin/init-jks-keystore
+ /usr/bin/init-jks-keystore
fi
}
post_upgrade() {
- default=$(/usr/bin/parabola-java get)
- if [ -z "${default}" ]; then
- /usr/bin/parabola-java set ${this_java}
- elif [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
- /usr/bin/parabola-java fix
+ default=$(fix_default)
+ if [ -z "${default}" -o "x${default}" = "x${THIS_JDK}/jre" ]; then
+ /usr/bin/parabola-java set ${THIS_JDK}
fi
if [ ! -f /etc/ssl/certs/java/cacerts ]; then
- JAVA_HOME=/usr/lib/jvm/${this_java} /usr/bin/init-jks-keystore
+ /usr/bin/init-jks-keystore
fi
}
pre_remove() {
- default=$(/usr/bin/parabola-java get)
- if [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
- /usr/bin/parabola-java set ${this_java}/jre
+ if [ "x$(fix_default)" = "x${THIS_JDK}" ]; then
+ sudo /usr/bin/parabola-java unset
+ if [ -x /usr/lib/jvm/${THIS_JDK}/jre/bin/java ]; then
+ sudo /usr/bin/parabola-java set ${THIS_JDK}/jre
+ fi
fi
}
diff --git a/libre/java7-openjdk/jre7-openjdk-headless.install b/libre/java7-openjdk/jre7-openjdk-headless.install
index dae6648f0..e21f8a30d 100644
--- a/libre/java7-openjdk/jre7-openjdk-headless.install
+++ b/libre/java7-openjdk/jre7-openjdk-headless.install
@@ -1,41 +1,48 @@
-this_java='java-7-openjdk/jre'
+THIS_JRE='java-7-openjdk/jre'
-post_install() {
- default=$(/usr/bin/parabola-java get)
- if [ -z "${default}" ]; then
- /usr/bin/parabola-java set ${this_java}
- elif [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
- /usr/bin/parabola-java fix
+fix_default() {
+ if [ ! -x /usr/bin/java ]; then
+ /usr/bin/parabola-java unset
+ echo ""
else
- echo "Default Java environment is already set to '${default}'"
- echo "To set '${this_java}' as default, consider using:"
- echo " parabola-java set '${this_java}'"
+ /usr/bin/parabola-java get
fi
+}
+
+post_install() {
+ default=$(fix_default)
+ case ${default} in
+ "")
+ /usr/bin/parabola-java set ${THIS_JRE}
+ ;;
+ ${THIS_JRE} | ${THIS_JRE/\/jre})
+ # Nothing
+ ;;
+ *)
+ echo "Default Java environment is already set to '${default}'"
+ echo "See 'parabola-java help' to change it"
+ ;;
+ esac
if [ ! -f /etc/ssl/certs/java/cacerts ]; then
- # Overwrite JAVA_HOME because if it still points at java-7-openjdk AND user just removed jdk,
- # Then /usr/bin/java will in the end, refer to /usr/lib/jvm/java-7-openjdk/java which doesn't exist
- JAVA_HOME=/usr/lib/jvm/${this_java} /usr/bin/init-jks-keystore
+ /usr/bin/init-jks-keystore
fi
}
post_upgrade() {
- default=$(/usr/bin/parabola-java get)
- if [ -z "${default}" ]; then
- /usr/bin/parabola-java set ${this_java}
- elif [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
- /usr/bin/parabola-java fix
+ if [ -z $(fix_default) ]; then
+ /usr/bin/parabola-java set ${THIS_JRE}
fi
if [ ! -f /etc/ssl/certs/java/cacerts ]; then
- JAVA_HOME=/usr/lib/jvm/${this_java} /usr/bin/init-jks-keystore
+ /usr/bin/init-jks-keystore
fi
}
pre_remove() {
- default=$(/usr/bin/parabola-java get)
- if [ "x${default/\/jre}" = "x${this_java/\/jre}" ]; then
+ default=$(fix_default)
+ if [ "x${default/\/jre}" = "x${THIS_JRE/\/jre}" ]; then
/usr/bin/parabola-java unset
- echo 'No Java environment is set anymore'
+ echo "No Java environment is set as default anymore"
fi
}
diff --git a/libre/java7-openjdk/jre7-openjdk.install b/libre/java7-openjdk/jre7-openjdk.install
index dd1458385..45835da4d 100644
--- a/libre/java7-openjdk/jre7-openjdk.install
+++ b/libre/java7-openjdk/jre7-openjdk.install
@@ -1,35 +1,50 @@
-this_java='java-7-openjdk/jre'
+THIS_JRE='java-7-openjdk/jre'
+
+fix_default() {
+ if [ ! -x /usr/bin/java ]; then
+ /usr/bin/parabola-java unset
+ echo ""
+ else
+ /usr/bin/parabola-java get
+ fi
+}
post_install() {
+ default=$(fix_default)
+ case ${default} in
+ "")
+ /usr/bin/parabola-java set ${THIS_JRE}
+ ;;
+ ${THIS_JRE} | ${THIS_JRE/\/jre})
+ # Nothing
+ ;;
+ *)
+ echo "Default Java environment is already set to '${default}'"
+ echo "See 'parabola-java help' to change it"
+ ;;
+ esac
+
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
- echo "when you use a non-reparenting window manager"
- echo "set _JAVA_AWT_WM_NONREPARENTING=1 in"
- echo "/etc/profile.d/jre.sh"
+ echo "when you use a non-reparenting window manager,"
+ echo "set _JAVA_AWT_WM_NONREPARENTING=1 in /etc/profile.d/jre.sh"
# update-desktop-database -q
-
- default=$(/usr/bin/parabola-java get)
- if [ -z "${default}" ]; then
- /usr/bin/parabola-java set ${this_java}
- elif [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
- /usr/bin/parabola-java fix
- else
- echo "Default Java environment is already set to '${default}'"
- echo "To set '${this_java}' as default, consider using:"
- echo " parabola-java set '${this_java}'"
- fi
}
post_upgrade() {
+ if [ -z $(fix_default) ]; then
+ /usr/bin/parabola-java set ${THIS_JRE}
+ fi
+
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
# update-desktop-database -q
+}
- default=$(/usr/bin/parabola-java get)
- if [ -z "${default}" ]; then
- /usr/bin/parabola-java set ${this_java}
- elif [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
- /usr/bin/parabola-java fix
+pre_remove() {
+ if [ "x$(fix_default)" = "x${THIS_JRE/\/jre}" ]; then
+ /usr/bin/parabola-java unset
+ echo "No Java environment is set as default anymore"
fi
}
@@ -37,9 +52,4 @@ post_remove() {
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
# update-desktop-database -q
-
- default=$(/usr/bin/parabola-java get)
- if [ "${default/\/jre}" = "${this_java/\/jre}" ]; then
- /usr/bin/parabola-java fix
- fi
}