Browse code

openjdk8: aarch64 support

Added new spec file openjdk8_aarch.spec for that.
Upstream sources do not support aarch64 so I used sources from
http://hg.openjdk.java.net/aarch64-port/jdk8u/ repo.
This repo goes slightly behind of upstream. So the current version (for
aarch64) is 1.8.0.151 but upstream (for x86_64) is 1.8.0.152.

Extra changes:
package builder: add macro expansion inside of %define macro
openjdk8 for x86_64:
- replace some publishrpms with local equivalent.
- instead of applying remove-cups.patch just remove cups file

Change-Id: I867e6f4d340939710baf4086bb0ccb2b44e13cb6
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4565
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>
Reviewed-by: Srivatsa S. Bhat <srivatsab@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>

Alexey Makhalov authored on 2017/12/23 04:31:19
Showing 7 changed files
... ...
@@ -3,7 +3,7 @@
3 3
 Summary:	OpenJDK
4 4
 Name:		openjdk8
5 5
 Version:	1.8.0.152
6
-Release:	1%{?dist}
6
+Release:	2%{?dist}
7 7
 License:	GNU GPL
8 8
 URL:		https://openjdk.java.net
9 9
 Group:		Development/Tools
... ...
@@ -13,7 +13,6 @@ Source0:	http://www.java.net/download/openjdk/jdk8/promoted/b131/openjdk-%{versi
13 13
 %define sha1 openjdk=bdb67157673789aa2ad368c9e237be7215097fdd
14 14
 Patch0:		Awt_build_headless_only.patch
15 15
 Patch1:		check-system-ca-certs.patch
16
-Patch2:         remove-cups.patch
17 16
 BuildRequires:  pcre-devel
18 17
 BuildRequires:	which
19 18
 BuildRequires:	zip
... ...
@@ -21,6 +20,7 @@ BuildRequires:	unzip
21 21
 BuildRequires:  zlib-devel
22 22
 BuildRequires:	ca-certificates
23 23
 BuildRequires:	chkconfig
24
+BuildRequires:  fontconfig-devel freetype2-devel glib-devel harfbuzz-devel
24 25
 Requires:       openjre8 = %{version}-%{release}
25 26
 Requires:       chkconfig
26 27
 Obsoletes:      openjdk <= %{version}
... ...
@@ -67,7 +67,7 @@ This package provides the runtime library class sources.
67 67
 %setup -qn openjdk-%{version}
68 68
 %patch0 -p1
69 69
 %patch1 -p1
70
-%patch2 -p1
70
+rm jdk/src/solaris/native/sun/awt/CUPSfuncs.c
71 71
 sed -i "s#\"ft2build.h\"#<ft2build.h>#g" jdk/src/share/native/sun/font/freetypeScaler.c
72 72
 sed -i '0,/BUILD_LIBMLIB_SRC/s/BUILD_LIBMLIB_SRC/BUILD_HEADLESS_ONLY := 1\nOPENJDK_TARGET_OS := linux\n&/' jdk/make/lib/Awt2dLibraries.gmk
73 73
 
