Admin/java/build
changeset 60995 5176de8f90db
parent 60760 3444e0bf9261
child 61510 9f7453fb022f
equal deleted inserted replaced
60994:b1e324a0677c 60995:5176de8f90db
     1 #!/usr/bin/env bash
     1 #!/usr/bin/env bash
       
     2 
       
     3 THIS="$(cd "$(dirname "$0")"; pwd)"
       
     4 
     2 
     5 
     3 ## diagnostics
     6 ## diagnostics
     4 
     7 
     5 function fail()
     8 function fail()
     6 {
     9 {
     9 }
    12 }
    10 
    13 
    11 
    14 
    12 ## parameters
    15 ## parameters
    13 
    16 
    14 VERSION="8u51"
    17 VERSION="8u60"
    15 FULL_VERSION="1.8.0_51"
    18 FULL_VERSION="1.8.0_60"
    16 
    19 
    17 ARCHIVE_LINUX32="jdk-${VERSION}-linux-i586.tar.gz"
    20 ARCHIVE_LINUX32="jdk-${VERSION}-linux-i586.tar.gz"
    18 ARCHIVE_LINUX64="jdk-${VERSION}-linux-x64.tar.gz"
    21 ARCHIVE_LINUX64="jdk-${VERSION}-linux-x64.tar.gz"
       
    22 ARCHIVE_WINDOWS32="jdk${FULL_VERSION}-w32.tar.gz"
       
    23 ARCHIVE_WINDOWS64="jdk${FULL_VERSION}-w64.tar.gz"
    19 ARCHIVE_DARWIN="jdk${FULL_VERSION}.jdk.tar.gz"
    24 ARCHIVE_DARWIN="jdk${FULL_VERSION}.jdk.tar.gz"
    20 ARCHIVE_WINDOWS="jdk${FULL_VERSION}.tar.gz"
       
    21 
    25 
    22 
    26 
    23 ## main
    27 ## main
    24 
    28 
    25 DIR="jdk-${VERSION}"
    29 DIR="jdk-${VERSION}"
    33 
    37 
    34 See http://www.oracle.com/technetwork/java/javase/downloads/index.html
    38 See http://www.oracle.com/technetwork/java/javase/downloads/index.html
    35 for the original downloads, which are covered by the Oracle Binary
    39 for the original downloads, which are covered by the Oracle Binary
    36 Code License Agreement for Java SE.
    40 Code License Agreement for Java SE.
    37 
    41 
    38 Linux, Windows Mac OS X, work uniformly, depending on certain
    42 Linux, Windows, Mac OS X all work uniformly, depending on certain
    39 platform-specific subdirectories.
    43 platform-specific subdirectories.
    40 EOF
    44 EOF
    41 
    45 
    42 
    46 
    43 # settings
    47 # settings
    44 
    48 
    45 mkdir "$DIR/etc"
    49 mkdir "$DIR/etc"
    46 cat >> "$DIR/etc/settings" << EOF
    50 cp "$THIS/settings" "$DIR/etc/settings"
    47 # -*- shell-script -*- :mode=shellscript:
       
    48 
       
    49 case "\${ISABELLE_PLATFORM64:-\$ISABELLE_PLATFORM32}" in
       
    50   x86-darwin)
       
    51     echo "### Java unavailable on 32bit Macintosh!" >&2
       
    52     ;;
       
    53   x86_64-darwin)
       
    54     ISABELLE_JDK_HOME="\$COMPONENT/\$ISABELLE_PLATFORM64/Contents/Home"
       
    55     ;;
       
    56   *)
       
    57     ISABELLE_JDK_HOME="\$COMPONENT/\${ISABELLE_PLATFORM64:-\$ISABELLE_PLATFORM32}"
       
    58     ;;
       
    59 esac
       
    60 EOF
       
    61 
    51 
    62 
    52 
    63 # content
    53 # content
    64 
    54 
    65 #GNU tar (notably on Mac OS X)
    55 #GNU tar (notably on Mac OS X)
    66 if [ -x /usr/bin/gnutar ]; then
    56 if [ -x /usr/bin/gnutar ]; then
    67   function tar() { /usr/bin/gnutar "$@"; }
    57   function tar() { /usr/bin/gnutar "$@"; }
    68 fi
    58 fi
    69 
    59 
    70 mkdir "$DIR/x86-linux" "$DIR/x86_64-linux" "$DIR/x86_64-darwin" "$DIR/x86-cygwin"
    60 mkdir "$DIR/x86-linux" "$DIR/x86_64-linux" "$DIR/x86-windows" "$DIR/x86_64-windows" "$DIR/x86_64-darwin"
    71 
    61 
    72 tar -C "$DIR/x86-linux" -xf "$ARCHIVE_LINUX32"
    62 tar -C "$DIR/x86-linux" -xf "$ARCHIVE_LINUX32"
    73 tar -C "$DIR/x86_64-linux" -xf "$ARCHIVE_LINUX64"
    63 tar -C "$DIR/x86_64-linux" -xf "$ARCHIVE_LINUX64"
       
    64 tar -C "$DIR/x86-windows" -xf "$ARCHIVE_WINDOWS32"
       
    65 tar -C "$DIR/x86_64-windows" -xf "$ARCHIVE_WINDOWS64"
    74 tar -C "$DIR/x86_64-darwin" -xf "$ARCHIVE_DARWIN"
    66 tar -C "$DIR/x86_64-darwin" -xf "$ARCHIVE_DARWIN"
    75 tar -C "$DIR/x86-cygwin" -xf "$ARCHIVE_WINDOWS"
       
    76 
    67 
    77 (
    68 (
    78   cd "$DIR"
    69   cd "$DIR"
    79   for PLATFORM in x86-linux x86_64-linux x86-cygwin
    70   for PLATFORM in x86-linux x86_64-linux x86-windows x86_64-windows
    80   do
    71   do
    81     mv "$PLATFORM/jdk${FULL_VERSION}"/* "$PLATFORM"/.
    72     mv "$PLATFORM/jdk${FULL_VERSION}"/* "$PLATFORM"/.
    82     rmdir "$PLATFORM/jdk${FULL_VERSION}"
    73     rmdir "$PLATFORM/jdk${FULL_VERSION}"
    83   done
    74   done
    84   PLATFORM=x86_64-darwin
    75   PLATFORM=x86_64-darwin
    97   cd "$DIR/x86-linux"
    88   cd "$DIR/x86-linux"
    98   for FILE in $(find . -type f)
    89   for FILE in $(find . -type f)
    99   do
    90   do
   100     for OTHER in \
    91     for OTHER in \
   101       "../x86_64-linux/$FILE" \
    92       "../x86_64-linux/$FILE" \
   102       "../x86_64-darwin/Contents/Home/$FILE" \
    93       "../x86-windows/$FILE" \
   103       "../x86-cygwin/$FILE"
    94       "../x86_64-windows/$FILE" \
       
    95       "../x86_64-darwin/Contents/Home/$FILE"
   104     do
    96     do
   105       if cmp -s "$FILE" "$OTHER"
    97       if cmp -s "$FILE" "$OTHER"
   106       then
    98       then
   107         echo -n "*"
    99         echo -n "*"
   108         ln -f "$FILE" "$OTHER"
   100         ln -f "$FILE" "$OTHER"