aboutsummaryrefslogtreecommitdiffstats
path: root/main/openjdk6/APKBUILD
blob: 3b5647a12463a200564b1da25d39ec4bf9cf9e18 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# Contributor: Timo Teras <timo.teras@iki.fi>
# Maintainer: Timo Teras <timo.teras@iki.fi>
pkgname=openjdk6
pkgver=1.6.0_p24
icedteaver=1.11.4
pkgrel=4
pkgdesc="Sun OpenJDK 6 via IcedTea"
url="http://icedtea.classpath.org/"
arch="x86 x86_64"
license="GPL-2 with Classpath"
depends="$pkgname-jre"
options="sover-namecheck"
makedepends="java-gcj-compat findutils tar zip paxctl gawk pkgconfig util-linux-ng
	     autoconf automake nss-dev cups-dev jpeg-dev giflib-dev libpng-dev libxt-dev
	     libxp-dev libxtst-dev libxinerama-dev libiconv-dev
	     libxrender-dev alsa-lib-dev freetype-dev xulrunner-dev
	     gtk+2.0-dev ca-certificates libxslt zip"
install=""

case $CARCH in
x86)	_arch=i386;;
x86_64)	_arch=amd64;;
esac

_jrelib="/usr/lib/jvm/java-1.6-openjdk/jre/lib/$_arch"
# exclude xawt from ldpath to avoid duplicate provides for libmawt.so (also in
# headless).
# infuture this should be a virtual provides
ldpath="$_jrelib:$_jrelib/native_threads:$_jrelib/headless:$_jrelib/server:$_jrelib/jli"

subpackages="$pkgname-jre-lib:jrelib $pkgname-jre $pkgname-jre-base:jrebase
	     $pkgname-doc:doc"
BOOTSTRAP_JAVA_HOME=/usr/lib/jvm/java-1.5-gcj/
OPENJDK_VERSION=b24
OPENJDK_DATE=14_nov_2011
RHINO_VER=1_7R3
ANT_VER=1.8.2
JAXWS_DROP_ZIP=jdk6-jaxws2_1_6-2011_06_13.zip
JAXP_DROP_ZIP=jaxp144_03.zip
JAF_DROP_ZIP=jdk6-jaf-b20.zip
source="http://download.java.net/openjdk/jdk6/promoted/$OPENJDK_VERSION/openjdk-6-src-$OPENJDK_VERSION-$OPENJDK_DATE.tar.gz
	http://icedtea.classpath.org/download/source/icedtea6-$icedteaver.tar.gz
	http://archive.apache.org/dist/ant/binaries/apache-ant-$ANT_VER-bin.tar.gz
	ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino$RHINO_VER.zip
	http://icedtea.classpath.org/download/drops/$JAXWS_DROP_ZIP
	http://icedtea.classpath.org/download/drops/$JAXP_DROP_ZIP
	http://icedtea.classpath.org/download/drops/$JAF_DROP_ZIP
	build-paxctl.patch
	icedtea-hotspot-uclibc-fixes.patch
	icedtea-jdk-iconv-uclibc.patch
	icedtea-jdk-execinfo.patch
	icedtea-jdk-no-lib-nsl.patch
	icedtea6-1.9.7-generate_cacerts-1.patch
	icedtea-jdk-no-soname.patch
	"

_builddir="$srcdir/icedtea6-$icedteaver"
INSTALL_BASE=/usr/lib/jvm/java-1.6-openjdk
CPU=`uname -m | sed -e 's/i.86/i386/g' -e 's/x86_64/amd64/g'`

unpack() {
	if [ -z "$force" ]; then
		md5check || return 1
		initdcheck || return 1
	fi
	mkdir -p "$srcdir"
	msg "Unpacking sources..."
	tar -C "$srcdir" -zxf icedtea6-$icedteaver.tar.gz || return 1
	tar -C "$srcdir" -zxf apache-ant-$ANT_VER-bin.tar.gz || return 1
	unzip -o -q "rhino$RHINO_VER.zip" -d "$srcdir" || return 1
}

prepare() {
	cd "$_builddir"

	# Busybox sha256 does not support longopts
	sed -e "s/--check/-c/g" -i Makefile.am
	# gcj is broke after strict linking
	sed -e "s/-o native-ecj/-o native-ecj -lgcj/g" -i Makefile.am

	cp ../icedtea-*.patch patches
	patch -p0 < ../build-paxctl.patch
	patch -p1 < ../icedtea6-1.9.7-generate_cacerts-1.patch
}

