/[packages]/updates/8/java-1.8.0-openjdk/current/SPECS/java-1.8.0-openjdk.spec
ViewVC logotype

Contents of /updates/8/java-1.8.0-openjdk/current/SPECS/java-1.8.0-openjdk.spec

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30