summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorJustin Too <justin@doubleotoo.com>2015-01-06 11:12:02 -0800
committerJustin Too <justin@doubleotoo.com>2015-01-07 14:07:02 -0800
commitcd9e4b5b7f1aa13b846e48fbc07a7f847a21f46a (patch)
tree221cc699ac1e875d54851e2cb6df574730ee79b8 /var
parentf1c5e64c23037a3dd7fa65794a1f917f9d5f812c (diff)
downloadspack-cd9e4b5b7f1aa13b846e48fbc07a7f847a21f46a.tar.gz
spack-cd9e4b5b7f1aa13b846e48fbc07a7f847a21f46a.tar.bz2
spack-cd9e4b5b7f1aa13b846e48fbc07a7f847a21f46a.tar.xz
spack-cd9e4b5b7f1aa13b846e48fbc07a7f847a21f46a.zip
(Package) Add Oracle JDK package
Diffstat (limited to 'var')
-rw-r--r--var/spack/packages/jdk/package.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/var/spack/packages/jdk/package.py b/var/spack/packages/jdk/package.py
new file mode 100644
index 0000000000..8f8076dd14
--- /dev/null
+++ b/var/spack/packages/jdk/package.py
@@ -0,0 +1,46 @@
+#------------------------------------------------------------------------------
+# Author: Justin Too <too1@llnl.gov>
+#------------------------------------------------------------------------------
+import distutils
+from distutils import dir_util
+from subprocess import call
+
+import spack
+from spack import *
+import llnl.util.tty as tty
+
+class Jdk(Package):
+ """The Java Development Kit (JDK) released by Oracle Corporation
+ in the form of a binary product aimed at Java developers."""
+ homepage = "http://www.oracle.com/technetwork/java/javase/downloads/index.html"
+
+ version('8u25-linux-x64', 'e145c03a7edc845215092786bcfba77e',
+ url="http://download.oracle.com/otn-pub/java/jdk/8u25-b17/jdk-8u25-linux-x64.tar.gz")
+
+ # Oracle requires that you accept their License Agreement in order
+ # to access the Java packages in download.oracle.com. In order to
+ # automate this process, we need to utilize these additional curl
+ # commandline options.
+ #
+ # See http://stackoverflow.com/questions/10268583/how-to-automate-download-and-installation-of-java-jdk-on-linux
+ curl_options=[
+ '-j', # junk cookies
+ '-H', # specify required License Agreement cookie
+ 'Cookie: oraclelicense=accept-securebackup-cookie']
+
+ def do_fetch(self):
+ # Add our custom curl commandline options
+ tty.msg(
+ "[Jdk] Adding required commandline options to curl " +
+ "before performing fetch: %s" %
+ (self.curl_options))
+
+ for option in self.curl_options:
+ spack.curl.add_default_arg(option)
+
+ # Now perform the actual fetch
+ super(Jdk, self).do_fetch()
+
+
+ def install(self, spec, prefix):
+ distutils.dir_util.copy_tree(".", prefix)