summaryrefslogtreecommitdiff
path: root/user/openjdk8/maintain
blob: bd0f695339c4e9d6df2d481ec1af6013227cdc3e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh

##
# This script downloads RC2 'openjdk8' .apk files,
# extracts some JVM bits, and produces tarballs for
# bootstrapping this package, suitable for upload to
# https://distfiles.adelielinux.org/source/openjdk/.
#
# Note: checksums may vary between 'tar' versions or
# implementations; please do not rely on this. The
# output has been verified by 'diff -qr', may differ
# in packing order, compression, or headers only.
#
# Based on https://git.adelielinux.org/-/snippets/172.
#
HERE="$(dirname $(readlink -f ${0}))";

host=https://distfiles.adelielinux.org;
repo=1.0-rc2;
vers=8.252.09-r0;
keep=usr/lib/jvm/java-1.8-openjdk;
arch="aarch64 armv7 ppc64 ppc x86_64 pmmx";
apks="
openjdk8-jre-lib
openjdk8-jre-base
openjdk8-jre
openjdk8
";


for cpu in $arch; do
    printf "\n%s\n" "$cpu";
    rm -fr "${HERE}"/$cpu; # sanity
    mkdir -p "${HERE}"/$cpu/boot-home;
    for apk in $apks; do
        printf "  * %s\n" "$apk-$vers.apk";
        curl -s $host/adelie/$repo/user/$cpu/$apk-$vers.apk \
            | tar -C "${HERE}"/$cpu -xzf - 2>/dev/null;
    done
    cp -a "${HERE}"/$cpu/$keep "${HERE}"/$cpu/boot-home/$cpu;
    (
        cd "${HERE}"/$cpu;
        chown -R 1000:1000 boot-home;
        tar -cJf "${HERE}"/openjdk8-bootstrap-$cpu.txz boot-home;
    )
    rm -fr "${HERE}"/$cpu;
done