]> git.sven.stormbind.net Git - sven/java-package.git/commitdiff
* Add support of ARM upstream binary by James Page and Matthias Vill.
authorSylvestre Ledru <sylvestre.ledru@scilab-enterprises.com>
Wed, 5 Jun 2013 12:03:53 +0000 (14:03 +0200)
committerSylvestre Ledru <sylvestre.ledru@scilab-enterprises.com>
Wed, 5 Jun 2013 12:03:53 +0000 (14:03 +0200)
    Thanks guys! (Closes: #687375)

lib/j2sdk.sh
lib/oracle-j2sdk.sh

index e3bb5a2309c4fa194a3216a2145616b4ee7a7887..21031c9818f33a495b698970c2aeb8a4c9f00513 100644 (file)
@@ -1,12 +1,23 @@
 
 j2sdk_control() {
     j2se_control
+    java_browser_plugin="java-browser-plugin, "
+    depends="\${shlibs:Depends}"
+    if [ "${DEB_BUILD_ARCH:0:3}" = "arm" ]; then
+        # ARM is only softfloat ATM so if building on armhf
+        # force the dependencies to pickup cross platform fu
+        if [ "${DEB_BUILD_ARCH}" == "armhf" ]; then
+            depends="libc6-armel, libsfgcc1, libsfstdc++6"
+        fi
+        # No browser on ARM yet
+        java_browser_plugin=""
+    fi
     cat << EOF
 Package: $j2se_package
 Architecture: any
-Depends: \${shlibs:Depends}
+Depends: $depends
 Recommends: netbase, libx11-6 | xlibs, libasound2, libgtk1.2, libstdc++5
-Provides: java-virtual-machine, java-runtime, java2-runtime, java5-runtime, java6-runtime, java-browser-plugin, java-compiler, java2-compiler, java-runtime-headless, java2-runtime-headless, java5-runtime-headless, java6-runtime-headless, java-sdk, java2-sdk, java5-sdk, java6-sdk, j2sdk$j2se_release, j2re$j2se_release
+Provides: java-virtual-machine, java-runtime, java2-runtime, $java_browser_plugin java-compiler, java2-compiler, java-runtime-headless, java2-runtime-headless, java-sdk, java2-sdk, j2sdk$j2se_release, j2re$j2se_release
 Replaces: ${j2se_package}debian
 Description: $j2se_title
  The Java(TM) SE JDK is a development environment for building
index 779138878713b213558c2a2f63e34dd8e0ecef1f..090c2cfdea185677753956b02c2abfc63d7f35b8 100644 (file)
@@ -21,6 +21,22 @@ oracle_j2sdk_detect() {
       amd64|x86_64-linux-gnu)
         if [[ "$j2se_arch" != "x64" && "$j2se_arch" != "amd64" ]]; then compatible=0; fi
         ;;
+      armhf|armel|arm-linux-gnueabihf|arm-linux-gnueabi)
+      case "$archive_name" in
+        "jdk-7u"[0-9]"-linux-arm-sfp.tar.gz") # SUPPORTED
+            j2se_version=1.7.0+update${archive_name:6:1}${revision}
+            j2se_expected_min_size=100 #Mb
+            j2se_priority=317
+            found=true
+            ;;
+        "jdk-7u"[0-9][0-9]"-linux-arm-sfp.tar.gz") # SUPPORTED
+            j2se_version=1.7.0+update${archive_name:6:2}${revision}
+            j2se_expected_min_size=60 #Mb
+            j2se_priority=317
+            found=true
+            ;;
+      esac
+      ;;
     esac
 
     if [[ $compatible == 0 ]]
@@ -46,9 +62,16 @@ EOF
       j2se_install=oracle_j2sdk_install
       j2se_remove=oracle_j2sdk_remove
       j2se_jinfo=oracle_j2sdk_jinfo
-      oracle_jre_bin_hl="java javaws keytool orbd pack200 rmid rmiregistry servertool tnameserv unpack200 policytool"
-      oracle_jre_bin_jre="javaws policytool"
-      oracle_no_man_jre_bin_jre="ControlPanel"
+      if [ "${DEB_BUILD_ARCH:0:3}" = "arm" ]; then
+           oracle_jre_bin_hl="java keytool orbd pack200 rmid rmiregistry servertool tnameserv unpack200 policytool"
+        oracle_jre_bin_jre="policytool"
+      else
+        oracle_jre_bin_hl="java javaws keytool orbd pack200 rmid rmiregistry servertool tnameserv unpack200 policytool"
+        oracle_jre_bin_jre="javaws policytool"
+      fi
+      if [ "${DEB_BUILD_ARCH:0:3}" != "arm" ]; then
+           oracle_no_man_jre_bin_jre="ControlPanel"
+      fi
       oracle_jre_lib_hl="jexec"
       oracle_bin_jdk="appletviewer extcheck idlj jar jarsigner javac javadoc javah javap jconsole jdb jinfo jmap jps jsadebugd jstack jstat jstatd native2ascii rmic serialver"
       j2sdk_run
