1 |
# note, parametrised macros are order-senisitve (unlike not-parametrized) even with normal macros |
2 |
# also necessary when passing it as parameter other macros. If not macro, then it is considered as switch |
3 |
%global debug_suffix_unquoted -debug |
4 |
# quoted one for shell operations |
5 |
%global debug_suffix "%{debug_suffix_unquoted}" |
6 |
%global normal_suffix "" |
7 |
|
8 |
#if you wont only debug build, but providing java, build only normal build, but set normalbuild_parameter |
9 |
%global debugbuild_parameter slowdebug |
10 |
%global normalbuild_parameter release |
11 |
%global debug_warning This package have full debug on. Install only in need, and remove asap. |
12 |
%global debug_on with full debug on |
13 |
%global for_debug for packages with debug on |
14 |
|
15 |
# by default we build normal build always. |
16 |
%global include_normal_build 1 |
17 |
%if %{include_normal_build} |
18 |
%global build_loop1 %{normal_suffix} |
19 |
%else |
20 |
%global build_loop1 %{nil} |
21 |
%endif |
22 |
|
23 |
%global aarch64 aarch64 arm64 armv8 |
24 |
# sometimes we need to distinguish big and little endian PPC64 |
25 |
%global ppc64le ppc64le |
26 |
%global ppc64be ppc64 ppc64p7 |
27 |
%global multilib_arches %{power64} sparc64 x86_64 |
28 |
%global jit_arches %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} |
29 |
|
30 |
# By default, we build a debug build during main build on JIT architectures |
31 |
%ifarch %{jit_arches} |
32 |
%global include_debug_build 0 |
33 |
%else |
34 |
%global include_debug_build 0 |
35 |
%endif |
36 |
|
37 |
# on intels, we build shenandoah htspot |
38 |
%ifarch x86_64 |
39 |
%global use_shenandoah_hotspot 1 |
40 |
%else |
41 |
%global use_shenandoah_hotspot 0 |
42 |
%endif |
43 |
|
44 |
%if %{include_debug_build} |
45 |
%global build_loop2 %{debug_suffix} |
46 |
%else |
47 |
%global build_loop2 %{nil} |
48 |
%endif |
49 |
|
50 |
# if you disable both builds, then build fails |
51 |
%global build_loop %{build_loop1} %{build_loop2} |
52 |
# note, that order normal_suffix debug_suffix, in case of both enabled, |
53 |
# is expected in one single case at the end of build |
54 |
%global rev_build_loop %{build_loop2} %{build_loop1} |
55 |
|
56 |
%ifarch %{jit_arches} |
57 |
%global bootstrap_build 1 |
58 |
%else |
59 |
%global bootstrap_build 0 |
60 |
%endif |
61 |
|
62 |
%if %{bootstrap_build} |
63 |
%global targets bootcycle-images docs |
64 |
%else |
65 |
%global targets all |
66 |
%endif |
67 |
|
68 |
%ifnarch %{jit_arches} |
69 |
# Disable hardened build on non-jit arches. Work-around for RHBZ#1290936. |
70 |
%undefine _hardened_build |
71 |
%global ourcppflags %{nil} |
72 |
%global ourldflags %{nil} |
73 |
%else |
74 |
%ifarch %{aarch64} |
75 |
# Disable hardened build on AArch64 as it didn't bootcycle |
76 |
%undefine _hardened_build |
77 |
%global ourcppflags "-fstack-protector-strong" |
78 |
%global ourldflags %{nil} |
79 |
%else |
80 |
# Filter out flags from the optflags macro that cause problems with the OpenJDK build |
81 |
# We filter out -O flags so that the optimisation of HotSpot is not lowered from O3 to O2 |
82 |
# We filter out -Wall which will otherwise cause HotSpot to produce hundreds of thousands of warnings (100+mb logs) |
83 |
# We replace it with -Wformat (required by -Werror=format-security) and -Wno-cpp to avoid FORTIFY_SOURCE warnings |
84 |
# We filter out -fexceptions as the HotSpot build explicitly does -fno-exceptions and it's otherwise the default for C++ |
85 |
%global ourflags %(echo %optflags | sed -e 's|-Wformat|-Wformat -Wno-cpp|') |
86 |
%global ourcppflags %(echo %ourflags | sed -e 's|-fexceptions||') |
87 |
%global ourldflags %(echo %{ldflags} | sed -e 's|-Wl,--no-undefined||') |
88 |
%endif |
89 |
%endif |
90 |
|
91 |
# With diabled nss is NSS deactivated, so in NSS_LIBDIR can be wrong path |
92 |
# the initialisation must be here. LAter the pkg-connfig have bugy behaviour |
93 |
#looks liekopenjdk RPM specific bug |
94 |
# Always set this so the nss.cfg file is not broken |
95 |
%global NSS_LIBDIR %(pkg-config --variable=libdir nss) |
96 |
|
97 |
# fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349 |
98 |
%global _privatelibs libmawt[.]so.* |
99 |
%global __provides_exclude ^(%{_privatelibs})$ |
100 |
%global __requires_exclude ^(%{_privatelibs})$ |
101 |
|
102 |
%ifarch x86_64 |
103 |
%global archinstall amd64 |
104 |
%endif |
105 |
%ifarch ppc |
106 |
%global archinstall ppc |
107 |
%endif |
108 |
%ifarch %{ppc64be} |
109 |
%global archinstall ppc64 |
110 |
%endif |
111 |
%ifarch %{ppc64le} |
112 |
%global archinstall ppc64le |
113 |
%endif |
114 |
%ifarch %{ix86} |
115 |
%global archinstall i386 |
116 |
%endif |
117 |
%ifarch ia64 |
118 |
%global archinstall ia64 |
119 |
%endif |
120 |
%ifarch s390 |
121 |
%global archinstall s390 |
122 |
%endif |
123 |
%ifarch s390x |
124 |
%global archinstall s390x |
125 |
%endif |
126 |
%ifarch %{arm} |
127 |
%global archinstall arm |
128 |
%endif |
129 |
%ifarch %{aarch64} |
130 |
%global archinstall aarch64 |
131 |
%endif |
132 |
# 32 bit sparc, optimized for v9 |
133 |
%ifarch sparcv9 |
134 |
%global archinstall sparc |
135 |
%endif |
136 |
# 64 bit sparc |
137 |
%ifarch sparc64 |
138 |
%global archinstall sparcv9 |
139 |
%endif |
140 |
%ifnarch %{jit_arches} |
141 |
%global archinstall %{_arch} |
142 |
%endif |
143 |
|
144 |
|
145 |
|
146 |
%ifarch %{jit_arches} |
147 |
%global with_systemtap 1 |
148 |
%else |
149 |
%global with_systemtap 0 |
150 |
%endif |
151 |
|
152 |
# Convert an absolute path to a relative path. Each symbolic link is |
153 |
# specified relative to the directory in which it is installed so that |
154 |
# it will resolve properly within chrooted installations. |
155 |
%global script 'use File::Spec; print File::Spec->abs2rel($ARGV[0], $ARGV[1])' |
156 |
%global abs2rel %{__perl} -e %{script} |
157 |
|
158 |
|
159 |
# Standard JPackage naming and versioning defines. |
160 |
%global origin openjdk |
161 |
# note, following three variables are sedded from update_sources if used correctly. Hardcode them rather there. |
162 |
%global project aarch64-port |
163 |
%global repo jdk8u |
164 |
%global revision aarch64-jdk8u111-b16 |
165 |
# eg # jdk8u60-b27 -> jdk8u60 or # aarch64-jdk8u60-b27 -> aarch64-jdk8u60 (dont forget spec escape % by %%) |
166 |
%global whole_update %(VERSION=%{revision}; echo ${VERSION%%-*}) |
167 |
# eg jdk8u60 -> 60 or aarch64-jdk8u60 -> 60 |
168 |
%global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u}) |
169 |
# eg jdk8u60-b27 -> b27 |
170 |
%global buildver %(VERSION=%{revision}; echo ${VERSION##*-}) |
171 |
# priority must be 7 digits in total. The expression is workarounding tip |
172 |
%global priority %(TIP=1800%{updatever}; echo ${TIP/tip/999}) |
173 |
|
174 |
%global javaver 1.8.0 |
175 |
|
176 |
# parametrized macros are order-sensitive |
177 |
%global fullversion %{name}-%{version}-%{release} |
178 |
#images stub |
179 |
%global j2sdkimage() j2sdk-image |
180 |
# output dir stub |
181 |
%global buildoutputdir() %{expand:openjdk/build/jdk8.build%1} |
182 |
#we can copy the javadoc to not arched dir, or made it not noarch |
183 |
%global uniquejavadocdir() %{expand:%{fullversion}%1} |
184 |
#main id and dir of this jdk |
185 |
%global uniquesuffix() %{expand:%{fullversion}.%{_arch}%1} |
186 |
|
187 |
# Standard JPackage directories and symbolic links. |
188 |
%global sdkdir() %{expand:%{uniquesuffix %%1}} |
189 |
%global jrelnk() %{expand:jre-%{javaver}-%{origin}-%{version}-%{release}.%{_arch}%1} |
190 |
|
191 |
%global jredir() %{expand:%{sdkdir %%1}/jre} |
192 |
%global sdkbindir() %{expand:%{_jvmdir}/%{sdkdir %%1}/bin} |
193 |
%global jrebindir() %{expand:%{_jvmdir}/%{jredir %%1}/bin} |
194 |
%global jvmjardir() %{expand:%{_jvmjardir}/%{uniquesuffix %%1}} |
195 |
|
196 |
%global rpm_state_dir %{_localstatedir}/lib/rpm-state/ |
197 |
|
198 |
%if %{with_systemtap} |
199 |
# Where to install systemtap tapset (links) |
200 |
# We would like these to be in a package specific subdir, |
201 |
# but currently systemtap doesn't support that, so we have to |
202 |
# use the root tapset dir for now. To distinquish between 64 |
203 |
# and 32 bit architectures we place the tapsets under the arch |
204 |
# specific dir (note that systemtap will only pickup the tapset |
205 |
# for the primary arch for now). Systemtap uses the machine name |
206 |
# aka build_cpu as architecture specific directory name. |
207 |
%global tapsetroot /usr/share/systemtap |
208 |
%global tapsetdir %{tapsetroot}/tapset/%{_build_cpu} |
209 |
%endif |
210 |
|
211 |
# not-duplicated scriplets for normal/debug packages |
212 |
%global update_desktop_icons /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : |
213 |
|
214 |
%global check_sum_presented_in_spec() %{expand: |
215 |
md5sum %1 |
216 |
currentMd5sum=`md5sum %1 | sed "s;\\s.*;;"` |
217 |
specfile=%{_specdir}/%{name}.spec |
218 |
grep -e md5sum -A 20 $specfile | grep $currentMd5sum |
219 |
} |
220 |
|
221 |
%global post_script() %{expand: |
222 |
update-desktop-database %{_datadir}/applications &> /dev/null || : |
223 |
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : |
224 |
exit 0 |
225 |
} |
226 |
|
227 |
|
228 |
%global post_headless() %{expand: |
229 |
# FIXME: identical binaries are copied, not linked. This needs to be |
230 |
# fixed upstream. |
231 |
# The pretrans lua scriptlet prevents an unmodified java.security |
232 |
# from being replaced via an update. It gets created as |
233 |
# java.security.rpmnew instead. This invalidates the patch of |
234 |
# JDK-8061210 of the January 2015 CPU, JDK-8043201 of the |
235 |
# July 2015 CPU and JDK-8141287 of the January 2016 CPU. We |
236 |
# fix this via a post scriptlet which runs on updates. |
237 |
if [ "$1" -gt 1 ]; then |
238 |
javasecurity="%{_jvmdir}/%{uniquesuffix}/jre/lib/security/java.security" |
239 |
sum=$(md5sum "${javasecurity}" | cut -d' ' -f1) |
240 |
# This is the md5sum of an unmodified java.security file |
241 |
if [ "${sum}" = '1690ac33955594f71dc952c9e83fd396' -o \\ |
242 |
"${sum}" = 'b138695d0c0ea947e64a21a627d973ba' -o \\ |
243 |
"${sum}" = 'd17958676bdb9f9d941c8a59655311fb' -o \\ |
244 |
"${sum}" = '5463aef7dbf0bbcfe79e0336a7f92701' -o \\ |
245 |
"${sum}" = '400cc64d4dd31f36dc0cc2c701d603db' -o \\ |
246 |
"${sum}" = '321342219bb130d238ff144b9e5dbfc1' -o \\ |
247 |
"${sum}" = '134a37a84983b620f4d8d51a550c0c38' -o \\ |
248 |
"${sum}" = '5ea976e209d0d0b5b6ab148416123e02' -o \\ |
249 |
"${sum}" = '059d61cfbb47e337b011ecda9350db9b' -o \\ |
250 |
"${sum}" = '59dafb237e5def3ccf8a3ad589fb2777' -o \\ |
251 |
"${sum}" = '5ab4c77cf14fbd7f7ee6f51a7a73d88c' ]; then |
252 |
if [ -f "${javasecurity}.rpmnew" ]; then |
253 |
mv -f "${javasecurity}.rpmnew" "${javasecurity}" |
254 |
fi |
255 |
fi |
256 |
fi |
257 |
|
258 |
%ifarch %{jit_arches} |
259 |
# MetaspaceShared::generate_vtable_methods not implemented for PPC JIT |
260 |
%ifnarch %{power64} |
261 |
#see https://bugzilla.redhat.com/show_bug.cgi?id=513605 |
262 |
%{jrebindir %%1}/java -Xshare:dump >/dev/null 2>/dev/null |
263 |
%endif |
264 |
%endif |
265 |
|
266 |
PRIORITY=%{priority} |
267 |
if [ "%1" == %{debug_suffix} ]; then |
268 |
let PRIORITY=PRIORITY-1 |
269 |
fi |
270 |
|
271 |
ext=%{_extension} |
272 |
alternatives \\ |
273 |
--install %{_bindir}/java java %{jrebindir %%1}/java $PRIORITY \\ |
274 |
--slave %{_jvmdir}/jre jre %{_jvmdir}/%{jredir %%1} \\ |
275 |
--slave %{_jvmjardir}/jre jre_exports %{_jvmjardir}/%{jrelnk %%1} \\ |
276 |
--slave %{_bindir}/jjs jjs %{jrebindir %%1}/jjs \\ |
277 |
--slave %{_bindir}/keytool keytool %{jrebindir %%1}/keytool \\ |
278 |
--slave %{_bindir}/orbd orbd %{jrebindir %%1}/orbd \\ |
279 |
--slave %{_bindir}/pack200 pack200 %{jrebindir %%1}/pack200 \\ |
280 |
--slave %{_bindir}/rmid rmid %{jrebindir %%1}/rmid \\ |
281 |
--slave %{_bindir}/rmiregistry rmiregistry %{jrebindir %%1}/rmiregistry \\ |
282 |
--slave %{_bindir}/servertool servertool %{jrebindir %%1}/servertool \\ |
283 |
--slave %{_bindir}/tnameserv tnameserv %{jrebindir %%1}/tnameserv \\ |
284 |
--slave %{_bindir}/policytool policytool %{jrebindir %%1}/policytool \\ |
285 |
--slave %{_bindir}/unpack200 unpack200 %{jrebindir %%1}/unpack200 \\ |
286 |
--slave %{_mandir}/man1/java.1$ext java.1$ext \\ |
287 |
%{_mandir}/man1/java-%{uniquesuffix %%1}.1$ext \\ |
288 |
--slave %{_mandir}/man1/jjs.1$ext jjs.1$ext \\ |
289 |
%{_mandir}/man1/jjs-%{uniquesuffix %%1}.1$ext \\ |
290 |
--slave %{_mandir}/man1/keytool.1$ext keytool.1$ext \\ |
291 |
%{_mandir}/man1/keytool-%{uniquesuffix %%1}.1$ext \\ |
292 |
--slave %{_mandir}/man1/orbd.1$ext orbd.1$ext \\ |
293 |
%{_mandir}/man1/orbd-%{uniquesuffix %%1}.1$ext \\ |
294 |
--slave %{_mandir}/man1/pack200.1$ext pack200.1$ext \\ |
295 |
%{_mandir}/man1/pack200-%{uniquesuffix %%1}.1$ext \\ |
296 |
--slave %{_mandir}/man1/rmid.1$ext rmid.1$ext \\ |
297 |
%{_mandir}/man1/rmid-%{uniquesuffix %%1}.1$ext \\ |
298 |
--slave %{_mandir}/man1/rmiregistry.1$ext rmiregistry.1$ext \\ |
299 |
%{_mandir}/man1/rmiregistry-%{uniquesuffix %%1}.1$ext \\ |
300 |
--slave %{_mandir}/man1/servertool.1$ext servertool.1$ext \\ |
301 |
%{_mandir}/man1/servertool-%{uniquesuffix %%1}.1$ext \\ |
302 |
--slave %{_mandir}/man1/tnameserv.1$ext tnameserv.1$ext \\ |
303 |
%{_mandir}/man1/tnameserv-%{uniquesuffix %%1}.1$ext \\ |
304 |
--slave %{_mandir}/man1/policytool.1$ext policytool.1$ext \\ |
305 |
%{_mandir}/man1/policytool-%{uniquesuffix %%1}.1$ext \\ |
306 |
--slave %{_mandir}/man1/unpack200.1$ext unpack200.1$ext \\ |
307 |
%{_mandir}/man1/unpack200-%{uniquesuffix %%1}.1$ext |
308 |
|
309 |
for X in %{origin} %{javaver} ; do |
310 |
alternatives \\ |
311 |
--install %{_jvmdir}/jre-"$X" \\ |
312 |
jre_"$X" %{_jvmdir}/%{jredir %%1} $PRIORITY \\ |
313 |
--slave %{_jvmjardir}/jre-"$X" \\ |
314 |
jre_"$X"_exports %{_jvmdir}/%{jredir %%1} |
315 |
done |
316 |
|
317 |
update-alternatives --install %{_jvmdir}/jre-%{javaver}-%{origin} jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk %%1} $PRIORITY \\ |
318 |
--slave %{_jvmjardir}/jre-%{javaver} jre_%{javaver}_%{origin}_exports %{jvmjardir %%1} |
319 |
|
320 |
update-desktop-database %{_datadir}/applications &> /dev/null || : |
321 |
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : |
322 |
exit 0 |
323 |
} |
324 |
|
325 |
%global postun_script() %{expand: |
326 |
update-desktop-database %{_datadir}/applications &> /dev/null || : |
327 |
if [ $1 -eq 0 ] ; then |
328 |
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null |
329 |
%{update_desktop_icons} |
330 |
fi |
331 |
exit 0 |
332 |
} |
333 |
|
334 |
|
335 |
%global postun_headless() %{expand: |
336 |
alternatives --remove java %{jrebindir %%1}/java |
337 |
alternatives --remove jre_%{origin} %{_jvmdir}/%{jredir %%1} |
338 |
alternatives --remove jre_%{javaver} %{_jvmdir}/%{jredir %%1} |
339 |
alternatives --remove jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk %%1} |
340 |
} |
341 |
|
342 |
%global posttrans_script() %{expand: |
343 |
%{update_desktop_icons} |
344 |
} |
345 |
|
346 |
%global post_devel() %{expand: |
347 |
|
348 |
PRIORITY=%{priority} |
349 |
if [ "%1" == %{debug_suffix} ]; then |
350 |
let PRIORITY=PRIORITY-1 |
351 |
fi |
352 |
|
353 |
ext=%{_extension} |
354 |
alternatives \\ |
355 |
--install %{_bindir}/javac javac %{sdkbindir %%1}/javac $PRIORITY \\ |
356 |
--slave %{_jvmdir}/java java_sdk %{_jvmdir}/%{sdkdir %%1} \\ |
357 |
--slave %{_jvmjardir}/java java_sdk_exports %{_jvmjardir}/%{sdkdir %%1} \\ |
358 |
--slave %{_bindir}/appletviewer appletviewer %{sdkbindir %%1}/appletviewer \\ |
359 |
--slave %{_bindir}/extcheck extcheck %{sdkbindir %%1}/extcheck \\ |
360 |
--slave %{_bindir}/idlj idlj %{sdkbindir %%1}/idlj \\ |
361 |
--slave %{_bindir}/jar jar %{sdkbindir %%1}/jar \\ |
362 |
--slave %{_bindir}/jarsigner jarsigner %{sdkbindir %%1}/jarsigner \\ |
363 |
--slave %{_bindir}/javadoc javadoc %{sdkbindir %%1}/javadoc \\ |
364 |
--slave %{_bindir}/javah javah %{sdkbindir %%1}/javah \\ |
365 |
--slave %{_bindir}/javap javap %{sdkbindir %%1}/javap \\ |
366 |
--slave %{_bindir}/jcmd jcmd %{sdkbindir %%1}/jcmd \\ |
367 |
--slave %{_bindir}/jconsole jconsole %{sdkbindir %%1}/jconsole \\ |
368 |
--slave %{_bindir}/jdb jdb %{sdkbindir %%1}/jdb \\ |
369 |
--slave %{_bindir}/jdeps jdeps %{sdkbindir %%1}/jdeps \\ |
370 |
--slave %{_bindir}/jhat jhat %{sdkbindir %%1}/jhat \\ |
371 |
--slave %{_bindir}/jinfo jinfo %{sdkbindir %%1}/jinfo \\ |
372 |
--slave %{_bindir}/jmap jmap %{sdkbindir %%1}/jmap \\ |
373 |
--slave %{_bindir}/jps jps %{sdkbindir %%1}/jps \\ |
374 |
--slave %{_bindir}/jrunscript jrunscript %{sdkbindir %%1}/jrunscript \\ |
375 |
--slave %{_bindir}/jsadebugd jsadebugd %{sdkbindir %%1}/jsadebugd \\ |
376 |
--slave %{_bindir}/jstack jstack %{sdkbindir %%1}/jstack \\ |
377 |
--slave %{_bindir}/jstat jstat %{sdkbindir %%1}/jstat \\ |
378 |
--slave %{_bindir}/jstatd jstatd %{sdkbindir %%1}/jstatd \\ |
379 |
--slave %{_bindir}/native2ascii native2ascii %{sdkbindir %%1}/native2ascii \\ |
380 |
--slave %{_bindir}/rmic rmic %{sdkbindir %%1}/rmic \\ |
381 |
--slave %{_bindir}/schemagen schemagen %{sdkbindir %%1}/schemagen \\ |
382 |
--slave %{_bindir}/serialver serialver %{sdkbindir %%1}/serialver \\ |
383 |
--slave %{_bindir}/wsgen wsgen %{sdkbindir %%1}/wsgen \\ |
384 |
--slave %{_bindir}/wsimport wsimport %{sdkbindir %%1}/wsimport \\ |
385 |
--slave %{_bindir}/xjc xjc %{sdkbindir %%1}/xjc \\ |
386 |
--slave %{_mandir}/man1/appletviewer.1$ext appletviewer.1$ext \\ |
387 |
%{_mandir}/man1/appletviewer-%{uniquesuffix %%1}.1$ext \\ |
388 |
--slave %{_mandir}/man1/extcheck.1$ext extcheck.1$ext \\ |
389 |
%{_mandir}/man1/extcheck-%{uniquesuffix %%1}.1$ext \\ |
390 |
--slave %{_mandir}/man1/idlj.1$ext idlj.1$ext \\ |
391 |
%{_mandir}/man1/idlj-%{uniquesuffix %%1}.1$ext \\ |
392 |
--slave %{_mandir}/man1/jar.1$ext jar.1$ext \\ |
393 |
%{_mandir}/man1/jar-%{uniquesuffix %%1}.1$ext \\ |
394 |
--slave %{_mandir}/man1/jarsigner.1$ext jarsigner.1$ext \\ |
395 |
%{_mandir}/man1/jarsigner-%{uniquesuffix %%1}.1$ext \\ |
396 |
--slave %{_mandir}/man1/javac.1$ext javac.1$ext \\ |
397 |
%{_mandir}/man1/javac-%{uniquesuffix %%1}.1$ext \\ |
398 |
--slave %{_mandir}/man1/javadoc.1$ext javadoc.1$ext \\ |
399 |
%{_mandir}/man1/javadoc-%{uniquesuffix %%1}.1$ext \\ |
400 |
--slave %{_mandir}/man1/javah.1$ext javah.1$ext \\ |
401 |
%{_mandir}/man1/javah-%{uniquesuffix %%1}.1$ext \\ |
402 |
--slave %{_mandir}/man1/javap.1$ext javap.1$ext \\ |
403 |
%{_mandir}/man1/javap-%{uniquesuffix %%1}.1$ext \\ |
404 |
--slave %{_mandir}/man1/jcmd.1$ext jcmd.1$ext \\ |
405 |
%{_mandir}/man1/jcmd-%{uniquesuffix %%1}.1$ext \\ |
406 |
--slave %{_mandir}/man1/jconsole.1$ext jconsole.1$ext \\ |
407 |
%{_mandir}/man1/jconsole-%{uniquesuffix %%1}.1$ext \\ |
408 |
--slave %{_mandir}/man1/jdb.1$ext jdb.1$ext \\ |
409 |
%{_mandir}/man1/jdb-%{uniquesuffix %%1}.1$ext \\ |
410 |
--slave %{_mandir}/man1/jdeps.1$ext jdeps.1$ext \\ |
411 |
%{_mandir}/man1/jdeps-%{uniquesuffix %%1}.1$ext \\ |
412 |
--slave %{_mandir}/man1/jhat.1$ext jhat.1$ext \\ |
413 |
%{_mandir}/man1/jhat-%{uniquesuffix %%1}.1$ext \\ |
414 |
--slave %{_mandir}/man1/jinfo.1$ext jinfo.1$ext \\ |
415 |
%{_mandir}/man1/jinfo-%{uniquesuffix %%1}.1$ext \\ |
416 |
--slave %{_mandir}/man1/jmap.1$ext jmap.1$ext \\ |
417 |
%{_mandir}/man1/jmap-%{uniquesuffix %%1}.1$ext \\ |
418 |
--slave %{_mandir}/man1/jps.1$ext jps.1$ext \\ |
419 |
%{_mandir}/man1/jps-%{uniquesuffix %%1}.1$ext \\ |
420 |
--slave %{_mandir}/man1/jrunscript.1$ext jrunscript.1$ext \\ |
421 |
%{_mandir}/man1/jrunscript-%{uniquesuffix %%1}.1$ext \\ |
422 |
--slave %{_mandir}/man1/jsadebugd.1$ext jsadebugd.1$ext \\ |
423 |
%{_mandir}/man1/jsadebugd-%{uniquesuffix %%1}.1$ext \\ |
424 |
--slave %{_mandir}/man1/jstack.1$ext jstack.1$ext \\ |
425 |
%{_mandir}/man1/jstack-%{uniquesuffix %%1}.1$ext \\ |
426 |
--slave %{_mandir}/man1/jstat.1$ext jstat.1$ext \\ |
427 |
%{_mandir}/man1/jstat-%{uniquesuffix %%1}.1$ext \\ |
428 |
--slave %{_mandir}/man1/jstatd.1$ext jstatd.1$ext \\ |
429 |
%{_mandir}/man1/jstatd-%{uniquesuffix %%1}.1$ext \\ |
430 |
--slave %{_mandir}/man1/native2ascii.1$ext native2ascii.1$ext \\ |
431 |
%{_mandir}/man1/native2ascii-%{uniquesuffix %%1}.1$ext \\ |
432 |
--slave %{_mandir}/man1/rmic.1$ext rmic.1$ext \\ |
433 |
%{_mandir}/man1/rmic-%{uniquesuffix %%1}.1$ext \\ |
434 |
--slave %{_mandir}/man1/schemagen.1$ext schemagen.1$ext \\ |
435 |
%{_mandir}/man1/schemagen-%{uniquesuffix %%1}.1$ext \\ |
436 |
--slave %{_mandir}/man1/serialver.1$ext serialver.1$ext \\ |
437 |
%{_mandir}/man1/serialver-%{uniquesuffix %%1}.1$ext \\ |
438 |
--slave %{_mandir}/man1/wsgen.1$ext wsgen.1$ext \\ |
439 |
%{_mandir}/man1/wsgen-%{uniquesuffix %%1}.1$ext \\ |
440 |
--slave %{_mandir}/man1/wsimport.1$ext wsimport.1$ext \\ |
441 |
%{_mandir}/man1/wsimport-%{uniquesuffix %%1}.1$ext \\ |
442 |
--slave %{_mandir}/man1/xjc.1$ext xjc.1$ext \\ |
443 |
%{_mandir}/man1/xjc-%{uniquesuffix %%1}.1$ext |
444 |
|
445 |
for X in %{origin} %{javaver} ; do |
446 |
alternatives \\ |
447 |
--install %{_jvmdir}/java-"$X" \\ |
448 |
java_sdk_"$X" %{_jvmdir}/%{sdkdir %%1} $PRIORITY \\ |
449 |
--slave %{_jvmjardir}/java-"$X" \\ |
450 |
java_sdk_"$X"_exports %{_jvmjardir}/%{sdkdir %%1} |
451 |
done |
452 |
|
453 |
update-alternatives --install %{_jvmdir}/java-%{javaver}-%{origin} java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir %%1} $PRIORITY \\ |
454 |
--slave %{_jvmjardir}/java-%{javaver}-%{origin} java_sdk_%{javaver}_%{origin}_exports %{_jvmjardir}/%{sdkdir %%1} |
455 |
|
456 |
update-desktop-database %{_datadir}/applications &> /dev/null || : |
457 |
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : |
458 |
|
459 |
exit 0 |
460 |
} |
461 |
|
462 |
%global postun_devel() %{expand: |
463 |
alternatives --remove javac %{sdkbindir %%1}/javac |
464 |
alternatives --remove java_sdk_%{origin} %{_jvmdir}/%{sdkdir %%1} |
465 |
alternatives --remove java_sdk_%{javaver} %{_jvmdir}/%{sdkdir %%1} |
466 |
alternatives --remove java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir %%1} |
467 |
|
468 |
update-desktop-database %{_datadir}/applications &> /dev/null || : |
469 |
|
470 |
if [ $1 -eq 0 ] ; then |
471 |
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null |
472 |
%{update_desktop_icons} |
473 |
fi |
474 |
exit 0 |
475 |
} |
476 |
|
477 |
%global posttrans_devel() %{expand: |
478 |
%{update_desktop_icons} |
479 |
} |
480 |
|
481 |
%global post_javadoc() %{expand: |
482 |
|
483 |
PRIORITY=%{priority} |
484 |
if [ "%1" == %{debug_suffix} ]; then |
485 |
let PRIORITY=PRIORITY-1 |
486 |
fi |
487 |
|
488 |
alternatives \\ |
489 |
--install %{_javadocdir}/java javadocdir %{_javadocdir}/%{uniquejavadocdir %%1}/api \\ |
490 |
$PRIORITY |
491 |
exit 0 |
492 |
} |
493 |
|
494 |
%global postun_javadoc() %{expand: |
495 |
alternatives --remove javadocdir %{_javadocdir}/%{uniquejavadocdir %%1}/api |
496 |
exit 0 |
497 |
} |
498 |
|
499 |
%global files_jre() %{expand: |
500 |
%{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}.png |
501 |
%{_datadir}/applications/*policytool%1.desktop |
502 |
} |
503 |
|
504 |
|
505 |
%global files_jre_headless() %{expand: |
506 |
%defattr(-,root,root,-) |
507 |
%license %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/ASSEMBLY_EXCEPTION |
508 |
%license %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/LICENSE |
509 |
%license %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/THIRD_PARTY_README |
510 |
%dir %{_jvmdir}/%{sdkdir %%1} |
511 |
%{_jvmdir}/%{jrelnk %%1} |
512 |
%{_jvmjardir}/%{jrelnk %%1} |
513 |
%{_jvmprivdir}/* |
514 |
%{jvmjardir %%1} |
515 |
%dir %{_jvmdir}/%{jredir %%1}/lib/security |
516 |
%{_jvmdir}/%{jredir %%1}/lib/security/cacerts |
517 |
%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/US_export_policy.jar |
518 |
%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/local_policy.jar |
519 |
%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/java.policy |
520 |
%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/java.security |
521 |
%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/blacklisted.certs |
522 |
%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/logging.properties |
523 |
%{_mandir}/man1/java-%{uniquesuffix %%1}.1* |
524 |
%{_mandir}/man1/jjs-%{uniquesuffix %%1}.1* |
525 |
%{_mandir}/man1/keytool-%{uniquesuffix %%1}.1* |
526 |
%{_mandir}/man1/orbd-%{uniquesuffix %%1}.1* |
527 |
%{_mandir}/man1/pack200-%{uniquesuffix %%1}.1* |
528 |
%{_mandir}/man1/rmid-%{uniquesuffix %%1}.1* |
529 |
%{_mandir}/man1/rmiregistry-%{uniquesuffix %%1}.1* |
530 |
%{_mandir}/man1/servertool-%{uniquesuffix %%1}.1* |
531 |
%{_mandir}/man1/tnameserv-%{uniquesuffix %%1}.1* |
532 |
%{_mandir}/man1/unpack200-%{uniquesuffix %%1}.1* |
533 |
%{_mandir}/man1/policytool-%{uniquesuffix %%1}.1* |
534 |
%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/nss.cfg |
535 |
%ifarch %{jit_arches} |
536 |
%ifnarch %{power64} |
537 |
%attr(664, root, root) %ghost %{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/server/classes.jsa |
538 |
%attr(664, root, root) %ghost %{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/client/classes.jsa |
539 |
%endif |
540 |
%endif |
541 |
%{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/server/ |
542 |
%{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/client/ |
543 |
} |
544 |
|
545 |
%global files_devel() %{expand: |
546 |
%defattr(-,root,root,-) |
547 |
%license %{buildoutputdir %%1}/images/%{j2sdkimage}/ASSEMBLY_EXCEPTION |
548 |
%license %{buildoutputdir %%1}/images/%{j2sdkimage}/LICENSE |
549 |
%license %{buildoutputdir %%1}/images/%{j2sdkimage}/THIRD_PARTY_README |
550 |
%dir %{_jvmdir}/%{sdkdir %%1}/bin |
551 |
%dir %{_jvmdir}/%{sdkdir %%1}/include |
552 |
%dir %{_jvmdir}/%{sdkdir %%1}/lib |
553 |
%{_jvmdir}/%{sdkdir %%1}/bin/* |
554 |
%{_jvmdir}/%{sdkdir %%1}/include/* |
555 |
%{_jvmdir}/%{sdkdir %%1}/lib/* |
556 |
%{_jvmjardir}/%{sdkdir %%1} |
557 |
%{_datadir}/applications/*jconsole%1.desktop |
558 |
%{_mandir}/man1/appletviewer-%{uniquesuffix %%1}.1* |
559 |
%{_mandir}/man1/extcheck-%{uniquesuffix %%1}.1* |
560 |
%{_mandir}/man1/idlj-%{uniquesuffix %%1}.1* |
561 |
%{_mandir}/man1/jar-%{uniquesuffix %%1}.1* |
562 |
%{_mandir}/man1/jarsigner-%{uniquesuffix %%1}.1* |
563 |
%{_mandir}/man1/javac-%{uniquesuffix %%1}.1* |
564 |
%{_mandir}/man1/javadoc-%{uniquesuffix %%1}.1* |
565 |
%{_mandir}/man1/javah-%{uniquesuffix %%1}.1* |
566 |
%{_mandir}/man1/javap-%{uniquesuffix %%1}.1* |
567 |
%{_mandir}/man1/jconsole-%{uniquesuffix %%1}.1* |
568 |
%{_mandir}/man1/jcmd-%{uniquesuffix %%1}.1* |
569 |
%{_mandir}/man1/jdb-%{uniquesuffix %%1}.1* |
570 |
%{_mandir}/man1/jdeps-%{uniquesuffix %%1}.1* |
571 |
%{_mandir}/man1/jhat-%{uniquesuffix %%1}.1* |
572 |
%{_mandir}/man1/jinfo-%{uniquesuffix %%1}.1* |
573 |
%{_mandir}/man1/jmap-%{uniquesuffix %%1}.1* |
574 |
%{_mandir}/man1/jps-%{uniquesuffix %%1}.1* |
575 |
%{_mandir}/man1/jrunscript-%{uniquesuffix %%1}.1* |
576 |
%{_mandir}/man1/jsadebugd-%{uniquesuffix %%1}.1* |
577 |
%{_mandir}/man1/jstack-%{uniquesuffix %%1}.1* |
578 |
%{_mandir}/man1/jstat-%{uniquesuffix %%1}.1* |
579 |
%{_mandir}/man1/jstatd-%{uniquesuffix %%1}.1* |
580 |
%{_mandir}/man1/native2ascii-%{uniquesuffix %%1}.1* |
581 |
%{_mandir}/man1/rmic-%{uniquesuffix %%1}.1* |
582 |
%{_mandir}/man1/schemagen-%{uniquesuffix %%1}.1* |
583 |
%{_mandir}/man1/serialver-%{uniquesuffix %%1}.1* |
584 |
%{_mandir}/man1/wsgen-%{uniquesuffix %%1}.1* |
585 |
%{_mandir}/man1/wsimport-%{uniquesuffix %%1}.1* |
586 |
%{_mandir}/man1/xjc-%{uniquesuffix %%1}.1* |
587 |
%if %{with_systemtap} |
588 |
%dir %{tapsetroot} |
589 |
%dir %{tapsetdir} |
590 |
%{tapsetdir}/*%{version}-%{release}.%{_arch}%1.stp |
591 |
%dir %{_jvmdir}/%{sdkdir %%1}/tapset |
592 |
%{_jvmdir}/%{sdkdir %%1}/tapset/*.stp |
593 |
%endif |
594 |
} |
595 |
|
596 |
%global files_demo() %{expand: |
597 |
%defattr(-,root,root,-) |
598 |
%license %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/LICENSE |
599 |
} |
600 |
|
601 |
%global files_src() %{expand: |
602 |
%defattr(-,root,root,-) |
603 |
%doc README.src |
604 |
%{_jvmdir}/%{sdkdir %%1}/src.zip |
605 |
} |
606 |
|
607 |
%global files_javadoc() %{expand: |
608 |
%defattr(-,root,root,-) |
609 |
%doc %{_javadocdir}/%{uniquejavadocdir %%1} |
610 |
%license %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/LICENSE |
611 |
} |
612 |
|
613 |
%global files_accessibility() %{expand: |
614 |
%{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/libatk-wrapper.so |
615 |
%{_jvmdir}/%{jredir %%1}/lib/ext/java-atk-wrapper.jar |
616 |
%{_jvmdir}/%{jredir %%1}/lib/accessibility.properties |
617 |
} |
618 |
|
619 |
# not-duplicated requires/provides/obsolate for normal/debug packages |
620 |
%global java_rpo() %{expand: |
621 |
Requires: fontconfig |
622 |
Requires: x11-font-type1 |
623 |
|
624 |
# Requires rest of java |
625 |
Requires: %{name}-headless%1 = %{epoch}:%{version}-%{release} |
626 |
#OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} |
627 |
|
628 |
|
629 |
# Standard JPackage base provides. |
630 |
Provides: jre-%{javaver}-%{origin}%1 = %{epoch}:%{version}-%{release} |
631 |
Provides: jre-%{origin}%1 = %{epoch}:%{version}-%{release} |
632 |
Provides: jre-%{javaver}%1 = %{epoch}:%{version}-%{release} |
633 |
Provides: java-%{javaver}%1 = %{epoch}:%{version}-%{release} |
634 |
Provides: jre = %{javaver}%1 |
635 |
Provides: java-%{origin}%1 = %{epoch}:%{version}-%{release} |
636 |
Provides: java%1 = %{epoch}:%{javaver} |
637 |
# Standard JPackage extensions provides. |
638 |
Provides: java-fonts%1 = %{epoch}:%{version} |
639 |
|
640 |
Obsoletes: java-1.7.0-openjdk%1 |
641 |
} |
642 |
|
643 |
%global java_headless_rpo() %{expand: |
644 |
# Require /etc/pki/java/cacerts. |
645 |
#Requires: ca-certificates |
646 |
Requires: rootcerts-java |
647 |
# Require jpackage-utils for ownership of /usr/lib/jvm/ |
648 |
Requires: jpackage-utils |
649 |
# Require zoneinfo data provided by tzdata-java subpackage. |
650 |
Requires: timezone-java >= 2015d |
651 |
# libsctp.so.1 is being `dlopen`ed on demand |
652 |
Requires: lksctp-tools |
653 |
# tool to copy jdk's configs - should be Recommends only, but then only dnf/yum eforce it, not rpm transaction and so no configs are persisted when pure rpm -u is run. I t may be consiedered as regression |
654 |
Requires: copy-jdk-configs >= 1.1-1 |
655 |
#OrderWithRequires: copy-jdk-configs |
656 |
# Post requires alternatives to install tool alternatives. |
657 |
Requires(post): %{_sbindir}/alternatives |
658 |
# Postun requires alternatives to uninstall tool alternatives. |
659 |
Requires(postun): %{_sbindir}/alternatives |
660 |
|
661 |
# Standard JPackage base provides. |
662 |
Provides: jre-%{javaver}-%{origin}-headless%1 = %{epoch}:%{version}-%{release} |
663 |
Provides: jre-%{origin}-headless%1 = %{epoch}:%{version}-%{release} |
664 |
Provides: jre-%{javaver}-headless%1 = %{epoch}:%{version}-%{release} |
665 |
Provides: java-%{javaver}-headless%1 = %{epoch}:%{version}-%{release} |
666 |
Provides: jre-headless%1 = %{epoch}:%{javaver} |
667 |
Provides: java-%{origin}-headless%1 = %{epoch}:%{version}-%{release} |
668 |
Provides: java-headless%1 = %{epoch}:%{javaver} |
669 |
# Standard JPackage extensions provides. |
670 |
Provides: jndi%1 = %{epoch}:%{version} |
671 |
Provides: jndi-ldap%1 = %{epoch}:%{version} |
672 |
Provides: jndi-cos%1 = %{epoch}:%{version} |
673 |
Provides: jndi-rmi%1 = %{epoch}:%{version} |
674 |
Provides: jndi-dns%1 = %{epoch}:%{version} |
675 |
Provides: jaas%1 = %{epoch}:%{version} |
676 |
Provides: jsse%1 = %{epoch}:%{version} |
677 |
Provides: jce%1 = %{epoch}:%{version} |
678 |
Provides: jdbc-stdext%1 = 4.1 |
679 |
Provides: java-sasl%1 = %{epoch}:%{version} |
680 |
|
681 |
Obsoletes: java-1.7.0-openjdk-headless%1 |
682 |
} |
683 |
|
684 |
%global java_devel_rpo() %{expand: |
685 |
# Require base package. |
686 |
Requires: %{name}%1 = %{epoch}:%{version}-%{release} |
687 |
#OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} |
688 |
# Post requires alternatives to install tool alternatives. |
689 |
Requires(post): %{_sbindir}/alternatives |
690 |
# Postun requires alternatives to uninstall tool alternatives. |
691 |
Requires(postun): %{_sbindir}/alternatives |
692 |
|
693 |
# Standard JPackage devel provides. |
694 |
Provides: java-sdk-%{javaver}-%{origin}%1 = %{epoch}:%{version} |
695 |
Provides: java-sdk-%{javaver}%1 = %{epoch}:%{version} |
696 |
Provides: java-sdk-%{origin}%1 = %{epoch}:%{version} |
697 |
Provides: java-sdk%1 = %{epoch}:%{javaver} |
698 |
Provides: java-%{javaver}-devel%1 = %{epoch}:%{version} |
699 |
Provides: java-devel-%{origin}%1 = %{epoch}:%{version} |
700 |
Provides: java-devel%1 = %{epoch}:%{javaver} |
701 |
|
702 |
Obsoletes: java-1.7.0-openjdk-devel%1 |
703 |
} |
704 |
|
705 |
|
706 |
%global java_demo_rpo() %{expand: |
707 |
Requires: %{name}%1 = %{epoch}:%{version}-%{release} |
708 |
#OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} |
709 |
|
710 |
Obsoletes: java-1.7.0-openjdk-demo%1 |
711 |
} |
712 |
|
713 |
%global java_javadoc_rpo() %{expand: |
714 |
#OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} |
715 |
# Post requires alternatives to install javadoc alternative. |
716 |
Requires(post): %{_sbindir}/alternatives |
717 |
# Postun requires alternatives to uninstall javadoc alternative. |
718 |
Requires(postun): %{_sbindir}/alternatives |
719 |
|
720 |
# Standard JPackage javadoc provides. |
721 |
Provides: java-javadoc%1 = %{epoch}:%{version}-%{release} |
722 |
Provides: java-%{javaver}-javadoc%1 = %{epoch}:%{version}-%{release} |
723 |
|
724 |
Obsoletes: java-1.7.0-openjdk-javadoc%1 |
725 |
|
726 |
} |
727 |
|
728 |
%global java_src_rpo() %{expand: |
729 |
Requires: %{name}-headless%1 = %{epoch}:%{version}-%{release} |
730 |
|
731 |
Obsoletes: java-1.7.0-openjdk-src%1 |
732 |
} |
733 |
|
734 |
%global java_accessibility_rpo() %{expand: |
735 |
Requires: java-atk-wrapper |
736 |
Requires: %{name}%1 = %{epoch}:%{version}-%{release} |
737 |
#OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} |
738 |
|
739 |
Obsoletes: java-1.7.0-openjdk-accessibility%1 |
740 |
} |
741 |
|
742 |
# Prevent brp-java-repack-jars from being run. |
743 |
%global __jar_repack 0 |
744 |
|
745 |
Name: java-%{javaver}-%{origin} |
746 |
Version: %{javaver}.%{updatever} |
747 |
Release: %mkrel 1.%{buildver}.1 |
748 |
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons, |
749 |
# and this change was brought into RHEL-4. java-1.5.0-ibm packages |
750 |
# also included the epoch in their virtual provides. This created a |
751 |
# situation where in-the-wild java-1.5.0-ibm packages provided "java = |
752 |
# 1:1.5.0". In RPM terms, "1.6.0 < 1:1.5.0" since 1.6.0 is |
753 |
# interpreted as 0:1.6.0. So the "java >= 1.6.0" requirement would be |
754 |
# satisfied by the 1:1.5.0 packages. Thus we need to set the epoch in |
755 |
# JDK package >= 1.6.0 to 1, and packages referring to JDK virtual |
756 |
# provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0". |
757 |
Epoch: 1 |
758 |
Summary: OpenJDK Runtime Environment |
759 |
Group: Development/Java |
760 |
|
761 |
License: ASL 1.1 and ASL 2.0 and GPL+ and GPLv2 and GPLv2 with exceptions and LGPL+ and LGPLv2 and MPLv1.0 and MPLv1.1 and Public Domain and W3C |
762 |
URL: http://openjdk.java.net/ |
763 |
|
764 |
# aarch64-port now contains integration forest of both aarch64 and normal jdk |
765 |
# Source from upstream OpenJDK8 project. To regenerate, use |
766 |
# VERSION=aarch64-jdk8u101-b14 FILE_NAME_ROOT=aarch64-port-jdk8u-${VERSION} |
767 |
# REPO_ROOT=<path to checked-out repository> generate_source_tarball.sh |
768 |
# where the source is obtained from http://hg.openjdk.java.net/%%{project}/%%{repo} |
769 |
Source0: %{project}-%{repo}-%{revision}.tar.xz |
770 |
|
771 |
# Additional source needed to build under Mageia |
772 |
Source1: 39cd76e9c788.tar.bz2 |
773 |
|
774 |
# Custom README for -src subpackage |
775 |
Source2: README.src |
776 |
|
777 |
# Script to generate Source1 (requires mercurial) |
778 |
Source3: mga-add-missing-files.sh |
779 |
|
780 |
# Use 'generate_tarballs.sh' to generate the following tarballs |
781 |
# They are based on code contained in the IcedTea7 project. |
782 |
|
783 |
# Systemtap tapsets. Zipped up to keep it small. |
784 |
Source8: systemtap-tapset-3.1.0.tar.xz |
785 |
|
786 |
# Desktop files. Adapated from IcedTea. |
787 |
Source9: jconsole.desktop.in |
788 |
Source10: policytool.desktop.in |
789 |
|
790 |
# nss configuration file |
791 |
Source11: nss.cfg |
792 |
|
793 |
# Removed libraries that we link instead |
794 |
Source12: %{name}-remove-intree-libraries.sh |
795 |
|
796 |
# Ensure we aren't using the limited crypto policy |
797 |
Source13: TestCryptoLevel.java |
798 |
|
799 |
# Ensure ECDSA is working |
800 |
Source14: TestECDSA.java |
801 |
|
802 |
Source20: repackReproduciblePolycies.sh |
803 |
|
804 |
# New versions of config files with aarch64 support. This is not upstream yet. |
805 |
Source100: config.guess |
806 |
Source101: config.sub |
807 |
# shenandoah hotpost |
808 |
Source999: aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u111-b16.tar.xz |
809 |
|
810 |
# RPM/distribution specific patches |
811 |
|
812 |
# Accessibility patches |
813 |
# Ignore AWTError when assistive technologies are loaded |
814 |
Patch1: %{name}-accessible-toolkit.patch |
815 |
# Restrict access to java-atk-wrapper classes |
816 |
Patch3: java-atk-wrapper-security.patch |
817 |
# Upstreamable patches |
818 |
# PR2737: Allow multiple initialization of PKCS11 libraries |
819 |
Patch5: multiple-pkcs11-library-init.patch |
820 |
# PR2095, RH1163501: 2048-bit DH upper bound too small for Fedora infrastructure (sync with IcedTea 2.x) |
821 |
Patch504: rh1163501.patch |
822 |
# S4890063, PR2304, RH1214835: HPROF: default text truncated when using doe=n option |
823 |
Patch511: rh1214835.patch |
824 |
# Turn off strict overflow on IndicRearrangementProcessor{,2}.cpp following 8140543: Arrange font actions |
825 |
Patch512: no_strict_overflow.patch |
826 |
# Support for building the SunEC provider with the system NSS installation |
827 |
# PR1983: Support using the system installation of NSS with the SunEC provider |
828 |
# PR2127: SunEC provider crashes when built using system NSS |
829 |
# PR2815: Race condition in SunEC provider with system NSS |
830 |
# PR2899: Don't use WithSeed versions of NSS functions as they don't fully process the seed |
831 |
# PR2934: SunEC provider throwing KeyException with current NSS |
832 |
Patch513: pr1983-jdk.patch |
833 |
Patch514: pr1983-root.patch |
834 |
Patch515: pr2127.patch |
835 |
Patch516: pr2815.patch |
836 |
Patch517: pr2899.patch |
837 |
Patch518: pr2934.patch |
838 |
# S8150954, RH1176206, PR2866: Taking screenshots on x11 composite desktop produces wrong result |
839 |
# In progress: http://mail.openjdk.java.net/pipermail/awt-dev/2016-March/010742.html |
840 |
Patch508: rh1176206-jdk.patch |
841 |
Patch509: rh1176206-root.patch |
842 |
# RH1337583, PR2974: PKCS#10 certificate requests now use CRLF line endings rather than system line endings |
843 |
Patch523: pr2974-rh1337583.patch |
844 |
# PR3083, RH1346460: Regression in SSL debug output without an ECC provider |
845 |
Patch528: pr3083-rh1346460.patch |
846 |
|
847 |
# Arch-specific upstreamable patches |
848 |
# PR2415: JVM -Xmx requirement is too high on s390 |
849 |
Patch100: %{name}-s390-java-opts.patch |
850 |
# Type fixing for s390 |
851 |
Patch102: %{name}-size_t.patch |
852 |
# Use "%z" for size_t on s390 as size_t != intptr_t |
853 |
Patch103: s390-size_t_format_flags.patch |
854 |
|
855 |
# Patches which need backporting to 8u |
856 |
# S8073139, RH1191652; fix name of ppc64le architecture |
857 |
Patch601: %{name}-rh1191652-root.patch |
858 |
Patch602: %{name}-rh1191652-jdk.patch |
859 |
Patch603: %{name}-rh1191652-hotspot-aarch64.patch |
860 |
# Include all sources in src.zip |
861 |
Patch7: include-all-srcs.patch |
862 |
# 8035341: Allow using a system installed libpng |
863 |
Patch202: system-libpng.patch |
864 |
# 8042159: Allow using a system-installed lcms2 |
865 |
Patch203: system-lcms.patch |
866 |
# PR2462: Backport "8074839: Resolve disabled warnings for libunpack and the unpack200 binary" |
867 |
# This fixes printf warnings that lead to build failure with -Werror=format-security from optflags |
868 |
Patch502: pr2462.patch |
869 |
# S8148351, PR2842: Only display resolved symlink for compiler, do not change path |
870 |
Patch506: pr2842-01.patch |
871 |
Patch507: pr2842-02.patch |
872 |
# S8154313: Generated javadoc scattered all over the place |
873 |
Patch400: 8154313.patch |
874 |
# S6260348, PR3066: GTK+ L&F JTextComponent not respecting desktop caret blink rate |
875 |
Patch526: 6260348-pr3066.patch |
876 |
# S8162384, PR3122, RH1358661: Performance regression: bimorphic inlining may be bypassed by type speculation |
877 |
Patch532: 8162384-pr3122-rh1358661.patch |
878 |
|
879 |
# Patches upstream and appearing in 8u111 |
880 |
# S8159244, PR3074: Partially initialized string object created by C2's string concat optimization may escape |
881 |
Patch527: 8159244-pr3074.patch |
882 |
|
883 |
# Patches upstream and appearing in 8u112 |
884 |
# S8044762, PR2960: com/sun/jdi/OptionTest.java test time out |
885 |
Patch521: 8044762-pr2960.patch |
886 |
# S8049226, PR2960: com/sun/jdi/OptionTest.java test times out again |
887 |
Patch522: 8049226-pr2960.patch |
888 |
# 8154210: Zero: Better byte behaviour |
889 |
Patch606: 8154210.patch |
890 |
# S8158260, PR2991, RH1341258: JVM on PPC64 LE crashes due to an illegal instruction in JITed code |
891 |
Patch524: 8158260-pr2991-rh1341258.patch |
892 |
|
893 |
# Patches ineligible for 8u |
894 |
# 8043805: Allow using a system-installed libjpeg |
895 |
Patch201: system-libjpeg.patch |
896 |
# Pathces 204-206 are serving for better check of debug symbols in native liraries |
897 |
Patch204: hotspot-remove-debuglink.patch |
898 |
Patch205: dont-add-unnecessary-debug-links.patch |
899 |
Patch206: hotspot-assembler-debuginfo.patch |
900 |
Patch207: PR3183.patch |
901 |
|
902 |
# Local fixes |
903 |
# PR1834, RH1022017: Reduce curves reported by SSL to those in NSS |
904 |
Patch525: pr1834-rh1022017.patch |
905 |
# RH1367357: lcms2: Out-of-bounds read in Type_MLU_Read() |
906 |
Patch533: rh1367357.patch |
907 |
# Turn on AssumeMP by default on RHEL systems |
908 |
Patch534: always_assumemp.patch |
909 |
|
910 |
# Non-OpenJDK fixes |
911 |
|
912 |
BuildRequires: autoconf |
913 |
BuildRequires: automake |
914 |
BuildRequires: alsa-lib-devel |
915 |
BuildRequires: binutils |
916 |
BuildRequires: cups-devel |
917 |
BuildRequires: desktop-file-utils |
918 |
BuildRequires: elfutils |
919 |
BuildRequires: fontconfig |
920 |
BuildRequires: freetype-devel |
921 |
BuildRequires: giflib-devel |
922 |
BuildRequires: gcc-c++ |
923 |
BuildRequires: gdb |
924 |
BuildRequires: gtk2-devel |
925 |
BuildRequires: lcms2-devel |
926 |
BuildRequires: libjpeg-devel |
927 |
BuildRequires: libpng-devel |
928 |
BuildRequires: libxslt-devel |
929 |
BuildRequires: libx11-devel |
930 |
BuildRequires: libxi-devel |
931 |
BuildRequires: libxinerama-devel |
932 |
BuildRequires: libxt-devel |
933 |
BuildRequires: libxtst-devel |
934 |
# Requirements for setting up the nss.cfg |
935 |
BuildRequires: nss-devel |
936 |
BuildRequires: pkgconfig |
937 |
BuildRequires: x11-proto-devel |
938 |
BuildRequires: zip |
939 |
BuildRequires: java-1.8.0-openjdk-devel |
940 |
# Zero-assembler build requirement. |
941 |
%ifnarch %{jit_arches} |
942 |
BuildRequires: libffi-devel |
943 |
%endif |
944 |
BuildRequires: timezone-java >= 2015d |
945 |
BuildRequires: patch >= 2.7.5 |
946 |
|
947 |
# cacerts build requirement. |
948 |
BuildRequires: openssl |
949 |
%if %{with_systemtap} |
950 |
BuildRequires: systemtap |
951 |
%endif |
952 |
|
953 |
# this is built always, also during debug-only build |
954 |
# when it is built in debug-only, then this package is just placeholder |
955 |
%{java_rpo %{nil}} |
956 |
|
957 |
%description |
958 |
The OpenJDK runtime environment. |
959 |
|
960 |
%if %{include_debug_build} |
961 |
%package debug |
962 |
Summary: OpenJDK Runtime Environment %{debug_on} |
963 |
Group: Development/Java |
964 |
|
965 |
%{java_rpo %{debug_suffix_unquoted}} |
966 |
%description debug |
967 |
The OpenJDK runtime environment. |
968 |
%{debug_warning} |
969 |
%endif |
970 |
|
971 |
%if %{include_normal_build} |
972 |
%package headless |
973 |
Summary: OpenJDK Runtime Environment |
974 |
Group: Development/Java |
975 |
|
976 |
%{java_headless_rpo %{nil}} |
977 |
|
978 |
%description headless |
979 |
The OpenJDK runtime environment without audio and video support. |
980 |
%endif |
981 |
|
982 |
%if %{include_debug_build} |
983 |
%package headless-debug |
984 |
Summary: OpenJDK Runtime Environment %{debug_on} |
985 |
Group: Development/Java |
986 |
|
987 |
%{java_headless_rpo %{debug_suffix_unquoted}} |
988 |
|
989 |
%description headless-debug |
990 |
The OpenJDK runtime environment without audio and video support. |
991 |
%{debug_warning} |
992 |
%endif |
993 |
|
994 |
%if %{include_normal_build} |
995 |
%package devel |
996 |
Summary: OpenJDK Development Environment |
997 |
Group: Development/Java |
998 |
|
999 |
%{java_devel_rpo %{nil}} |
1000 |
|
1001 |
%description devel |
1002 |
The OpenJDK development tools. |
1003 |
%endif |
1004 |
|
1005 |
%if %{include_debug_build} |
1006 |
%package devel-debug |
1007 |
Summary: OpenJDK Development Environment %{debug_on} |
1008 |
Group: Development/Tools |
1009 |
|
1010 |
%{java_devel_rpo %{debug_suffix_unquoted}} |
1011 |
|
1012 |
%description devel-debug |
1013 |
The OpenJDK development tools. |
1014 |
%{debug_warning} |
1015 |
%endif |
1016 |
|
1017 |
%if %{include_normal_build} |
1018 |
%package demo |
1019 |
Summary: OpenJDK Demos |
1020 |
Group: Development/Java |
1021 |
|
1022 |
%{java_demo_rpo %{nil}} |
1023 |
|
1024 |
%description demo |
1025 |
The OpenJDK demos. |
1026 |
%endif |
1027 |
|
1028 |
%if %{include_debug_build} |
1029 |
%package demo-debug |
1030 |
Summary: OpenJDK Demos %{debug_on} |
1031 |
Group: Development/Java |
1032 |
|
1033 |
%{java_demo_rpo %{debug_suffix_unquoted}} |
1034 |
|
1035 |
%description demo-debug |
1036 |
The OpenJDK demos. |
1037 |
%{debug_warning} |
1038 |
%endif |
1039 |
|
1040 |
%if %{include_normal_build} |
1041 |
%package src |
1042 |
Summary: OpenJDK Source Bundle |
1043 |
Group: Development/Java |
1044 |
|
1045 |
%{java_src_rpo %{nil}} |
1046 |
|
1047 |
%description src |
1048 |
The OpenJDK source bundle. |
1049 |
%endif |
1050 |
|
1051 |
%if %{include_debug_build} |
1052 |
%package src-debug |
1053 |
Summary: OpenJDK Source Bundle %{for_debug} |
1054 |
Group: Development/Java |
1055 |
|
1056 |
%{java_src_rpo %{debug_suffix_unquoted}} |
1057 |
|
1058 |
%description src-debug |
1059 |
The OpenJDK source bundle %{for_debug}. |
1060 |
%endif |
1061 |
|
1062 |
%if %{include_normal_build} |
1063 |
%package javadoc |
1064 |
Summary: OpenJDK API Documentation |
1065 |
Group: Documentation |
1066 |
Requires: jpackage-utils |
1067 |
BuildArch: noarch |
1068 |
|
1069 |
%{java_javadoc_rpo %{nil}} |
1070 |
|
1071 |
%description javadoc |
1072 |
The OpenJDK API documentation. |
1073 |
%endif |
1074 |
|
1075 |
%if %{include_debug_build} |
1076 |
%package javadoc-debug |
1077 |
Summary: OpenJDK API Documentation %{for_debug} |
1078 |
Group: Documentation |
1079 |
Requires: jpackage-utils |
1080 |
BuildArch: noarch |
1081 |
|
1082 |
%{java_javadoc_rpo %{debug_suffix_unquoted}} |
1083 |
|
1084 |
%description javadoc-debug |
1085 |
The OpenJDK API documentation %{for_debug}. |
1086 |
%endif |
1087 |
|
1088 |
%if %{include_normal_build} |
1089 |
%package accessibility |
1090 |
Summary: OpenJDK accessibility connector |
1091 |
|
1092 |
%{java_accessibility_rpo %{nil}} |
1093 |
|
1094 |
%description accessibility |
1095 |
Enables accessibility support in OpenJDK by using java-atk-wrapper. This allows |
1096 |
compatible at-spi2 based accessibility programs to work for AWT and Swing-based |
1097 |
programs. |
1098 |
|
1099 |
Please note, the java-atk-wrapper is still in beta, and OpenJDK itself is still |
1100 |
being tuned to be working with accessibility features. There are known issues |
1101 |
with accessibility on, so please do not install this package unless you really |
1102 |
need to. |
1103 |
%endif |
1104 |
|
1105 |
%if %{include_debug_build} |
1106 |
%package accessibility-debug |
1107 |
Summary: OpenJDK accessibility connector %{for_debug} |
1108 |
|
1109 |
%{java_accessibility_rpo %{debug_suffix_unquoted}} |
1110 |
|
1111 |
%description accessibility-debug |
1112 |
See normal java-%{version}-openjdk-accessibility description. |
1113 |
%endif |
1114 |
|
1115 |
%prep |
1116 |
if [ %{include_normal_build} -eq 0 -o %{include_normal_build} -eq 1 ] ; then |
1117 |
echo "include_normal_build is %{include_normal_build}" |
1118 |
else |
1119 |
echo "include_normal_build is %{include_normal_build}, thats invalid. Use 1 for yes or 0 for no" |
1120 |
exit 11 |
1121 |
fi |
1122 |
if [ %{include_debug_build} -eq 0 -o %{include_debug_build} -eq 1 ] ; then |
1123 |
echo "include_debug_build is %{include_debug_build}" |
1124 |
else |
1125 |
echo "include_debug_build is %{include_debug_build}, thats invalid. Use 1 for yes or 0 for no" |
1126 |
exit 12 |
1127 |
fi |
1128 |
if [ %{include_debug_build} -eq 0 -a %{include_normal_build} -eq 0 ] ; then |
1129 |
echo "you have disabled both include_debug_build and include_debug_build. no go." |
1130 |
exit 13 |
1131 |
fi |
1132 |
%setup -q -c -n %{uniquesuffix ""} -T -a 0 |
1133 |
# Add the missing files to be able to build under Mageia |
1134 |
tar xjf %{SOURCE1} -C openjdk/jdk --strip-components=1 --overwrite |
1135 |
# https://bugzilla.redhat.com/show_bug.cgi?id=1189084 |
1136 |
prioritylength=`expr length %{priority}` |
1137 |
if [ $prioritylength -ne 7 ] ; then |
1138 |
echo "priority must be 7 digits in total, violated" |
1139 |
exit 14 |
1140 |
fi |
1141 |
# For old patches |
1142 |
ln -s openjdk jdk8 |
1143 |
%if %{use_shenandoah_hotspot} |
1144 |
#on intels, repalce hotpost by shenandoah-able hotspot |
1145 |
pushd openjdk |
1146 |
tar -xf %{SOURCE999} |
1147 |
rm -rf hotspot |
1148 |
cp -r openjdk/hotspot . |
1149 |
rm -rf openjdk |
1150 |
popd |
1151 |
%endif |
1152 |
|
1153 |
cp %{SOURCE2} . |
1154 |
|
1155 |
# replace outdated configure guess script |
1156 |
# |
1157 |
# the configure macro will do this too, but it also passes a few flags not |
1158 |
# supported by openjdk configure script |
1159 |
cp %{SOURCE100} openjdk/common/autoconf/build-aux/ |
1160 |
cp %{SOURCE101} openjdk/common/autoconf/build-aux/ |
1161 |
|
1162 |
# OpenJDK patches |
1163 |
|
1164 |
# Remove libraries that are linked |
1165 |
sh %{SOURCE12} |
1166 |
|
1167 |
%patch201 |
1168 |
%patch202 |
1169 |
%patch203 |
1170 |
%patch204 |
1171 |
%patch205 |
1172 |
%patch206 |
1173 |
%patch207 |
1174 |
|
1175 |
%patch1 |
1176 |
%patch3 |
1177 |
%patch5 |
1178 |
%patch7 |
1179 |
|
1180 |
# s390 build fixes |
1181 |
%patch100 |
1182 |
%patch102 |
1183 |
%patch103 |
1184 |
|
1185 |
# ppc64le fixes |
1186 |
%patch524 |
1187 |
|
1188 |
# Zero fixes. |
1189 |
%patch606 |
1190 |
|
1191 |
%patch603 |
1192 |
%patch601 |
1193 |
%patch602 |
1194 |
|
1195 |
%patch502 |
1196 |
%patch504 |
1197 |
%patch506 |
1198 |
%patch507 |
1199 |
%patch508 |
1200 |
%patch509 |
1201 |
%patch511 |
1202 |
%patch512 |
1203 |
#patch513 |
1204 |
#patch514 |
1205 |
#patch515 |
1206 |
#patch516 |
1207 |
#patch517 |
1208 |
%patch521 |
1209 |
%patch522 |
1210 |
%patch523 |
1211 |
%patch525 |
1212 |
%patch526 |
1213 |
%patch527 |
1214 |
%patch528 |
1215 |
%patch532 |
1216 |
%patch533 |
1217 |
|
1218 |
# RHEL-only patches |
1219 |
%if 0%{?rhel} |
1220 |
%patch534 |
1221 |
%endif |
1222 |
|
1223 |
# Extract systemtap tapsets |
1224 |
%if %{with_systemtap} |
1225 |
tar -x -I xz -f %{SOURCE8} |
1226 |
%if %{include_debug_build} |
1227 |
cp -r tapset tapset%{debug_suffix} |
1228 |
%endif |
1229 |
|
1230 |
|
1231 |
for suffix in %{build_loop} ; do |
1232 |
for file in "tapset"$suffix/*.in; do |
1233 |
OUTPUT_FILE=`echo $file | sed -e s:%{javaver}\.stp\.in$:%{version}-%{release}.%{_arch}.stp:g` |
1234 |
sed -e s:@ABS_SERVER_LIBJVM_SO@:%{_jvmdir}/%{sdkdir $suffix}/jre/lib/%{archinstall}/server/libjvm.so:g $file > $file.1 |
1235 |
# TODO find out which architectures other than i686 have a client vm |
1236 |
%ifarch %{ix86} |
1237 |
sed -e s:@ABS_CLIENT_LIBJVM_SO@:%{_jvmdir}/%{sdkdir $suffix}/jre/lib/%{archinstall}/client/libjvm.so:g $file.1 > $OUTPUT_FILE |
1238 |
%else |
1239 |
sed -e '/@ABS_CLIENT_LIBJVM_SO@/d' $file.1 > $OUTPUT_FILE |
1240 |
%endif |
1241 |
sed -i -e s:@ABS_JAVA_HOME_DIR@:%{_jvmdir}/%{sdkdir $suffix}:g $OUTPUT_FILE |
1242 |
sed -i -e s:@INSTALL_ARCH_DIR@:%{archinstall}:g $OUTPUT_FILE |
1243 |
sed -i -e s:@prefix@:%{_jvmdir}/%{sdkdir $suffix}/:g $OUTPUT_FILE |
1244 |
done |
1245 |
done |
1246 |
# systemtap tapsets ends |
1247 |
%endif |
1248 |
|
1249 |
# Prepare desktop files |
1250 |
for suffix in %{build_loop} ; do |
1251 |
for file in %{SOURCE9} %{SOURCE10} ; do |
1252 |
FILE=`basename $file | sed -e s:\.in$::g` |
1253 |
EXT="${FILE##*.}" |
1254 |
NAME="${FILE%.*}" |
1255 |
OUTPUT_FILE=$NAME$suffix.$EXT |
1256 |
sed -e s:#JAVA_HOME#:%{sdkbindir $suffix}:g $file > $OUTPUT_FILE |
1257 |
sed -i -e s:#JRE_HOME#:%{jrebindir $suffix}:g $OUTPUT_FILE |
1258 |
sed -i -e s:#ARCH#:%{version}-%{release}.%{_arch}$suffix:g $OUTPUT_FILE |
1259 |
done |
1260 |
done |
1261 |
|
1262 |
# this is check which controls, that latest java.security is included in post(_headless) |
1263 |
%{check_sum_presented_in_spec openjdk/jdk/src/share/lib/security/java.security-linux} |
1264 |
|
1265 |
|
1266 |
%build |
1267 |
# How many cpu's do we have? |
1268 |
export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) |
1269 |
export NUM_PROC=${NUM_PROC:-1} |
1270 |
%if 0%{?_smp_ncpus_max} |
1271 |
# Honor %%_smp_ncpus_max |
1272 |
[ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max} |
1273 |
%endif |
1274 |
|
1275 |
# Build IcedTea and OpenJDK. |
1276 |
%ifarch s390x sparc64 alpha %{power64} %{aarch64} |
1277 |
export ARCH_DATA_MODEL=64 |
1278 |
%endif |
1279 |
%ifarch alpha |
1280 |
export CFLAGS="$CFLAGS -mieee" |
1281 |
%endif |
1282 |
|
1283 |
# We use ourcppflags because the OpenJDK build seems to |
1284 |
# pass these to the HotSpot C++ compiler... |
1285 |
EXTRA_CFLAGS="%ourcppflags" |
1286 |
# Disable various optimizations to fix miscompliation. See: |
1287 |
# - https://bugzilla.redhat.com/show_bug.cgi?id=1120792 |
1288 |
EXTRA_CPP_FLAGS="%ourcppflags -fno-tree-vrp" |
1289 |
# PPC/PPC64 needs -fno-tree-vectorize since -O3 would |
1290 |
# otherwise generate wrong code producing segfaults. |
1291 |
%ifarch %{power64} ppc |
1292 |
EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-tree-vectorize" |
1293 |
# fix rpmlint warnings |
1294 |
EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-strict-aliasing" |
1295 |
%endif |
1296 |
export EXTRA_CFLAGS |
1297 |
|
1298 |
(cd openjdk/common/autoconf |
1299 |
bash ./autogen.sh |
1300 |
) |
1301 |
|
1302 |
for suffix in %{build_loop} ; do |
1303 |
if [ "$suffix" = "%{debug_suffix}" ] ; then |
1304 |
debugbuild=%{debugbuild_parameter} |
1305 |
else |
1306 |
debugbuild=%{normalbuild_parameter} |
1307 |
fi |
1308 |
|
1309 |
mkdir -p %{buildoutputdir $suffix} |
1310 |
pushd %{buildoutputdir $suffix} |
1311 |
|
1312 |
bash ../../configure \ |
1313 |
%ifnarch %{jit_arches} |
1314 |
--with-jvm-variants=zero \ |
1315 |
%endif |
1316 |
--disable-zip-debug-info \ |
1317 |
--with-milestone="fcs" \ |
1318 |
--with-update-version=%{updatever} \ |
1319 |
--with-build-number=%{buildver} \ |
1320 |
--with-boot-jdk=/usr/lib/jvm/java-openjdk \ |
1321 |
--with-debug-level=$debugbuild \ |
1322 |
--enable-unlimited-crypto \ |
1323 |
--with-zlib=system \ |
1324 |
--with-libjpeg=system \ |
1325 |
--with-giflib=system \ |
1326 |
--with-libpng=system \ |
1327 |
--with-lcms=bundled \ |
1328 |
--with-stdc++lib=dynamic \ |
1329 |
--with-extra-cxxflags="$EXTRA_CPP_FLAGS" \ |
1330 |
--with-extra-cflags="$EXTRA_CFLAGS" \ |
1331 |
--with-extra-ldflags="%{ourldflags}" \ |
1332 |
--with-num-cores="$NUM_PROC" |
1333 |
|
1334 |
cat spec.gmk |
1335 |
cat hotspot-spec.gmk |
1336 |
|
1337 |
# The combination of FULL_DEBUG_SYMBOLS=0 and ALT_OBJCOPY=/does_not_exist |
1338 |
# disables FDS for all build configs and reverts to pre-FDS make logic. |
1339 |
# STRIP_POLICY=none says don't do any stripping. DEBUG_BINARIES=true says |
1340 |
# ignore all the other logic about which debug options and just do '-g'. |
1341 |
|
1342 |
make \ |
1343 |
DEBUG_BINARIES=true \ |
1344 |
JAVAC_FLAGS=-g \ |
1345 |
STRIP_POLICY=no_strip \ |
1346 |
POST_STRIP_CMD="" \ |
1347 |
LOG=trace \ |
1348 |
%{targets} |
1349 |
|
1350 |
# the build (erroneously) removes read permissions from some jars |
1351 |
# this is a regression in OpenJDK 7 (our compiler): |
1352 |
# http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437 |
1353 |
find images/%{j2sdkimage} -iname '*.jar' -exec chmod ugo+r {} \; |
1354 |
chmod ugo+r images/%{j2sdkimage}/lib/ct.sym |
1355 |
|
1356 |
# remove redundant *diz and *debuginfo files |
1357 |
find images/%{j2sdkimage} -iname '*.diz' -exec rm {} \; |
1358 |
find images/%{j2sdkimage} -iname '*.debuginfo' -exec rm {} \; |
1359 |
|
1360 |
popd >& /dev/null |
1361 |
|
1362 |
# Install nss.cfg right away as we will be using the JRE above |
1363 |
export JAVA_HOME=$(pwd)/%{buildoutputdir $suffix}/images/%{j2sdkimage} |
1364 |
|
1365 |
# Install nss.cfg right away as we will be using the JRE above |
1366 |
install -m 644 %{SOURCE11} $JAVA_HOME/jre/lib/security/ |
1367 |
|
1368 |
# Use system-wide tzdata |
1369 |
rm $JAVA_HOME/jre/lib/tzdb.dat |
1370 |
ln -s %{_datadir}/javazi-1.8/tzdb.dat $JAVA_HOME/jre/lib/tzdb.dat |
1371 |
|
1372 |
#build cycles |
1373 |
done |
1374 |
|
1375 |
%check |
1376 |
|
1377 |
# We test debug first as it will give better diagnostics on a crash |
1378 |
for suffix in %{rev_build_loop} ; do |
1379 |
|
1380 |
export JAVA_HOME=$(pwd)/%{buildoutputdir $suffix}/images/%{j2sdkimage} |
1381 |
|
1382 |
# check java.security in this build is also in this specfile |
1383 |
%{check_sum_presented_in_spec $JAVA_HOME/jre/lib/security/java.security} |
1384 |
|
1385 |
# Check unlimited policy has been used |
1386 |
$JAVA_HOME/bin/javac -d . %{SOURCE13} |
1387 |
$JAVA_HOME/bin/java TestCryptoLevel |
1388 |
|
1389 |
# Check ECC is working |
1390 |
$JAVA_HOME/bin/javac -d . %{SOURCE14} |
1391 |
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||") |
1392 |
|
1393 |
# Check debug symbols are present and can identify code |
1394 |
find "$JAVA_HOME" -iname '*.so' -print0 | while read -d $'\0' lib |
1395 |
do |
1396 |
if [ -f "$lib" ] ; then |
1397 |
echo "Testing $lib for debug symbols" |
1398 |
# All these tests rely on RPM failing the build if the exit code of any set |
1399 |
# of piped commands is non-zero. |
1400 |
|
1401 |
# Test for .debug_* sections in the shared object. This is the main test. |
1402 |
# Stripped objects will not contain these. |
1403 |
eu-readelf -S "$lib" | grep "] .debug_" |
1404 |
test $(eu-readelf -S "$lib" | egrep "\]\ .debug_(info|abbrev)" | wc --lines) == 2 |
1405 |
|
1406 |
# Test FILE symbols. These will most likely be removed by anyting that |
1407 |
# manipulates symbol tables because it's generally useless. So a nice test |
1408 |
# that nothing has messed with symbols. |
1409 |
old_IFS="$IFS" |
1410 |
IFS=$'\n' |
1411 |
for line in $(eu-readelf -s "$lib" | grep "00000000 0 FILE LOCAL DEFAULT") |
1412 |
do |
1413 |
# We expect to see .cpp files, except for architectures like aarch64 and |
1414 |
# s390 where we expect .o and .oS files |
1415 |
echo "$line" | egrep "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|oS))?$" |
1416 |
done |
1417 |
IFS="$old_IFS" |
1418 |
|
1419 |
# If this is the JVM, look for javaCalls.(cpp|o) in FILEs, for extra sanity checking. |
1420 |
if [ "`basename $lib`" = "libjvm.so" ]; then |
1421 |
eu-readelf -s "$lib" | \ |
1422 |
egrep "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" |
1423 |
fi |
1424 |
|
1425 |
# Test that there are no .gnu_debuglink sections pointing to another |
1426 |
# debuginfo file. There shouldn't be any debuginfo files, so the link makes |
1427 |
# no sense either. |
1428 |
eu-readelf -S "$lib" | grep 'gnu' |
1429 |
if eu-readelf -S "$lib" | grep '] .gnu_debuglink' | grep PROGBITS; then |
1430 |
echo "bad .gnu_debuglink section." |
1431 |
eu-readelf -x .gnu_debuglink "$lib" |
1432 |
false |
1433 |
fi |
1434 |
fi |
1435 |
done |
1436 |
|
1437 |
# Make sure gdb can do a backtrace based on line numbers on libjvm.so |
1438 |
gdb -q "$JAVA_HOME/bin/java" <<EOF | tee gdb.out |
1439 |
handle SIGSEGV pass nostop noprint |
1440 |
set breakpoint pending on |
1441 |
break javaCalls.cpp:1 |
1442 |
commands 1 |
1443 |
backtrace |
1444 |
quit |
1445 |
end |
1446 |
run -version |
1447 |
EOF |
1448 |
grep 'JavaCallWrapper::JavaCallWrapper' gdb.out |
1449 |
|
1450 |
# Check src.zip has all sources. See RHBZ#1130490 |
1451 |
jar -tf $JAVA_HOME/src.zip | grep 'sun.misc.Unsafe' |
1452 |
|
1453 |
# Check class files include useful debugging information |
1454 |
$JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from" |
1455 |
$JAVA_HOME/bin/javap -l java.lang.Object | grep LineNumberTable |
1456 |
$JAVA_HOME/bin/javap -l java.lang.Object | grep LocalVariableTable |
1457 |
|
1458 |
# Check generated class files include useful debugging information |
1459 |
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep "Compiled from" |
1460 |
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LineNumberTable |
1461 |
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable |
1462 |
done |
1463 |
|
1464 |
%install |
1465 |
STRIP_KEEP_SYMTAB=libjvm* |
1466 |
|
1467 |
for suffix in %{build_loop} ; do |
1468 |
|
1469 |
pushd %{buildoutputdir $suffix}/images/%{j2sdkimage} |
1470 |
|
1471 |
#install jsa directories so we can owe them |
1472 |
mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/%{archinstall}/server/ |
1473 |
mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/%{archinstall}/client/ |
1474 |
|
1475 |
# Install main files. |
1476 |
install -d -m 755 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix} |
1477 |
cp -a bin include lib src.zip $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix} |
1478 |
install -d -m 755 $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix} |
1479 |
cp -a jre/bin jre/lib $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix} |
1480 |
|
1481 |
%if %{with_systemtap} |
1482 |
# Install systemtap support files. |
1483 |
install -dm 755 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/tapset |
1484 |
# note, that uniquesuffix is in BUILD dir in this case |
1485 |
cp -a $RPM_BUILD_DIR/%{uniquesuffix ""}/tapset$suffix/*.stp $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/tapset/ |
1486 |
pushd $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/tapset/ |
1487 |
tapsetFiles=`ls *.stp` |
1488 |
popd |
1489 |
install -d -m 755 $RPM_BUILD_ROOT%{tapsetdir} |
1490 |
pushd $RPM_BUILD_ROOT%{tapsetdir} |
1491 |
RELATIVE=$(%{abs2rel} %{_jvmdir}/%{sdkdir $suffix}/tapset %{tapsetdir}) |
1492 |
for name in $tapsetFiles ; do |
1493 |
targetName=`echo $name | sed "s/.stp/$suffix.stp/"` |
1494 |
ln -sf $RELATIVE/$name $targetName |
1495 |
done |
1496 |
popd |
1497 |
%endif |
1498 |
|
1499 |
# Install cacerts symlink. |
1500 |
rm -f $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/security/cacerts |
1501 |
pushd $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/security |
1502 |
RELATIVE=$(%{abs2rel} %{_sysconfdir}/pki/java \ |
1503 |
%{_jvmdir}/%{jredir $suffix}/lib/security) |
1504 |
ln -sf $RELATIVE/cacerts . |
1505 |
popd |
1506 |
|
1507 |
# Install extension symlinks. |
1508 |
install -d -m 755 $RPM_BUILD_ROOT%{jvmjardir $suffix} |
1509 |
pushd $RPM_BUILD_ROOT%{jvmjardir $suffix} |
1510 |
RELATIVE=$(%{abs2rel} %{_jvmdir}/%{jredir $suffix}/lib %{jvmjardir $suffix}) |
1511 |
ln -sf $RELATIVE/jsse.jar jsse-%{version}.jar |
1512 |
ln -sf $RELATIVE/jce.jar jce-%{version}.jar |
1513 |
ln -sf $RELATIVE/rt.jar jndi-%{version}.jar |
1514 |
ln -sf $RELATIVE/rt.jar jndi-ldap-%{version}.jar |
1515 |
ln -sf $RELATIVE/rt.jar jndi-cos-%{version}.jar |
1516 |
ln -sf $RELATIVE/rt.jar jndi-rmi-%{version}.jar |
1517 |
ln -sf $RELATIVE/rt.jar jaas-%{version}.jar |
1518 |
ln -sf $RELATIVE/rt.jar jdbc-stdext-%{version}.jar |
1519 |
ln -sf jdbc-stdext-%{version}.jar jdbc-stdext-3.0.jar |
1520 |
ln -sf $RELATIVE/rt.jar sasl-%{version}.jar |
1521 |
for jar in *-%{version}.jar |
1522 |
do |
1523 |
if [ x%{version} != x%{javaver} ] |
1524 |
then |
1525 |
ln -sf $jar $(echo $jar | sed "s|-%{version}.jar|-%{javaver}.jar|g") |
1526 |
fi |
1527 |
ln -sf $jar $(echo $jar | sed "s|-%{version}.jar|.jar|g") |
1528 |
done |
1529 |
popd |
1530 |
|
1531 |
# Install JCE policy symlinks. |
1532 |
install -d -m 755 $RPM_BUILD_ROOT%{_jvmprivdir}/%{uniquesuffix $suffix}/jce/vanilla |
1533 |
|
1534 |
# Install versioned symlinks. |
1535 |
pushd $RPM_BUILD_ROOT%{_jvmdir} |
1536 |
ln -sf %{jredir $suffix} %{jrelnk $suffix} |
1537 |
popd |
1538 |
|
1539 |
pushd $RPM_BUILD_ROOT%{_jvmjardir} |
1540 |
ln -sf %{sdkdir $suffix} %{jrelnk $suffix} |
1541 |
popd |
1542 |
|
1543 |
# Remove javaws man page |
1544 |
rm -f man/man1/javaws* |
1545 |
|
1546 |
# Install man pages. |
1547 |
install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1 |
1548 |
for manpage in man/man1/* |
1549 |
do |
1550 |
# Convert man pages to UTF8 encoding. |
1551 |
iconv -f ISO_8859-1 -t UTF8 $manpage -o $manpage.tmp |
1552 |
mv -f $manpage.tmp $manpage |
1553 |
install -m 644 -p $manpage $RPM_BUILD_ROOT%{_mandir}/man1/$(basename \ |
1554 |
$manpage .1)-%{uniquesuffix $suffix}.1 |
1555 |
done |
1556 |
|
1557 |
# Install demos and samples. |
1558 |
cp -a demo $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix} |
1559 |
mkdir -p sample/rmi |
1560 |
if [ ! -e sample/rmi/java-rmi.cgi ] ; then |
1561 |
# hack to allow --short-circuit on install |
1562 |
mv bin/java-rmi.cgi sample/rmi |
1563 |
fi |
1564 |
cp -a sample $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix} |
1565 |
|
1566 |
popd |
1567 |
|
1568 |
|
1569 |
# Install Javadoc documentation. |
1570 |
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir} |
1571 |
cp -a %{buildoutputdir $suffix}/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir $suffix} |
1572 |
|
1573 |
# Install icons and menu entries. |
1574 |
for s in 16 24 32 48 ; do |
1575 |
install -D -p -m 644 \ |
1576 |
openjdk/jdk/src/solaris/classes/sun/awt/X11/java-icon${s}.png \ |
1577 |
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps/java-%{javaver}.png |
1578 |
done |
1579 |
|
1580 |
# Install desktop files. |
1581 |
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/{applications,pixmaps} |
1582 |
for e in jconsole$suffix policytool$suffix ; do |
1583 |
desktop-file-install --vendor=%{uniquesuffix $suffix} --mode=644 \ |
1584 |
--dir=$RPM_BUILD_ROOT%{_datadir}/applications $e.desktop |
1585 |
done |
1586 |
|
1587 |
# Install /etc/.java/.systemPrefs/ directory |
1588 |
# See https://bugzilla.redhat.com/show_bug.cgi?id=741821 |
1589 |
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/.java/.systemPrefs |
1590 |
|
1591 |
# Find JRE directories. |
1592 |
find $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix} -type d \ |
1593 |
| grep -v jre/lib/security \ |
1594 |
| sed 's|'$RPM_BUILD_ROOT'|%dir |' \ |
1595 |
> %{name}.files-headless"$suffix" |
1596 |
# Find JRE files. |
1597 |
find $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix} -type f -o -type l \ |
1598 |
| grep -v jre/lib/security \ |
1599 |
| sed 's|'$RPM_BUILD_ROOT'||' \ |
1600 |
> %{name}.files.all"$suffix" |
1601 |
#split %%{name}.files to %%{name}.files-headless and %%{name}.files |
1602 |
#see https://bugzilla.redhat.com/show_bug.cgi?id=875408 |
1603 |
NOT_HEADLESS=\ |
1604 |
"%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libjsoundalsa.so |
1605 |
%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libpulse-java.so |
1606 |
%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libsplashscreen.so |
1607 |
%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libawt_xawt.so |
1608 |
%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libjawt.so |
1609 |
%{_jvmdir}/%{uniquesuffix $suffix}/jre/bin/policytool" |
1610 |
#filter %%{name}.files from %%{name}.files.all to %%{name}.files-headless |
1611 |
ALL=`cat %{name}.files.all"$suffix"` |
1612 |
for file in $ALL ; do |
1613 |
INLCUDE="NO" ; |
1614 |
for blacklist in $NOT_HEADLESS ; do |
1615 |
#we can not match normally, because rpmbuild will evaluate !0 result as script failure |
1616 |
q=`expr match "$file" "$blacklist"` || : |
1617 |
l=`expr length "$blacklist"` || : |
1618 |
if [ $q -eq $l ]; then |
1619 |
INLCUDE="YES" ; |
1620 |
fi; |
1621 |
done |
1622 |
if [ "x$INLCUDE" = "xNO" ]; then |
1623 |
echo "$file" >> %{name}.files-headless"$suffix" |
1624 |
else |
1625 |
echo "$file" >> %{name}.files"$suffix" |
1626 |
fi |
1627 |
done |
1628 |
# Find demo directories. |
1629 |
find $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/demo \ |
1630 |
$RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/sample -type d \ |
1631 |
| sed 's|'$RPM_BUILD_ROOT'|%dir |' \ |
1632 |
> %{name}-demo.files"$suffix" |
1633 |
|
1634 |
# FIXME: remove SONAME entries from demo DSOs. See |
1635 |
# https://bugzilla.redhat.com/show_bug.cgi?id=436497 |
1636 |
|
1637 |
# Find non-documentation demo files. |
1638 |
find $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/demo \ |
1639 |
$RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/sample \ |
1640 |
-type f -o -type l | sort \ |
1641 |
| grep -v README \ |
1642 |
| sed 's|'$RPM_BUILD_ROOT'||' \ |
1643 |
>> %{name}-demo.files"$suffix" |
1644 |
# Find documentation demo files. |
1645 |
find $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/demo \ |
1646 |
$RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/sample \ |
1647 |
-type f -o -type l | sort \ |
1648 |
| grep README \ |
1649 |
| sed 's|'$RPM_BUILD_ROOT'||' \ |
1650 |
| sed 's|^|%doc |' \ |
1651 |
>> %{name}-demo.files"$suffix" |
1652 |
|
1653 |
# intentionally after the files generation, as it goes to separate package |
1654 |
# Create links which leads to separately installed java-atk-bridge and allow configuration |
1655 |
# links points to java-atk-wrapper - an dependence |
1656 |
pushd $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir $suffix}/lib/%{archinstall} |
1657 |
ln -s %{_libdir}/java-atk-wrapper/libatk-wrapper.so.0 libatk-wrapper.so |
1658 |
popd |
1659 |
pushd $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir $suffix}/lib/ext |
1660 |
ln -s %{_libdir}/java-atk-wrapper/java-atk-wrapper.jar java-atk-wrapper.jar |
1661 |
popd |
1662 |
pushd $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir $suffix}/lib/ |
1663 |
echo "#Config file to enable java-atk-wrapper" > accessibility.properties |
1664 |
echo "" >> accessibility.properties |
1665 |
echo "assistive_technologies=org.GNOME.Accessibility.AtkWrapper" >> accessibility.properties |
1666 |
echo "" >> accessibility.properties |
1667 |
popd |
1668 |
|
1669 |
bash %{SOURCE20} $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir $suffix} %{javaver} |
1670 |
# https://bugzilla.redhat.com/show_bug.cgi?id=1183793 |
1671 |
touch -t 201401010000 $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir $suffix}/lib/security/java.security |
1672 |
|
1673 |
# end, dual install |
1674 |
done |
1675 |
|
1676 |
%if %{include_normal_build} |
1677 |
# intentioanlly only for non-debug |
1678 |
%pretrans headless -p <lua> |
1679 |
-- see https://bugzilla.redhat.com/show_bug.cgi?id=1038092 for whole issue |
1680 |
-- see https://bugzilla.redhat.com/show_bug.cgi?id=1290388 for pretrans over pre |
1681 |
-- if copy-jdk-configs is in transaction, it installs in pretrans to temp |
1682 |
-- if copy_jdk_configs is in temp, then it means that copy-jdk-configs is in tranasction and so is |
1683 |
-- preferred over one in %%{_libexecdir}. If it is not in transaction, then depends |
1684 |
-- whether copy-jdk-configs is installed or not. If so, then configs are copied |
1685 |
-- (copy_jdk_configs from %%{_libexecdir} used) or not copied at all |
1686 |
local posix = require "posix" |
1687 |
local debug = false |
1688 |
|
1689 |
SOURCE1 = "%{rpm_state_dir}/copy_jdk_configs.lua" |
1690 |
SOURCE2 = "%{_libexecdir}/copy_jdk_configs.lua" |
1691 |
|
1692 |
local stat1 = posix.stat(SOURCE1, "type"); |
1693 |
local stat2 = posix.stat(SOURCE2, "type"); |
1694 |
|
1695 |
if (stat1 ~= nil) then |
1696 |
if (debug) then |
1697 |
print(SOURCE1 .." exists - copy-jdk-configs in transaction, using this one.") |
1698 |
end; |
1699 |
package.path = package.path .. ";" .. SOURCE1 |
1700 |
else |
1701 |
if (stat2 ~= nil) then |
1702 |
if (debug) then |
1703 |
print(SOURCE2 .." exists - copy-jdk-configs alrady installed and NOT in transation. Using.") |
1704 |
end; |
1705 |
package.path = package.path .. ";" .. SOURCE2 |
1706 |
else |
1707 |
if (debug) then |
1708 |
print(SOURCE1 .." does NOT exists") |
1709 |
print(SOURCE2 .." does NOT exists") |
1710 |
print("No config files will be copied") |
1711 |
end |
1712 |
return |
1713 |
end |
1714 |
end |
1715 |
-- run contetn of included file with fake args |
1716 |
arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}"} |
1717 |
require "copy_jdk_configs.lua" |
1718 |
|
1719 |
%post headless |
1720 |
%{post_headless %{nil}} |
1721 |
|
1722 |
|
1723 |
%postun headless |
1724 |
%{postun_headless %{nil}} |
1725 |
|
1726 |
%post devel |
1727 |
%{post_devel %{nil}} |
1728 |
|
1729 |
%postun devel |
1730 |
%{postun_devel %{nil}} |
1731 |
|
1732 |
%post javadoc |
1733 |
%{post_javadoc %{nil}} |
1734 |
|
1735 |
%postun javadoc |
1736 |
%{postun_javadoc %{nil}} |
1737 |
%endif |
1738 |
|
1739 |
|
1740 |
|
1741 |
|
1742 |
|
1743 |
|
1744 |
%if %{include_normal_build} |
1745 |
%files -f %{name}.files |
1746 |
# main package builds always |
1747 |
%{files_jre %{nil}} |
1748 |
%else |
1749 |
%files |
1750 |
# placeholder |
1751 |
%endif |
1752 |
|
1753 |
|
1754 |
%if %{include_normal_build} |
1755 |
%files headless -f %{name}.files-headless |
1756 |
# important note, see https://bugzilla.redhat.com/show_bug.cgi?id=1038092 for whole issue |
1757 |
# all config/norepalce files (and more) have to be declared in pretrans. See pretrans |
1758 |
%{files_jre_headless %{nil}} |
1759 |
|
1760 |
%files devel |
1761 |
%{files_devel %{nil}} |
1762 |
|
1763 |
%files demo -f %{name}-demo.files |
1764 |
%{files_demo %{nil}} |
1765 |
|
1766 |
%files src |
1767 |
%{files_src %{nil}} |
1768 |
|
1769 |
%files javadoc |
1770 |
%{files_javadoc %{nil}} |
1771 |
|
1772 |
%files accessibility |
1773 |
%{files_accessibility %{nil}} |
1774 |
%endif |
1775 |
|
1776 |
%if %{include_debug_build} |
1777 |
%files debug -f %{name}.files-debug |
1778 |
%{files_jre %{debug_suffix_unquoted}} |
1779 |
|
1780 |
%files headless-debug -f %{name}.files-headless-debug |
1781 |
%{files_jre_headless %{debug_suffix_unquoted}} |
1782 |
|
1783 |
%files devel-debug |
1784 |
%{files_devel %{debug_suffix_unquoted}} |
1785 |
|
1786 |
%files demo-debug -f %{name}-demo.files-debug |
1787 |
%{files_demo %{debug_suffix_unquoted}} |
1788 |
|
1789 |
%files src-debug |
1790 |
%{files_src %{debug_suffix_unquoted}} |
1791 |
|
1792 |
%files javadoc-debug |
1793 |
%{files_javadoc %{debug_suffix_unquoted}} |
1794 |
|
1795 |
%files accessibility-debug |
1796 |
%{files_accessibility %{debug_suffix_unquoted}} |
1797 |
%endif |
1798 |
|
1799 |
|