Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 132 lines (109 sloc) 4.15 KB
#! /bin/bash
# COOKIE=$(mcookie); grep -v V_GREP_ME $0 > /dev/shm/runme-$COOKIE.sh ; sleep 1; exec bash /dev/shm/runme-$COOKIE.sh
set -xe
umask 022
PKG=openjdk
VERSION=7u181
BUILD=0
PREFIX=/pkg/$PKG-$VERSION-$BUILD
# PREFIX=/dev/shm/pkg/$PKG-$VERSION-$BUILD
ICEDTEA=icedtea-2.6.14
ICEDTEA_VER=$(echo $ICEDTEA | cut -f2 -d-)
GCJ=/pkg/gcc-5.5.0-1
# the build has its own opinion of parallel builds, high counts seem to be instable:
PARALLELJOBS=${PARALLELJOBS:-4}
SOURCES=(http://icedtea.classpath.org/download/source/icedtea-$ICEDTEA_VER.tar.xz \
http://icedtea.classpath.org/download/drops/icedtea7/$ICEDTEA_VER/openjdk.tar.bz2 \
http://icedtea.classpath.org/download/drops/icedtea7/$ICEDTEA_VER/corba.tar.bz2 \
http://icedtea.classpath.org/download/drops/icedtea7/$ICEDTEA_VER/jaxp.tar.bz2 \
http://icedtea.classpath.org/download/drops/icedtea7/$ICEDTEA_VER/jaxws.tar.bz2 \
http://icedtea.classpath.org/download/drops/icedtea7/$ICEDTEA_VER/jdk.tar.bz2 \
http://icedtea.classpath.org/download/drops/icedtea7/$ICEDTEA_VER/langtools.tar.bz2 \
http://icedtea.classpath.org/download/drops/icedtea7/$ICEDTEA_VER/hotspot.tar.bz2)
MD5SUMS=(ec7bf064e33e35dd3845d044e175a698 \
307abf13b695c61a8b16d9fa384277db \
96b72013cce3000cb46808aa9f9bce40 \
d3c9cf8e51c043bdb0db360ffaf34d8c \
f087bbcaffbb65906514448dc49f173e \
6580efb17017a4a9402a4a5043374bd7 \
1518c296a6125af5119aa5442d88bebf \
b190d917e60aeba3d9b7d1c61660ea68)
COUNT_1=$(( ${#SOURCES[@]} - 1 ))
function fetch_preprocess() {
local url=$1
local md5=$2
local opt_unpack=$3
local tar=$(echo $url | rev | cut -f1 -d/ | rev)
local dir=$(echo $tar | rev | cut -f3- -d. | rev)
(
cd $BUILDDIR
echo "$md5 $tar" > $tar.md5
test -e $tar || wget $url
md5sum -c $tar.md5
test -n 'XWIPE' && rm -rf ./$dir
if test -n "$opt_unpack"; then
test -d $dir || tar xf $tar
fi
)
}
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp
test -d $BUILD_TMPDIR && rm -rf $BUILD_TMPDIR
mkdir -p $BUILD_TMPDIR/home
export TMPDIR=$BUILD_TMPDIR
export HOME=$BUILD_TMPDIR/home
mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH
EOF
source $PREFIX/profile
BOOT_JAVA=$GCJ/lib/jvm
source $GCJ/profile
BUILDDIR=$PREFIX/build
mkdir -p $BUILDDIR
cd $BUILDDIR
fetch_preprocess ${SOURCES[0]} ${MD5SUMS[0]} 'yes'
for X in $(seq 1 $COUNT_1); do
fetch_preprocess ${SOURCES[$X]} ${MD5SUMS[$X]}
done
# recent cacerts taken from CentOS package, so Red Hat is at least of some use ...
(
CACERTS_URL=http://mirror.centos.org/centos/6/os/x86_64/Packages
RPM=ca-certificates-2018.2.22-65.1.el6.noarch.rpm
mkdir -p $BUILDDIR/tmp-certificates
cd $BUILDDIR/tmp-certificates
test -e $RPM || wget $CACERTS_URL/$RPM
test -d ./etc || rpm2cpio $RPM | cpio -imVd
cp etc/pki/java/cacerts $BUILDDIR
)
mkdir -p icedtea-build
cd icedtea-build
JAVA_HOME=${BOOT_JAVA} PATH=${BOOT_JAVA}/bin:$PATH \
../$ICEDTEA/configure \
--with-jdk-home=${BOOT_JAVA} \
--without-rhino \
--disable-system-kerberos \
--disable-system-pcsc \
--disable-system-sctp \
--with-cacerts-file="$BUILDDIR/cacerts" \
--with-openjdk-src-zip="$BUILDDIR/openjdk.tar.bz2" \
--with-corba-src-zip="$BUILDDIR/corba.tar.bz2" \
--with-jaxp-src-zip="$BUILDDIR/jaxp.tar.bz2" \
--with-jaxws-src-zip="$BUILDDIR/jaxws.tar.bz2" \
--with-jdk-src-zip="$BUILDDIR/jdk.tar.bz2" \
--with-langtools-src-zip="$BUILDDIR/langtools.tar.bz2" \
--with-hotspot-src-zip="$BUILDDIR/hotspot.tar.bz2" \
--disable-docs \
--with-parallel-jobs=$PARALLELJOBS \
--disable-downloading
# ALT_UNIXCOMMAND_PATH is needed, otherwise make fails due to 'missing' /bin/touch & /bin/cpio
# ... make/common/shared/Defs-linux.gmk
# UNIXCOMMAND_PATH: path to where the most common Unix commands are.
# NOTE: Must end with / so that it could be empty, allowing PATH usage.
#
# From time to time the build fails (1 outof 5), if so, start over.
ALT_UNIXCOMMAND_PATH=/usr/bin/ JAVA_HOME=${BOOT_JAVA} PATH=${BOOT_JAVA}/bin:$PATH LOG=trace \
make
# install
cp -a $BUILDDIR/icedtea-build/openjdk.build/j2sdk-image/* $PREFIX
# exit 1 # inhibit closing
exit