summaryrefslogtreecommitdiffstats
path: root/main/openjdk6/APKBUILD
blob: 7774a07cd31f4a6dc106ea88342b78fbe3e2282e (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
250
251
252
253
254
255
256
257
258
# Contributor: Timo Teras <timo.teras@iki.fi>
# Maintainer: Timo Teras <timo.teras@iki.fi>
pkgname=openjdk6
pkgver=1.6.0_p24
icedteaver=1.11.11
pkgrel=7
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"

somask="libjvm.so"

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-uclibc.patch
	icedtea6-1.9.7-generate_cacerts-1.patch
	icedtea-jdk-no-soname.patch
	icedtea-jdk-early-paxctl.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

        for patch in $source; do
                case $patch in
		icedtea-*.patch)
			case $patch in
			*uclibc*)
				if [ "$ALPINE_LIBC" != "eglibc" ]; then
					cp ../$patch patches
					_dpatches="$_dpatches patches/$patch"
				fi
			;;
			*)
				cp ../$patch patches
				 _dpatches="$_dpatches patches/$patch"
			;;
			esac
			;;
                *.patch)
                        msg "Applying patch $patch"
                        patch -p1 -i "$srcdir"/$patch || return 1
                        ;;
                esac
        done
	export DISTRIBUTION_PATCHES="$_dpatches"
}

build() {
	export JAVA_HOME=$BOOTSTRAP_JAVA_HOME
	export PATH=$JAVA_HOME/bin:$srcdir/apache-ant-$ANT_VER/bin:$PATH
	
	if [ -z "$JOBS" ]; then
		JOBS=`echo $MAKEFLAGS | sed -n -e 's/.*-j\([0-9]\+\).*/\1/p'`
	fi
	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
	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/$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
fd9749b16f88c4f67920d2ffc0964a83  icedtea6-1.11.11.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
f8a7c115a478ba784353606b8607a34d  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-uclibc.patch
0bc0131c87fcc0d1046e3ba20d205c73  icedtea6-1.9.7-generate_cacerts-1.patch
d014431e70cdabb82a75e4b9ae4c28a9  icedtea-jdk-no-soname.patch
7eda2c7837b14793076e7675c756be0c  icedtea-jdk-early-paxctl.patch"
sha256sums="f84e7f0938f4939660ff8f9c2aa164d301faa8a519f2324ceb05ad34b2e09227  openjdk-6-src-b24-14_nov_2011.tar.gz
6db6124645686ab5e91d2952d8b601bc0789b8fd5f1af86e46a5242ec60dc8e6  icedtea6-1.11.11.tar.gz
664f48cfc9c4a9a832ec1dd9d2bed5229c0a9561e489dcb88841d75d3c2c7cf9  apache-ant-1.8.2-bin.tar.gz
885b46e24fe5af23ad3712c5e08e8d97d6d92a4b89e1be860e8fe88e4a3dacd1  rhino1_7R3.zip
229040544e791f44906e8e7b6f6faf503c730a5d854275135f3925490d5c3be3  jdk6-jaxws2_1_6-2011_06_13.zip
c1a5348e17b330a7e4b18431e61a40efd2ba99a7da71102cf2c604478ef96012  jaxp144_03.zip
78c7b5c9d6271e88ee46abadd018a61f1e9645f8936cc8df1617e5f4f5074012  jdk6-jaf-b20.zip
b7d6bab5394cd0023b6737aeb0ff90569058d151185916ac2f80f5266c468312  build-paxctl.patch
f4b06c01b664922a6d7785d90bb888fe4665ae9ed6ae76c5484314821fd2cc2d  icedtea-hotspot-uclibc-fixes.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
13876be6f6ec792894d51b20f261b76db878d330eec7d4a2dcb17f0f1909a7e6  icedtea-jdk-early-paxctl.patch"
sha512sums="a965efa2fbe95a32988f78f1e51c42321ff42c1e631d5062aff204ba42839d6e05455f1ae039540e38ec947b50a635984cd3302eb09e81962575510309374e05  openjdk-6-src-b24-14_nov_2011.tar.gz
30afa752889f43dcf81b89e0e8c810894675f91ddae50cf38a034b53b5bd33be327bbf5eb21ece8ab0aafd088204827500fd5f160eb23d8d64857b38089a7891  icedtea6-1.11.11.tar.gz
869ab792b95c98ee62d748ffc991d78138482c8e2191f0a07c4d6629ad983768b40bef6f2d1370f6c0ab007c1de73f440293c1101eaf1fd82cf40de140c4b020  apache-ant-1.8.2-bin.tar.gz
77964485481e22d20459ea094c773e1930c5ef22d69bc449375a1ead31f340b3a652e2dd85c645e210be1abc8e623aeb560a5dc81629f388322af270ce868d36  rhino1_7R3.zip
643266da495f239aca1a08ba85af337e5ab50e5b859bffbccab64cf1c4099cae641d9741a20ca59c599c1285266a79489dec190d7fb15daa88c82b69ce97dbd6  jdk6-jaxws2_1_6-2011_06_13.zip
fe65d396d0a57bc2b5dd2d8b00b0ecea860d4e5a5c9cb489bc5b9d7abd90861dedd26088184de93807646277c23d3712e8af79e56251f079ef22ed5a3b8f9a90  jaxp144_03.zip
22fef9e0fdde82f141151d426d26316d7c23fd4cc2132ef191f38ea9420ebb3126670b0456ab4de83896307eab48bab0c46aaf0485f39e89cb57dac3215d499a  jdk6-jaf-b20.zip
41bfdb08e74cbcc70eac9e6721d886d8e35cd77c19988bd812fa16f71819efa2e8101d8a41a9ae62094069282739a835209a66c8dea6e259a86aee8368c60643  build-paxctl.patch
dc5a72ef92cd31e9ba4870ad2126f619932bae5918b6f6ad22af59dbc3e77a70fc27ba37909df0612f70922dfec6a58464469a18ed7a77d902c4a5038e086900  icedtea-hotspot-uclibc-fixes.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
866d4faf58a4892c113e779e59da590065c6a7f15f9262da82c356305a66ed5e14f4ba63865185b3e52656f8b4622ac243a54f939bc63ac9757dd09d312f622f  icedtea-jdk-early-paxctl.patch"