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

  ViewVC Help
Powered by ViewVC 1.1.30