... ...
@@ -237,6 +237,8 @@ rm -rf %{buildroot}/*
237 237
 %{_libdir}/jvm/OpenJDK-%{version}/src.zip
238 238
 
239 239
 %changelog
240
+*   Thu Dec 21 2017 Alexey Makhalov <amakhalov@vmware.com> 1.8.0.152-2
241
+-   Reduce list of published rpms dependencies
240 242
 *   Thu Oct 19 2017 Harish Udaiya Kumar <hudaiyakumar@vmware.com> 1.8.0.152-1
241 243
 -   Upgraded to version 1.8.0.152
242 244
 *   Thu Sep 14 2017 Harish Udaiya Kumar <hudaiyakumar@vmware.com> 1.8.0.141-2
243 245
new file mode 100644
... ...
@@ -0,0 +1,265 @@
0
+%define _use_internal_dependency_generator 0
1
+%global security_hardening none
2
+%define _jdk_update 151
3
+%define _jdk_build 13
4
+%define _repo_ver aarch64-jdk8u%{_jdk_update}-b%{_jdk_build}
5
+%define _url_src http://hg.openjdk.java.net/aarch64-port/jdk8u
6
+
7
+Summary:	OpenJDK
8
+Name:		openjdk8
9
+Version:	1.8.0.151
10
+Release:	1%{?dist}
11
+License:	GNU GPL
12
+URL:		http://hg.openjdk.java.net/aarch64-port/jdk8u/
13
+Group:		Development/Tools
14
+Vendor:		VMware, Inc.
15
+Distribution:   Photon
16
+Source0:	%{_url_src}/archive/jdk8u-%{_repo_ver}.tar.bz2
17
+%define sha1 jdk8u=d92f2f3633ca1f376dddc1d3c6d7ec53a54d7d63
18
+Source1:	%{_url_src}/corba/archive/corba-%{_repo_ver}.tar.bz2
19
+%define sha1 corba=a8cfcc8cd8817560059d7d121bb774334ae012b0
20
+Source2:	%{_url_src}/hotspot/archive/hotspot-%{_repo_ver}.tar.bz2
21
+%define sha1 hotspot=c9378ab34ee281e196206214ffe3174b2dfd2d80
22
+Source3:	%{_url_src}/jdk/archive/jdk-%{_repo_ver}.tar.bz2
23
+%define sha1 jdk-aarch64=5cc629011f0e6c2aa522e4ca6c8b602912431cbd
24
+Source4:	%{_url_src}/jaxws/archive/jaxws-%{_repo_ver}.tar.bz2
25
+%define sha1 jaxws=d3fd7bca75d6e8125c7968c9242129477d0fc0cb
26
+Source5:	%{_url_src}/jaxp/archive/jaxp-%{_repo_ver}.tar.bz2
27
+%define sha1 jaxp=229a83f8687bae8c1c51f2ea0010f3d2cf896072
28
+Source6:	%{_url_src}/langtools/archive/langtools-%{_repo_ver}.tar.bz2
29
+%define sha1 langtools=ec34f7adc4f66b687a33e1c8fbf0a4e44dafb0c1
30
+Source7:	%{_url_src}/nashorn/archive/nashorn-%{_repo_ver}.tar.bz2
31
+%define sha1 nashorn=aaf4d057bb3e5d8700f6b6d11d38fb9519c2ab29
32
+Patch0:		Awt_build_headless_only.patch
33
+Patch1:		check-system-ca-certs.patch
34
+BuildRequires:  pcre-devel
35
+BuildRequires:	which
36
+BuildRequires:	zip
37
+BuildRequires:	unzip
38
+BuildRequires:  zlib-devel
39
+BuildRequires:	ca-certificates
40
+BuildRequires:	chkconfig
41
+BuildRequires:  fontconfig-devel freetype2-devel glib-devel harfbuzz-devel
42
+Requires:       openjre8 = %{version}-%{release}
43
+Requires:       chkconfig
44
+Obsoletes:      openjdk <= %{version}
45
+AutoReqProv: 	no
46
+%define bootstrapjdk /usr/lib/jvm/OpenJDK-1.8.0.151
47
+%description
48
+The OpenJDK package installs java class library and javac java compiler.
49
+
50
+%package	-n openjre8
51
+Summary:	Java runtime environment
52
+AutoReqProv: 	no
53
+Obsoletes:      openjre <= %{version}
54
+Requires:       chkconfig
55
+Requires:	libstdc++
56
+%description	-n openjre8
57
+It contains the libraries files for Java runtime environment
58
+
59
+
60
+%package	sample
61
+Summary:	Sample java applications.
62
+Group:          Development/Languages/Java
63
+Obsoletes:      openjdk-sample <= %{version}
64
+Requires:       %{name} = %{version}-%{release}
65
+%description	sample
66
+It contains the Sample java applications.
67
+
68
+%package		doc
69
+Summary:		Documentation and demo applications for openjdk
70
+Group:          Development/Languages/Java
71
+Obsoletes:      openjdk-doc <= %{version}
72
+Requires:       %{name} = %{version}-%{release}
73
+%description	doc
74
+It contains the documentation and demo applications for openjdk
75
+
76
+%package 		src
77
+Summary:        OpenJDK Java classes for developers
78
+Group:          Development/Languages/Java
79
+Obsoletes:      openjdk-src <= %{version}
80
+Requires:       %{name} = %{version}-%{release}
81
+%description	src
82
+This package provides the runtime library class sources.
83
+
84
+%prep -p exit
85
+%setup -qn jdk8u-%{_repo_ver} -b1 -b2 -b3 -b4 -b5 -b6 -b7
86
+for subrepo in corba hotspot jdk jaxws jaxp langtools nashorn
87
+do
88
+    mv ../${subrepo}-%{_repo_ver} ${subrepo}
89
+done
90
+%patch0 -p1
91
+%patch1 -p1
92
+rm jdk/src/solaris/native/sun/awt/CUPSfuncs.c
93
+sed -i "s#\"ft2build.h\"#<ft2build.h>#g" jdk/src/share/native/sun/font/freetypeScaler.c
94
+sed -i '0,/BUILD_LIBMLIB_SRC/s/BUILD_LIBMLIB_SRC/BUILD_HEADLESS_ONLY := 1\nOPENJDK_TARGET_OS := linux\n&/' jdk/make/lib/Awt2dLibraries.gmk
95
+
96
+%build
97
+chmod a+x ./configure
98
+unset JAVA_HOME &&
99
+./configure \
100
+	CUPS_NOT_NEEDED=yes \
101
+	--with-target-bits=64 \
102
+	--with-boot-jdk=%{bootstrapjdk} \
103
+	--disable-headful \
104
+	--with-cacerts-file=%{bootstrapjdk}/jre/lib/security/cacerts \
105
+	--with-extra-cxxflags="-Wno-error -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse" \
106
+	--with-extra-cflags="-std=gnu++98 -fno-delete-null-pointer-checks -Wno-error -fno-lifetime-dse" \
107
+	--with-freetype-include=/usr/include/freetype2 \
108
+	--with-freetype-lib=/usr/lib \
109
+	--with-stdc++lib=dynamic
110
+
111
+make \
112
+    DEBUG_BINARIES=true \
113
+    BUILD_HEADLESS_ONLY=1 \
114
+    OPENJDK_TARGET_OS=linux \
115
+    JAVAC_FLAGS=-g \
116
+    STRIP_POLICY=no_strip \
117
+    DISABLE_HOTSPOT_OS_VERSION_CHECK=ok \
118
+    CLASSPATH=%{bootstrapjdk}/jre \
119
+    POST_STRIP_CMD="" \
120
+    LOG=trace \
121
+    SCTP_WERROR=
122
+
123
+%install
124
+make DESTDIR=%{buildroot} install \
125
+	BUILD_HEADLESS_ONLY=yes \
126
+	OPENJDK_TARGET_OS=linux \
127
+	DISABLE_HOTSPOT_OS_VERSION_CHECK=ok \
128
+	CLASSPATH=%{bootstrapjdk}/jre
129
+
130
+install -vdm755 %{buildroot}%{_libdir}/jvm/OpenJDK-%{version}
131
+chown -R root:root %{buildroot}%{_libdir}/jvm/OpenJDK-%{version}
132
+install -vdm755 %{buildroot}%{_bindir}
133
+find /usr/local/jvm/openjdk-1.8.0-internal/jre/lib/aarch64 -iname \*.diz -delete
134
+mv /usr/local/jvm/openjdk-1.8.0-internal/* %{buildroot}%{_libdir}/jvm/OpenJDK-%{version}/
135
+
136
+%post
137
+alternatives --install %{_bindir}/javac javac %{_libdir}/jvm/OpenJDK-%{version}/bin/javac 2000 \
138
+  --slave %{_bindir}/appletviewer appletviewer %{_libdir}/jvm/OpenJDK-%{version}/bin/appletviewer \
139
+  --slave %{_bindir}/extcheck extcheck %{_libdir}/jvm/OpenJDK-%{version}/bin/extcheck \
140
+  --slave %{_bindir}/idlj idlj %{_libdir}/jvm/OpenJDK-%{version}/bin/idlj \
141
+  --slave %{_bindir}/jar jar %{_libdir}/jvm/OpenJDK-%{version}/bin/jar \
142
+  --slave %{_bindir}/jarsigner jarsigner %{_libdir}/jvm/OpenJDK-%{version}/bin/jarsigner \
143
+  --slave %{_bindir}/javadoc javadoc %{_libdir}/jvm/OpenJDK-%{version}/bin/javadoc \
144
+  --slave %{_bindir}/javah javah %{_libdir}/jvm/OpenJDK-%{version}/bin/javah \
145
+  --slave %{_bindir}/javap javap %{_libdir}/jvm/OpenJDK-%{version}/bin/javap \
146
+  --slave %{_bindir}/jcmd jcmd %{_libdir}/jvm/OpenJDK-%{version}/bin/jcmd \
147
+  --slave %{_bindir}/jconsole jconsole %{_libdir}/jvm/OpenJDK-%{version}/bin/jconsole \
148
+  --slave %{_bindir}/jdb jdb %{_libdir}/jvm/OpenJDK-%{version}/bin/jdb \
149
+  --slave %{_bindir}/jdeps jdeps %{_libdir}/jvm/OpenJDK-%{version}/bin/jdeps \
150
+  --slave %{_bindir}/jhat jhat %{_libdir}/jvm/OpenJDK-%{version}/bin/jhat \
151
+  --slave %{_bindir}/jinfo jinfo %{_libdir}/jvm/OpenJDK-%{version}/bin/jinfo \
152
+  --slave %{_bindir}/jmap jmap %{_libdir}/jvm/OpenJDK-%{version}/bin/jmap \
153
+  --slave %{_bindir}/jps jps %{_libdir}/jvm/OpenJDK-%{version}/bin/jps \
154
+  --slave %{_bindir}/jrunscript jrunscript %{_libdir}/jvm/OpenJDK-%{version}/bin/jrunscript \
155
+  --slave %{_bindir}/jsadebugd jsadebugd %{_libdir}/jvm/OpenJDK-%{version}/bin/jsadebugd \
156
+  --slave %{_bindir}/jstack jstack %{_libdir}/jvm/OpenJDK-%{version}/bin/jstack \
157
+  --slave %{_bindir}/jstat jstat %{_libdir}/jvm/OpenJDK-%{version}/bin/jstat \
158
+  --slave %{_bindir}/jstatd jstatd %{_libdir}/jvm/OpenJDK-%{version}/bin/jstatd \
159
+  --slave %{_bindir}/native2ascii native2ascii %{_libdir}/jvm/OpenJDK-%{version}/bin/native2ascii \
160
+  --slave %{_bindir}/rmic rmic %{_libdir}/jvm/OpenJDK-%{version}/bin/rmic \
161
+  --slave %{_bindir}/schemagen schemagen %{_libdir}/jvm/OpenJDK-%{version}/bin/schemagen \
162
+  --slave %{_bindir}/serialver serialver %{_libdir}/jvm/OpenJDK-%{version}/bin/serialver \
163
+  --slave %{_bindir}/wsgen wsgen %{_libdir}/jvm/OpenJDK-%{version}/bin/wsgen \
164
+  --slave %{_bindir}/wsimport wsimport %{_libdir}/jvm/OpenJDK-%{version}/bin/wsimport \
165
+  --slave %{_bindir}/xjc xjc %{_libdir}/jvm/OpenJDK-%{version}/bin/xjc
166
+/sbin/ldconfig
167
+
168
+%post -n openjre8
169
+alternatives --install %{_bindir}/java java %{_libdir}/jvm/OpenJDK-%{version}/jre/bin/java 2000 \
170
+  --slave %{_libdir}/jvm/jre jre %{_libdir}/jvm/OpenJDK-%{version}/jre \
171
+  --slave %{_bindir}/jjs jjs %{_libdir}/jvm/OpenJDK-%{version}/jre/bin/jjs \
172
+  --slave %{_bindir}/keytool keytool %{_libdir}/jvm/OpenJDK-%{version}/jre/bin/keytool \
173
+  --slave %{_bindir}/orbd orbd %{_libdir}/jvm/OpenJDK-%{version}/jre/bin/orbd \
174
+  --slave %{_bindir}/pack200 pack200 %{_libdir}/jvm/OpenJDK-%{version}/jre/bin/pack200 \
175
+  --slave %{_bindir}/rmid rmid %{_libdir}/jvm/OpenJDK-%{version}/jre/bin/rmid \
176
+  --slave %{_bindir}/rmiregistry rmiregistry %{_libdir}/jvm/OpenJDK-%{version}/jre/bin/rmiregistry \
177
+  --slave %{_bindir}/servertool servertool %{_libdir}/jvm/OpenJDK-%{version}/jre/bin/servertool \
178
+  --slave %{_bindir}/tnameserv tnameserv %{_libdir}/jvm/OpenJDK-%{version}/jre/bin/tnameserv \
179
+  --slave %{_bindir}/unpack200 unpack200 %{_libdir}/jvm/OpenJDK-%{version}/jre/bin/unpack200
180
+/sbin/ldconfig
181
+
182
+%postun
183
+alternatives --remove javac %{_libdir}/jvm/OpenJDK-%{version}/bin/javac
184
+/sbin/ldconfig
185
+
186
+%postun -n openjre8
187
+alternatives --remove java %{_libdir}/jvm/OpenJDK-%{version}/jre/bin/java
188
+/sbin/ldconfig
189
+
190
+%clean
191
+rm -rf %{buildroot}/*
192
+
193
+%files
194
+%defattr(-,root,root)
195
+%{_libdir}/jvm/OpenJDK-%{version}/ASSEMBLY_EXCEPTION
196
+%{_libdir}/jvm/OpenJDK-%{version}/LICENSE
197
+%{_libdir}/jvm/OpenJDK-%{version}/release
198
+%{_libdir}/jvm/OpenJDK-%{version}/THIRD_PARTY_README
199
+%{_libdir}/jvm/OpenJDK-%{version}/lib
200
+%{_libdir}/jvm/OpenJDK-%{version}/include/
201
+%{_libdir}/jvm/OpenJDK-%{version}/bin/extcheck
202
+%{_libdir}/jvm/OpenJDK-%{version}/bin/idlj
203
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jar
204
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jarsigner
205
+%{_libdir}/jvm/OpenJDK-%{version}/bin/java-rmi.cgi
206
+%{_libdir}/jvm/OpenJDK-%{version}/bin/javac
207
+%{_libdir}/jvm/OpenJDK-%{version}/bin/javadoc
208
+%{_libdir}/jvm/OpenJDK-%{version}/bin/javah
209
+%{_libdir}/jvm/OpenJDK-%{version}/bin/javap
210
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jcmd
211
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jconsole
212
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jdb
213
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jdeps
214
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jhat
215
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jinfo
216
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jjs
217
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jmap
218
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jps
219
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jrunscript
220
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jsadebugd
221
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jstack
222
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jstat
223
+%{_libdir}/jvm/OpenJDK-%{version}/bin/jstatd
224
+%{_libdir}/jvm/OpenJDK-%{version}/bin/native2ascii
225
+%{_libdir}/jvm/OpenJDK-%{version}/bin/rmic
226
+%{_libdir}/jvm/OpenJDK-%{version}/bin/schemagen
227
+%{_libdir}/jvm/OpenJDK-%{version}/bin/serialver
228
+%{_libdir}/jvm/OpenJDK-%{version}/bin/wsgen
229
+%{_libdir}/jvm/OpenJDK-%{version}/bin/wsimport
230
+%{_libdir}/jvm/OpenJDK-%{version}/bin/xjc
231
+
232
+%files	-n openjre8
233
+%defattr(-,root,root)
234
+%dir %{_libdir}/jvm/OpenJDK-%{version}
235
+%{_libdir}/jvm/OpenJDK-%{version}/jre/
236
+%{_libdir}/jvm/OpenJDK-%{version}/bin/java
237
+%{_libdir}/jvm/OpenJDK-%{version}/bin/keytool
238
+%{_libdir}/jvm/OpenJDK-%{version}/bin/orbd
239
+%{_libdir}/jvm/OpenJDK-%{version}/bin/pack200
240
+%{_libdir}/jvm/OpenJDK-%{version}/bin/rmid
241
+%{_libdir}/jvm/OpenJDK-%{version}/bin/rmiregistry
242
+%{_libdir}/jvm/OpenJDK-%{version}/bin/servertool
243
+%{_libdir}/jvm/OpenJDK-%{version}/bin/tnameserv
244
+%{_libdir}/jvm/OpenJDK-%{version}/bin/unpack200
245
+%{_libdir}/jvm/OpenJDK-%{version}/lib/aarch64/jli/
246
+%exclude %{_libdir}/jvm/OpenJDK-%{version}/lib/aarch64/*.diz
247
+
248
+%files sample
249
+%defattr(-,root,root)
250
+%{_libdir}/jvm/OpenJDK-%{version}/sample/
251
+
252
+%files doc
253
+%defattr(-,root,root)
254
+%{_libdir}/jvm/OpenJDK-%{version}/man/
255
+%{_libdir}/jvm/OpenJDK-%{version}/demo
256
+
257
+%files src
258
+%defattr(-,root,root)
259
+%{_libdir}/jvm/OpenJDK-%{version}/src.zip
260
+
261
+%changelog
262
+*   Thu Dec 21 2017 Alexey Makhalov <amakhalov@vmware.com> 1.8.0.151-1
263
+-   Initial version of OpenJDK for aarch64. SPEC file was forked from
264
+    openjdk8-1.8.0.152-1 of x86_64
0 265
deleted file mode 100644
... ...
@@ -1,449 +0,0 @@
1
-diff -Naur openjdk-1.8.0-141/jdk/src/solaris/native/sun/awt/CUPSfuncs.c openjdk-1.8.0.141/jdk/src/solaris/native/sun/awt/CUPSfuncs.c
2
-+++ b/jdk/src/solaris/native/sun/awt/CUPSfuncs.c	1969-12-31 16:00:00.000000000 -0800
3
-@@ -1,445 +0,0 @@
4
--/*
5
-- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
6
-- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7
-- *
8
-- * This code is free software; you can redistribute it and/or modify it
9
-- * under the terms of the GNU General Public License version 2 only, as
10
-- * published by the Free Software Foundation.  Oracle designates this
11
-- * particular file as subject to the "Classpath" exception as provided
12
-- * by Oracle in the LICENSE file that accompanied this code.
13
-- *
14
-- * This code is distributed in the hope that it will be useful, but WITHOUT
15
-- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
-- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17
-- * version 2 for more details (a copy is included in the LICENSE file that
18
-- * accompanied this code).
19
-- *
20
-- * You should have received a copy of the GNU General Public License version
21
-- * 2 along with this work; if not, write to the Free Software Foundation,
22
-- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
23
-- *
24
-- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
25
-- * or visit www.oracle.com if you need additional information or have any
26
-- * questions.
27
-- */
28
--
29
--#include <jni.h>
30
--#include <jni_util.h>
31
--#include <jvm_md.h>
32
--#include <dlfcn.h>
33
--#include <cups/cups.h>
34
--#include <cups/ppd.h>
35
--
36
--//#define CUPS_DEBUG
37
--
38
--#ifdef CUPS_DEBUG
39
--#define DPRINTF(x, y) fprintf(stderr, x, y);
40
--#else
41
--#define DPRINTF(x, y)
42
--#endif
43
--
44
--typedef const char* (*fn_cupsServer)(void);
45
--typedef int (*fn_ippPort)(void);
46
--typedef http_t* (*fn_httpConnect)(const char *, int);
47
--typedef void (*fn_httpClose)(http_t *);
48
--typedef char* (*fn_cupsGetPPD)(const char *);
49
--typedef cups_dest_t* (*fn_cupsGetDest)(const char *name,
50
--    const char *instance, int num_dests, cups_dest_t *dests);
51
--typedef int (*fn_cupsGetDests)(cups_dest_t **dests);
52
--typedef void (*fn_cupsFreeDests)(int num_dests, cups_dest_t *dests);
53
--typedef ppd_file_t* (*fn_ppdOpenFile)(const char *);
54
--typedef void (*fn_ppdClose)(ppd_file_t *);
55
--typedef ppd_option_t* (*fn_ppdFindOption)(ppd_file_t *, const char *);
56
--typedef ppd_size_t* (*fn_ppdPageSize)(ppd_file_t *, char *);
57
--
58
--fn_cupsServer j2d_cupsServer;
59
--fn_ippPort j2d_ippPort;
60
--fn_httpConnect j2d_httpConnect;
61
--fn_httpClose j2d_httpClose;
62
--fn_cupsGetPPD j2d_cupsGetPPD;
63
--fn_cupsGetDest j2d_cupsGetDest;
64
--fn_cupsGetDests j2d_cupsGetDests;
65
--fn_cupsFreeDests j2d_cupsFreeDests;
66
--fn_ppdOpenFile j2d_ppdOpenFile;
67
--fn_ppdClose j2d_ppdClose;
68
--fn_ppdFindOption j2d_ppdFindOption;
69
--fn_ppdPageSize j2d_ppdPageSize;
70
--
71
--
72
--/*
73
-- * Initialize library functions.
74
-- * // REMIND : move tab , add dlClose before return
75
-- */
76
--JNIEXPORT jboolean JNICALL
77
--Java_sun_print_CUPSPrinter_initIDs(JNIEnv *env,
78
--                                         jobject printObj) {
79
--  void *handle = dlopen(VERSIONED_JNI_LIB_NAME("cups", "2"),
80
--                        RTLD_LAZY | RTLD_GLOBAL);
81
--
82
--  if (handle == NULL) {
83
--    handle = dlopen(JNI_LIB_NAME("cups"), RTLD_LAZY | RTLD_GLOBAL);
84
--    if (handle == NULL) {
85
--      return JNI_FALSE;
86
--    }
87
--  }
88
--
89
--  j2d_cupsServer = (fn_cupsServer)dlsym(handle, "cupsServer");
90
--  if (j2d_cupsServer == NULL) {
91
--    dlclose(handle);
92
--    return JNI_FALSE;
93
--  }
94
--
95
--  j2d_ippPort = (fn_ippPort)dlsym(handle, "ippPort");
96
--  if (j2d_ippPort == NULL) {
97
--    dlclose(handle);
98
--    return JNI_FALSE;
99
--  }
100
--
101
--  j2d_httpConnect = (fn_httpConnect)dlsym(handle, "httpConnect");
102
--  if (j2d_httpConnect == NULL) {
103
--    dlclose(handle);
104
--    return JNI_FALSE;
105
--  }
106
--
107
--  j2d_httpClose = (fn_httpClose)dlsym(handle, "httpClose");
108
--  if (j2d_httpClose == NULL) {
109
--    dlclose(handle);
110
--    return JNI_FALSE;
111
--  }
112
--
113
--  j2d_cupsGetPPD = (fn_cupsGetPPD)dlsym(handle, "cupsGetPPD");
114
--  if (j2d_cupsGetPPD == NULL) {
115
--    dlclose(handle);
116
--    return JNI_FALSE;
117
--  }
118
--
119
--  j2d_cupsGetDest = (fn_cupsGetDest)dlsym(handle, "cupsGetDest");
120
--  if (j2d_cupsGetDest == NULL) {
121
--    dlclose(handle);
122
--    return JNI_FALSE;
123
--  }
124
--
125
--  j2d_cupsGetDests = (fn_cupsGetDests)dlsym(handle, "cupsGetDests");
126
--  if (j2d_cupsGetDests == NULL) {
127
--    dlclose(handle);
128
--    return JNI_FALSE;
129
--  }
130
--
131
--  j2d_cupsFreeDests = (fn_cupsFreeDests)dlsym(handle, "cupsFreeDests");
132
--  if (j2d_cupsFreeDests == NULL) {
133
--    dlclose(handle);
134
--    return JNI_FALSE;
135
--  }
136
--
137
--  j2d_ppdOpenFile = (fn_ppdOpenFile)dlsym(handle, "ppdOpenFile");
138
--  if (j2d_ppdOpenFile == NULL) {
139
--    dlclose(handle);
140
--    return JNI_FALSE;
141
--
142
--  }
143
--
144
--  j2d_ppdClose = (fn_ppdClose)dlsym(handle, "ppdClose");
145
--  if (j2d_ppdClose == NULL) {
146
--    dlclose(handle);
147
--    return JNI_FALSE;
148
--
149
--  }
150
--
151
--  j2d_ppdFindOption = (fn_ppdFindOption)dlsym(handle, "ppdFindOption");
152
--  if (j2d_ppdFindOption == NULL) {
153
--    dlclose(handle);
154
--    return JNI_FALSE;
155
--  }
156
--
157
--  j2d_ppdPageSize = (fn_ppdPageSize)dlsym(handle, "ppdPageSize");
158
--  if (j2d_ppdPageSize == NULL) {
159
--    dlclose(handle);
160
--    return JNI_FALSE;
161
--  }
162
--
163
--  return JNI_TRUE;
164
--}
165
--
166
--/*
167
-- * Gets CUPS server name.
168
-- *
169
-- */
170
--JNIEXPORT jstring JNICALL
171
--Java_sun_print_CUPSPrinter_getCupsServer(JNIEnv *env,
172
--                                         jobject printObj)
173
--{
174
--    jstring cServer = NULL;
175
--    const char* server = j2d_cupsServer();
176
--    if (server != NULL) {
177
--        // Is this a local domain socket?
178
--        if (strncmp(server, "/", 1) == 0) {
179
--            cServer = JNU_NewStringPlatform(env, "localhost");
180
--        } else {
181
--            cServer = JNU_NewStringPlatform(env, server);
182
--        }
183
--    }
184
--    return cServer;
185
--}
186
--
187
--/*
188
-- * Gets CUPS port name.
189
-- *
190
-- */
191
--JNIEXPORT jint JNICALL
192
--Java_sun_print_CUPSPrinter_getCupsPort(JNIEnv *env,
193
--                                         jobject printObj)
194
--{
195
--    int port = j2d_ippPort();
196
--    return (jint) port;
197
--}
198
--
199
--
200
--/*
201
-- * Gets CUPS default printer name.
202
-- *
203
-- */
204
--JNIEXPORT jstring JNICALL
205
--Java_sun_print_CUPSPrinter_getCupsDefaultPrinter(JNIEnv *env,
206
--                                                  jobject printObj)
207
--{
208
--    jstring cDefPrinter = NULL;
209
--    cups_dest_t *dests;
210
--    char *defaultPrinter = NULL;
211
--    int num_dests = j2d_cupsGetDests(&dests);
212
--    int i = 0;
213
--    cups_dest_t *dest = j2d_cupsGetDest(NULL, NULL, num_dests, dests);
214
--    if (dest != NULL) {
215
--        defaultPrinter = dest->name;
216
--        if (defaultPrinter != NULL) {
217
--            cDefPrinter = JNU_NewStringPlatform(env, defaultPrinter);
218
--        }
219
--    }
220
--    j2d_cupsFreeDests(num_dests, dests);
221
--    return cDefPrinter;
222
--}
223
--
224
--/*
225
-- * Checks if connection can be made to the server.
226
-- *
227
-- */
228
--JNIEXPORT jboolean JNICALL
229
--Java_sun_print_CUPSPrinter_canConnect(JNIEnv *env,
230
--                                      jobject printObj,
231
--                                      jstring server,
232
--                                      jint port)
233
--{
234
--    const char *serverName;
235
--    serverName = (*env)->GetStringUTFChars(env, server, NULL);
236
--    if (serverName != NULL) {
237
--        http_t *http = j2d_httpConnect(serverName, (int)port);
238
--        (*env)->ReleaseStringUTFChars(env, server, serverName);
239
--        if (http != NULL) {
240
--            j2d_httpClose(http);
241
--            return JNI_TRUE;
242
--        }
243
--    }
244
--    return JNI_FALSE;
245
--}
246
--
247
--
248
--/*
249
-- * Returns list of media: pages + trays
250
-- */
251
--JNIEXPORT jobjectArray JNICALL
252
--Java_sun_print_CUPSPrinter_getMedia(JNIEnv *env,
253
--                                         jobject printObj,
254
--                                         jstring printer)
255
--{
256
--    ppd_file_t *ppd;
257
--    ppd_option_t *optionTray, *optionPage;
258
--    ppd_choice_t *choice;
259
--    const char *name;
260
--    const char *filename;
261
--    int i, nTrays=0, nPages=0, nTotal=0;
262
--    jstring utf_str;
263
--    jclass cls;
264
--    jobjectArray nameArray = NULL;
265
--
266
--    name = (*env)->GetStringUTFChars(env, printer, NULL);
267
--    if (name == NULL) {
268
--        (*env)->ExceptionClear(env);
269
--        JNU_ThrowOutOfMemoryError(env, "Could not create printer name");
270
--        return NULL;
271
--    }
272
--
273
--    // NOTE: cupsGetPPD returns a pointer to a filename of a temporary file.
274
--    // unlink() must be caled to remove the file when finished using it.
275
--    filename = j2d_cupsGetPPD(name);
276
--    (*env)->ReleaseStringUTFChars(env, printer, name);
277
--    CHECK_NULL_RETURN(filename, NULL);
278
--
279
--    cls = (*env)->FindClass(env, "java/lang/String");
280
--    CHECK_NULL_RETURN(cls, NULL);
281
--
282
--    if ((ppd = j2d_ppdOpenFile(filename)) == NULL) {
283
--        unlink(filename);
284
--        DPRINTF("CUPSfuncs::unable to open PPD  %s\n", filename);
285
--        return NULL;
286
--    }
287
--
288
--    optionPage = j2d_ppdFindOption(ppd, "PageSize");
289
--    if (optionPage != NULL) {
290
--        nPages = optionPage->num_choices;
291
--    }
292
--
293
--    optionTray = j2d_ppdFindOption(ppd, "InputSlot");
294
--    if (optionTray != NULL) {
295
--        nTrays = optionTray->num_choices;
296
--    }
297
--
298
--    if ((nTotal = (nPages+nTrays) *2) > 0) {
299
--        nameArray = (*env)->NewObjectArray(env, nTotal, cls, NULL);
300
--        if (nameArray == NULL) {
301
--            unlink(filename);
302
--            j2d_ppdClose(ppd);
303
--            DPRINTF("CUPSfuncs::bad alloc new array\n", "")
304
--            (*env)->ExceptionClear(env);
305
--            JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError");
306
--            return NULL;
307
--        }
308
--
309
--        for (i = 0; optionPage!=NULL && i<nPages; i++) {
310
--            choice = (optionPage->choices)+i;
311
--            utf_str = JNU_NewStringPlatform(env, choice->text);
312
--            if (utf_str == NULL) {
313
--                unlink(filename);
314
--                j2d_ppdClose(ppd);
315
--                DPRINTF("CUPSfuncs::bad alloc new string ->text\n", "")
316
--                JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError");
317
--                return NULL;
318
--            }
319
--            (*env)->SetObjectArrayElement(env, nameArray, i*2, utf_str);
320
--            (*env)->DeleteLocalRef(env, utf_str);
321
--            utf_str = JNU_NewStringPlatform(env, choice->choice);
322
--            if (utf_str == NULL) {
323
--                unlink(filename);
324
--                j2d_ppdClose(ppd);
325
--                DPRINTF("CUPSfuncs::bad alloc new string ->choice\n", "")
326
--                JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError");
327
--                return NULL;
328
--            }
329
--            (*env)->SetObjectArrayElement(env, nameArray, i*2+1, utf_str);
330
--            (*env)->DeleteLocalRef(env, utf_str);
331
--        }
332
--
333
--        for (i = 0; optionTray!=NULL && i<nTrays; i++) {
334
--            choice = (optionTray->choices)+i;
335
--            utf_str = JNU_NewStringPlatform(env, choice->text);
336
--            if (utf_str == NULL) {
337
--                unlink(filename);
338
--                j2d_ppdClose(ppd);
339
--                DPRINTF("CUPSfuncs::bad alloc new string text\n", "")
340
--                JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError");
341
--                return NULL;
342
--            }
343
--            (*env)->SetObjectArrayElement(env, nameArray,
344
--                                          (nPages+i)*2, utf_str);
345
--            (*env)->DeleteLocalRef(env, utf_str);
346
--            utf_str = JNU_NewStringPlatform(env, choice->choice);
347
--            if (utf_str == NULL) {
348
--                unlink(filename);
349
--                j2d_ppdClose(ppd);
350
--                DPRINTF("CUPSfuncs::bad alloc new string choice\n", "")
351
--                JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError");
352
--                return NULL;
353
--            }
354
--            (*env)->SetObjectArrayElement(env, nameArray,
355
--                                          (nPages+i)*2+1, utf_str);
356
--            (*env)->DeleteLocalRef(env, utf_str);
357
--        }
358
--    }
359
--    j2d_ppdClose(ppd);
360
--    unlink(filename);
361
--    return nameArray;
362
--}
363
--
364
--
365
--/*
366
-- * Returns list of page sizes and imageable area.
367
-- */
368
--JNIEXPORT jfloatArray JNICALL
369
--Java_sun_print_CUPSPrinter_getPageSizes(JNIEnv *env,
370
--                                         jobject printObj,
371
--                                         jstring printer)
372
--{
373
--    ppd_file_t *ppd;
374
--    ppd_option_t *option;
375
--    ppd_choice_t *choice;
376
--    ppd_size_t *size;
377
--
378
--    const char *name = (*env)->GetStringUTFChars(env, printer, NULL);
379
--    if (name == NULL) {
380
--        (*env)->ExceptionClear(env);
381
--        JNU_ThrowOutOfMemoryError(env, "Could not create printer name");
382
--        return NULL;
383
--    }
384
--    const char *filename;
385
--    int i;
386
--    jobjectArray sizeArray = NULL;
387
--    jfloat *dims;
388
--
389
--    // NOTE: cupsGetPPD returns a pointer to a filename of a temporary file.
390
--    // unlink() must be called to remove the file after using it.
391
--    filename = j2d_cupsGetPPD(name);
392
--    (*env)->ReleaseStringUTFChars(env, printer, name);
393
--    CHECK_NULL_RETURN(filename, NULL);
394
--    if ((ppd = j2d_ppdOpenFile(filename)) == NULL) {
395
--        unlink(filename);
396
--        DPRINTF("unable to open PPD  %s\n", filename)
397
--        return NULL;
398
--    }
399
--    option = j2d_ppdFindOption(ppd, "PageSize");
400
--    if (option != NULL && option->num_choices > 0) {
401
--        // create array of dimensions - (num_choices * 6)
402
--        //to cover length & height
403
--        DPRINTF( "CUPSfuncs::option->num_choices %d\n", option->num_choices)
404
--        // +1 is for storing the default media index
405
--        sizeArray = (*env)->NewFloatArray(env, option->num_choices*6+1);
406
--        if (sizeArray == NULL) {
407
--            unlink(filename);
408
--            j2d_ppdClose(ppd);
409
--            DPRINTF("CUPSfuncs::bad alloc new float array\n", "")
410
--            (*env)->ExceptionClear(env);
411
--            JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError");
412
--            return NULL;
413
--        }
414
--
415
--        dims = (*env)->GetFloatArrayElements(env, sizeArray, NULL);
416
--        if (dims == NULL) {
417
--            unlink(filename);
418
--            j2d_ppdClose(ppd);
419
--            (*env)->ExceptionClear(env);
420
--            JNU_ThrowOutOfMemoryError(env, "Could not create printer name");
421
--            return NULL;
422
--        }
423
--        for (i = 0; i<option->num_choices; i++) {
424
--            choice = (option->choices)+i;
425
--            // get the index of the default page
426
--            if (!strcmp(choice->choice, option->defchoice)) {
427
--                dims[option->num_choices*6] = (float)i;
428
--            }
429
--            size = j2d_ppdPageSize(ppd, choice->choice);
430
--            if (size != NULL) {
431
--                // paper width and height
432
--                dims[i*6] = size->width;
433
--                dims[(i*6)+1] = size->length;
434
--                // paper printable area
435
--                dims[(i*6)+2] = size->left;
436
--                dims[(i*6)+3] = size->top;
437
--                dims[(i*6)+4] = size->right;
438
--                dims[(i*6)+5] = size->bottom;
439
--            }
440
--        }
441
--
442
--        (*env)->ReleaseFloatArrayElements(env, sizeArray, dims, 0);
443
--    }
444
--
445
--    j2d_ppdClose(ppd);
446
--    unlink(filename);
447
--    return sizeArray;
448
--}
... ...
@@ -329,7 +329,7 @@ class SpecParser(object):
329 329
     def readDefinition(self,line):
