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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30