aboutsummaryrefslogtreecommitdiffstats
path: root/main/openjdk6/APKBUILD
blob: e1c7c6a3785e4811624767f511601c12300b355d (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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# Contributor: Timo Teras <timo.teras@iki.fi>
# Maintainer: Timo Teras <timo.teras@iki.fi>
pkgname=openjdk6
_icedteaver=1.12.7
_openjdkbuild=27
pkgver=6.$_openjdkbuild.$_icedteaver
pkgrel=0
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="findutils tar zip paxctl gawk pkgconfig util-linux
	     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=""

INSTALL_BASE=/usr/lib/jvm/java-1.6-openjdk

if [ "$BOOTSTRAP" != "no" ]; then
	makedepends="$makedepends java-gcj-compat"
	BOOTSTRAP_JAVA_HOME="/usr/lib/jvm/java-1.5-gcj/"
else
	makedepends="$makedepends $pkgname"
	BOOTSTRAP_JAVA_HOME="$INSTALL_BASE"
fi

OPENJDK_VERSION=b$_openjdkbuild
OPENJDK_DATE=26_oct_2012
RHINO_VER=1_7R3
ANT_VER=1.9.2

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

# exclude xawt from ldpath to avoid duplicate provides for libmawt.so (also in
# headless).
# infuture this should be a virtual provides
_jrelib="$INSTALL_BASE/jre/lib/$_jarch"
ldpath="$_jrelib:$_jrelib/native_threads:$_jrelib/headless:$_jrelib/server:$_jrelib/jli"
somask="libjvm.so"

subpackages="$pkgname-jre-lib:jrelib $pkgname-jre $pkgname-jre-base:jrebase
	     $pkgname-doc:doc"
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
	icedtea-hotspot-uclibc-fixes.patch
	icedtea-jdk-fix-ipv6-init.patch
	icedtea-jdk-iconv-uclibc.patch
	icedtea-jdk-execinfo.patch
	icedtea-jdk-no-lib-nsl-uclibc.patch
	icedtea6-1.9.7-generate_cacerts-1.patch
	icedtea-jdk-no-soname.patch
	fix-with-pax.patch
	"

_builddir="$srcdir/icedtea6-$_icedteaver"

unpack() {
	if [ -z "$force" ]; then
		verify || 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

        for patch in $source; do
                case $patch in
		icedtea-*.patch)
			cp ../$patch patches
			;;
                *.patch)
                        msg "Applying patch $patch"
                        patch -p1 -i "$srcdir"/$patch || return 1
                        ;;
                esac
        done
}