330 330
         listDefines=line.split()
331 331
         if len(listDefines) == 3:
332
-           self.defs[listDefines[1]] = listDefines[2]
332
+           self.defs[listDefines[1]] = self.replaceMacros(listDefines[2])
333 333
            return True
334 334
         return False
335 335
 
... ...
@@ -165,6 +165,10 @@ class ToolChainUtils(object):
165 165
             pkgUtils=PackageUtils(self.logName,self.logPath)
166 166
             print "DEBUG:" + package
167 167
             if "openjre8" in packageName or "openjdk8" in packageName:
168
+                # x86_64 has openjdk/jre as a published rpms but aarch64 has openjdk8/jre8
169
+                # Remove this condition after publishxrpms for x86_^4 got updated
170
+                if (package == "openjdk" or package == "openjre") and (platform.machine() == "aarch64"):
171
+                    package = package + "8"
168 172
                 rpmFile=self.findRPMFileInGivenLocation(package, constants.prevPublishXRPMRepo)
169 173
             else:
170 174
                 rpmFile=self.findRPMFileInGivenLocation(package, constants.prevPublishRPMRepo)
... ...
@@ -212,15 +212,10 @@ class constants(object):
212 212
         "go"]
213 213
 
214 214
     perPackageToolChain = dict.fromkeys(["openjdk8", "openjdk8-doc", "openjdk8-src", "openjdk8-sample", "openjre8" ], [
215
-        "glib-devel",
216 215
         "icu-devel",
217 216
         "openjdk",
218 217
         "openjre",
219 218
         "icu",
220
-        "harfbuzz",
221
-        "harfbuzz-devel",
222
-        "freetype2",
223
-        "freetype2-devel",
224 219
         "alsa-lib",
225 220
         "alsa-lib-devel",
226 221
         "xcb-proto",
... ...
@@ -229,12 +224,10 @@ class constants(object):
229 229
         "util-macros",
230 230
         "xtrans",
231 231
         "libxcb-devel",
232
-        "fontconfig-devel",
233 232
         "proto",
234 233
         "libXdmcp",
235 234
         "libxcb",
236 235
         "libXau",
237
-        "fontconfig",
238 236
         "xtrans-devel",
239 237
         "libX11",
240 238
         "libX11-devel",
... ...
@@ -347,7 +340,8 @@ class constants(object):
347 347
     # list of spec files to skip for parsing for given arch
348 348
     skipSpecsForArch={
349 349
         "x86_64":[
350
-            "u-boot-rpi3.spec"
350
+            "u-boot-rpi3.spec",
351
+            "openjdk8_aarch64.spec"
351 352
             ],
352 353
         "aarch64":[
353 354
             # fakeroot-ng does not support aarch64
... ...
@@ -1,2 +1,31 @@
1 1
 noarch/proto-7.7-1.noarch.rpm
2 2
 noarch/util-macros-1.19.0-1.noarch.rpm
3
+aarch64/openjdk8-1.8.0.151-1.ph2.aarch64.rpm
4
+aarch64/openjre8-1.8.0.151-1.ph2.aarch64.rpm
5
+aarch64/alsa-lib-1.1.5-1.aarch64.rpm
6
+aarch64/alsa-lib-devel-1.1.5-1.aarch64.rpm
7
+aarch64/icu-55.1-1.aarch64.rpm
8
+aarch64/icu-devel-55.1-1.aarch64.rpm
9
+aarch64/libICE-1.0.9-1.aarch64.rpm
10
+aarch64/libICE-devel-1.0.9-1.aarch64.rpm
11
+aarch64/libSM-1.2.2-1.aarch64.rpm
12
+aarch64/libSM-devel-1.2.2-1.aarch64.rpm
13
+aarch64/libX11-1.6.3-2.aarch64.rpm
14
+aarch64/libX11-devel-1.6.3-2.aarch64.rpm
15
+aarch64/libXau-1.0.8-1.aarch64.rpm
16
+aarch64/libXau-devel-1.0.8-1.aarch64.rpm
17
+aarch64/libxcb-1.11-1.aarch64.rpm
18
+aarch64/libxcb-devel-1.11-1.aarch64.rpm
19
+aarch64/libXdmcp-1.1.2-1.aarch64.rpm
20
+aarch64/libXdmcp-devel-1.1.2-1.aarch64.rpm
21
+aarch64/libXext-1.3.3-1.aarch64.rpm
22
+aarch64/libXext-devel-1.3.3-1.aarch64.rpm
23
+aarch64/libXmu-1.1.2-1.aarch64.rpm
24
+aarch64/libXmu-devel-1.1.2-1.aarch64.rpm
25
+aarch64/libXrender-0.9.8-1.aarch64.rpm
26
+aarch64/libXrender-devel-0.9.8-1.aarch64.rpm
27
+aarch64/libXt-1.1.4-1.aarch64.rpm
28
+aarch64/libXt-devel-1.1.4-1.aarch64.rpm
29
+aarch64/xcb-proto-1.11-1.aarch64.rpm
30
+aarch64/xtrans-1.3.5-2.aarch64.rpm
31
+aarch64/xtrans-devel-1.3.5-2.aarch64.rpm