build() {
	export JAVA_HOME=$BOOTSTRAP_JAVA_HOME
	export PATH=$JAVA_HOME/bin:$srcdir/apache-ant-$ANT_VER/bin:$PATH
	export DISTRIBUTION_PATCHES=`echo $source | awk -v RS=' ' '/icedtea-[^ ]*\.patch/ { printf "patches/%s ",$1 }'`
	
	JOBS=`echo $MAKEFLAGS | sed -n -e 's/.*-j\([0-9]\+\).*/\1/p'`
	if [ "$JOBS" ]; then
		confjobs="--with-parallel-jobs=$JOBS"
	else
		confjobs=""
	fi

	cd "$_builddir"
	sh autogen.sh
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-dependency-tracking \
		--enable-cacerts \
		--with-ca-dir=/etc/ssl/certs \
		--with-gcj $confjobs \
		--with-openjdk-src-zip=$srcdir/openjdk-6-src-$OPENJDK_VERSION-$OPENJDK_DATE.tar.gz \
		--with-jaxp-drop-zip=$srcdir/$JAXP_DROP_ZIP \
		--with-jaf-drop-zip=$srcdir/$JAF_DROP_ZIP \
		--with-jaxws-drop-zip=$srcdir/$JAXWS_DROP_ZIP \
		--with-jdk-home=$BOOTSTRAP_JAVA_HOME \
		--with-ant-home=$srcdir/apache-ant-$ANT_VER \
		--with-rhino=$srcdir/rhino$RHINO_VER/js.jar \
		--with-pkgversion="Alpine ${pkgver}-r${pkgrel}" \
		  || return 1

	make || return 1
}

package() {
	mkdir -p "$pkgdir"/$INSTALL_BASE
	cp -a "$_builddir"/openjdk.build/j2sdk-image/* "$pkgdir"/$INSTALL_BASE
	rm "$pkgdir"/$INSTALL_BASE/src.zip
}

jrelib() {
	pkgdesc="OpenJDK 6 Java Runtime (class libraries)"
	arch="noarch"
	depends=""

	for A in jre/lib/zi jre/lib/images jre/lib/*.jar jre/lib/security \
		 jre/lib/ext/*.jar jre/lib/cmm jre/ASSEMBLY_EXCEPTION \
		 jre/THIRD_PARTY_README jre/LICENSE ; do
		dirname=${A%/*}
		mkdir -p "$subpkgdir"/$INSTALL_BASE/$dirname
		mv "$pkgdir"/$INSTALL_BASE/$A "$subpkgdir"/$INSTALL_BASE/$dirname
	done
}

jrebase() {
	pkgdesc="OpenJDK 6 Java Runtime (no GUI support)"
	depends="$pkgname-jre-lib java-common"

	mkdir -p "$subpkgdir"/$INSTALL_BASE/bin

	for A in java orbd rmid servertool unpack200 keytool \
		 pack200 rmiregistry tnameserv ; do
		mv "$pkgdir"/$INSTALL_BASE/bin/$A "$subpkgdir"/$INSTALL_BASE/bin
	done

	# rest of the jre subdir (which were not taken by -jre subpkg)
	mv "$pkgdir"/$INSTALL_BASE/jre "$subpkgdir"/$INSTALL_BASE

	# all java stuff seems to need mprotect and randomization off
	# or otherwise the vm fails to allocate enough memory
	paxctl -c -mr \
		"$subpkgdir"/$INSTALL_BASE/bin/* \
		"$subpkgdir"/$INSTALL_BASE/jre/bin/*
}

jre() {
	pkgdesc="OpenJDK 6 Java Runtime"
	depends=""

	mkdir -p "$subpkgdir"
	for A in jre/bin/policytool \
		 bin/appletviewer \
		 bin/policytool \
		 jre/lib/$CPU/xawt \
		 jre/lib/$CPU/libsplashscreen.so ; do
		dirname=${A%/*}
		mkdir -p "$subpkgdir"/$INSTALL_BASE/$dirname
		mv "$pkgdir"/$INSTALL_BASE/$A "$subpkgdir"/$INSTALL_BASE/$dirname
	done
}

doc() {
	default_doc

	mkdir -p "$subpkgdir"/$INSTALL_BASE/
	mv "$pkgdir"/$INSTALL_BASE/man "$subpkgdir"/$INSTALL_BASE/
}

md5sums="0eabdd360169144336e50081b8d01001  openjdk-6-src-b24-14_nov_2011.tar.gz
a5a3a5aeaba0ddf4c9fdf8e899bf77c2  icedtea6-1.11.4.tar.gz
afb0c7950a663f94e65da9f3be676d8f  apache-ant-1.8.2-bin.tar.gz
99d94103662a8d0b571e247a77432ac5  rhino1_7R3.zip
8fd91b09b643a19a912b8a75e7a7a9d5  jdk6-jaxws2_1_6-2011_06_13.zip
9eea471ad474040265c688858fcf09aa  jaxp144_03.zip
bc95c133620bd68c161cac9891592901  jdk6-jaf-b20.zip
3ed492a33c1439ead4ada0462dd621ca  build-paxctl.patch
dc6a1e28a97d897d7a1057c11696727d  icedtea-hotspot-uclibc-fixes.patch
7c0814181e5adc0763c5c0a24b01d4cb  icedtea-jdk-iconv-uclibc.patch
dae2ba8b87e2106b53974ace07e4ca72  icedtea-jdk-execinfo.patch
c4bb40d5b1ff690b27900c5cd06bc1e5  icedtea-jdk-no-lib-nsl.patch
0bc0131c87fcc0d1046e3ba20d205c73  icedtea6-1.9.7-generate_cacerts-1.patch
d014431e70cdabb82a75e4b9ae4c28a9  icedtea-jdk-no-soname.patch"