build() {
	[ -z "$JOBS" ] && export JOBS=`echo $MAKEFLAGS | sed -n -e 's/.*-j\([0-9]\+\).*/\1/p'`
	export JAVA_HOME=$BOOTSTRAP_JAVA_HOME
	export PATH=$JAVA_HOME/bin:$srcdir/apache-ant-$ANT_VER/bin:$PATH
	export DISTRIBUTION_PATCHES=""

	local patch
	for patch in $source; do
		case $patch in
		icedtea-*.patch)
			export DISTRIBUTION_PATCHES="$DISTRIBUTION_PATCHES patches/$patch"
			;;
		esac
	done
	echo "icedtea patches: $DISTRIBUTION_PATCHES"

	local _bootstrap=""
	[ "$BOOTSTRAP" = "no" ] && _bootstrap="--disable-bootstrap"

	cd "$_builddir"
	sh autogen.sh
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-dependency-tracking \
		--disable-downloading \
		--with-parallel-jobs=${JOBS:-2} \
		--enable-cacerts \
		--with-ca-dir=/etc/ssl/certs \
		--with-jdk-home=$BOOTSTRAP_JAVA_HOME \
		--with-pax=paxctl \
		$_bootstrap \
		--with-openjdk-src-zip=$srcdir/openjdk-6-src-$OPENJDK_VERSION-$OPENJDK_DATE.tar.gz \
		--with-ant-home=$srcdir/apache-ant-$ANT_VER \
		--with-rhino=$srcdir/rhino$RHINO_VER/js.jar \
		--with-pkgversion="Alpine ${pkgver}-r${pkgrel}" \
		--with-abs-install-dir="$INSTALL_BASE" \
		|| 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
	scanelf --nobanner "$pkgdir"/$INSTALL_BASE/bin/* | awk '{print $2}' \
		| xargs paxctl -c -mr
}

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"
	# manually provide this to avoid clash with libgcj's libjvm.so
	provides="so:openjdk6:libjvm.so=0"

	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"
	# manually depend to avoid clash with libgcj's libjvm.so
	depends="so:openjdk6:libjvm.so=0"

	mkdir -p "$subpkgdir"
	for A in jre/bin/policytool \
		 bin/appletviewer \
		 bin/policytool \
		 jre/lib/$_jarch/xawt \
		 jre/lib/$_jarch/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="3a0963158e07c8829c8bd31a698bd23d  openjdk-6-src-b27-26_oct_2012.tar.gz
ec481c5680cc63ac43f762eba4a15842  icedtea6-1.12.7.tar.gz
9a2826a1819aa128629778217af36c55  apache-ant-1.9.2-bin.tar.gz
99d94103662a8d0b571e247a77432ac5  rhino1_7R3.zip
dc6a1e28a97d897d7a1057c11696727d  icedtea-hotspot-uclibc-fixes.patch
250b0807b59762670954b132e8f8dfba  icedtea-jdk-fix-ipv6-init.patch
7c0814181e5adc0763c5c0a24b01d4cb  icedtea-jdk-iconv-uclibc.patch
dae2ba8b87e2106b53974ace07e4ca72  icedtea-jdk-execinfo.patch
c4bb40d5b1ff690b27900c5cd06bc1e5  icedtea-jdk-no-lib-nsl-uclibc.patch
0bc0131c87fcc0d1046e3ba20d205c73  icedtea6-1.9.7-generate_cacerts-1.patch
d014431e70cdabb82a75e4b9ae4c28a9  icedtea-jdk-no-soname.patch
d2999b5b67afe485554d14ecd1aa6046  fix-with-pax.patch"
sha256sums="044c3877b15940ff04f8aa817337f2878a00cc89674854557f1a02f15b1802a0  openjdk-6-src-b27-26_oct_2012.tar.gz
081b288b3141f5ec87c77ea47fc541825fd02e9e03fcbb30bbe70b007f2a648e  icedtea6-1.12.7.tar.gz
cab1b8754e5f1f2aa869e2ba603903ae5e81a585de4eafd00f173531a11b5a45  apache-ant-1.9.2-bin.tar.gz
885b46e24fe5af23ad3712c5e08e8d97d6d92a4b89e1be860e8fe88e4a3dacd1  rhino1_7R3.zip
f4b06c01b664922a6d7785d90bb888fe4665ae9ed6ae76c5484314821fd2cc2d  icedtea-hotspot-uclibc-fixes.patch
632683ec88a6fb250ef043aae9cace605d0c669b7058f8c47b62b09b03ecc6c5  icedtea-jdk-fix-ipv6-init.patch
a36ff13d81a1f1415bedd595b77f2c43574c546938cce7882cb33bbe63464865  icedtea-jdk-iconv-uclibc.patch
024a22622da408aa9db5b258e3eed49500292483c923f62b19aa6db0a3fed7b7  icedtea-jdk-execinfo.patch
6bba2870af0c5eac7b6edb7351e8e1833db401b1bf6b4861a14dcb1fd45cbea6  icedtea-jdk-no-lib-nsl-uclibc.patch
f83dea0ee1d11deceb45d643cf0cce84099775de88b972e3ea979a8529bf4c85  icedtea6-1.9.7-generate_cacerts-1.patch
6c0bbe710395c4ced1359ab279be6a7c36da5bfb9fd60dc47d920f06a0456d82  icedtea-jdk-no-soname.patch
b6aab36220a1318f344573041c28885cfa5ab6e21f393995f47c19db9f09917c  fix-with-pax.patch"
sha512sums="4198f11b2f49c9bc5ffbeadf2d0d87dfa413a918d49faff3a043266bf4a2fa99579fba3c6d75164d87e88b8fc5c97c3c1527560eb25c55cdd42ad813c8e175e8  openjdk-6-src-b27-26_oct_2012.tar.gz
52f79762a0c44bf969d9c21d25b55aba81a55f60eb4e56cd78b33100447b8b6a7af5446653deab8db33a5cfb8ef4239d1c81bda1fdb9c978b6db6daf0be02b79  icedtea6-1.12.7.tar.gz
618c0c3d80f7c44c2bb8cdfdc2b5278ccd926ab1aa0c8f7099bd0ad5cb4c090f023c0b86c8267052a0a6b1ac57076296fcc16042b9e7a72a1482af63c99e0e49  apache-ant-1.9.2-bin.tar.gz
77964485481e22d20459ea094c773e1930c5ef22d69bc449375a1ead31f340b3a652e2dd85c645e210be1abc8e623aeb560a5dc81629f388322af270ce868d36  rhino1_7R3.zip
dc5a72ef92cd31e9ba4870ad2126f619932bae5918b6f6ad22af59dbc3e77a70fc27ba37909df0612f70922dfec6a58464469a18ed7a77d902c4a5038e086900  icedtea-hotspot-uclibc-fixes.patch
48533f87fc2cf29d26b259be0df51087d2fe5b252e72d00c6ea2f4add7b0fb113141718c116279c5905e03f64a1118082e719393786811367cf4d472b5d36774  icedtea-jdk-fix-ipv6-init.patch
a6ee1c63a171859ab1350481bc3e5d464354f1105d80fc72c1d58620672ca5c1a550b954b35917f89537f0aeb28c49470b27522ce53588e42dedff41e074774c  icedtea-jdk-iconv-uclibc.patch
dd8d7edad8309d41881d92d173b7b86e37d833bdb9be0ae9dbc39844b226b77f0e2dc2a137a50738c7642df32964b92c6ee74d0a6207aa3f4f7abaeb40ea3435  icedtea-jdk-execinfo.patch
833ec90fa9d3d26191303201012e4b8ca220d634497277f7e8c703ca03753720343e22c97dd2f10cd3e3be79c84f95b8c7d0db21545b8a35761c0de7cb834e7a  icedtea-jdk-no-lib-nsl-uclibc.patch
5fbf3571abd6e0eece8fecd45365996ff83368d674782da3435681afdd6cbb51c6da7e8e4d9ca3ba767a1d373a01d0a4109d1c9bf9b93109a34accaee134a8ab  icedtea6-1.9.7-generate_cacerts-1.patch
bf4b184e170f7b0ff64ab30d2162784fe2bd5460d1fa31973259f7065fd4c511c46f97724fe2bd72bb94e9006cb568d0e0c87d1a9c90819e65880f8f44830bb1  icedtea-jdk-no-soname.patch
7f8ce4b35856ec8c023bdca682773bebeebe9c11652259b968efad370be24885c22bf7bdd687c6665385ca89f75a7df38429e5a7ea4828cdd8be49fce3f8878c  fix-with-pax.patch"