@@ -64,14 +87,19 @@ fi
 
 install_alternatives $jvm_base$j2se_name/jre/bin $oracle_jre_bin_hl
 install_alternatives $jvm_base$j2se_name/jre/bin $oracle_jre_bin_jre
-install_no_man_alternatives $jvm_base$j2se_name/jre/bin $oracle_no_man_jre_bin_jre
+if [ -n "$oracle_no_man_jre_bin_jre" ]; then
+    install_no_man_alternatives $jvm_base$j2se_name/jre/bin $oracle_no_man_jre_bin_jre
+fi
 install_no_man_alternatives $jvm_base$j2se_name/jre/lib $oracle_jre_lib_hl
 install_alternatives $jvm_base$j2se_name/bin $oracle_bin_jdk
 
+# No plugin for ARM architecture yet
+if [ "${DEB_BUILD_ARCH:0:3}" != "arm" ]; then
 plugin_dir="$jvm_base$j2se_name/jre/lib/$DEB_BUILD_ARCH"
 for b in $browser_plugin_dirs;do
            install_browser_plugin "/usr/lib/\$b/plugins" "libjavaplugin.so" "\$b-javaplugin.so" "\$plugin_dir/libnpjp2.so"
 done
+fi
 EOF
 }
 
@@ -83,14 +111,19 @@ fi
 
 remove_alternatives $jvm_base$j2se_name/jre/bin $oracle_jre_bin_hl
 remove_alternatives $jvm_base$j2se_name/jre/bin $oracle_jre_bin_jre
-remove_alternatives $jvm_base$j2se_name/jre/bin $oracle_no_man_jre_bin_jre
+if [ -n "$oracle_no_man_jre_bin_jre" ]; then
+    remove_alternatives $jvm_base$j2se_name/jre/bin $oracle_no_man_jre_bin_jre
+fi
 remove_alternatives $jvm_base$j2se_name/jre/lib $oracle_jre_lib_hl
 remove_alternatives $jvm_base$j2se_name/bin $oracle_bin_jdk
 
+# No plugin for ARM architecture yet
+if [ "${DEB_BUILD_ARCH:0:3}" != "arm" ]; then
 plugin_dir="$jvm_base$j2se_name/jre/lib/$DEB_BUILD_ARCH"
 for b in $browser_plugin_dirs;do
     remove_browser_plugin "\$b-javaplugin.so" "\$plugin_dir/libnpjp2.so"
 done
+fi
 EOF
 }
 
@@ -102,10 +135,14 @@ section=main
 EOF
     jinfos "hl" $jvm_base$j2se_name/jre/bin/ $oracle_jre_bin_hl
     jinfos "jre" $jvm_base$j2se_name/jre/bin/ $oracle_jre_bin_jre
-    jinfos "jre" $jvm_base$j2se_name/jre/bin/ $oracle_no_man_jre_bin_jre
+    if [ -n "$oracle_no_man_jre_bin_jre" ]; then
+        jinfos "jre" $jvm_base$j2se_name/jre/bin/ $oracle_no_man_jre_bin_jre
+    fi
     jinfos "hl" $jvm_base$j2se_name/jre/lib/ $oracle_jre_lib_hl
     jinfos "jdk" $jvm_base$j2se_name/bin/ $oracle_bin_jdk
-    for b in $browser_plugin_dirs;do
-        echo "plugin iceweasel-javaplugin.so $jvm_base$j2se_name/jre/lib/$DEB_BUILD_ARCH/libnpjp2.so"
-    done
+    if [ "${DEB_BUILD_ARCH:0:3}" != "arm" ]; then
+        for b in $browser_plugin_dirs;do
+            echo "plugin iceweasel-javaplugin.so $jvm_base$j2se_name/jre/lib/$DEB_BUILD_ARCH/libnpjp2.so"
+        done
+    fi
 }