/[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 995525 - (show annotations) (download)
Fri Mar 25 19:38:02 2016 UTC (8 years, 1 month ago) by luigiwalser
File size: 57226 byte(s)
SILENT: disable all patches related to system nss
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
851 # Non-OpenJDK fixes
852 Patch300: jstack-pr1845.patch
853
854 BuildRequires: autoconf
855 BuildRequires: automake
856 BuildRequires: alsa-lib-devel
857 BuildRequires: binutils
858 BuildRequires: cups-devel
859 BuildRequires: desktop-file-utils
860 BuildRequires: fontconfig
861 BuildRequires: freetype-devel
862 BuildRequires: giflib-devel
863 BuildRequires: gcc-c++
864 BuildRequires: gtk2-devel
865 BuildRequires: lcms2-devel
866 BuildRequires: libjpeg-devel
867 BuildRequires: libpng-devel
868 BuildRequires: libxslt-devel
869 BuildRequires: libx11-devel
870 BuildRequires: libxi-devel
871 BuildRequires: libxinerama-devel
872 BuildRequires: libxt-devel
873 BuildRequires: libxtst-devel
874 # Requirements for setting up the nss.cfg
875 BuildRequires: nss-devel
876 BuildRequires: pkgconfig
877 BuildRequires: x11-proto-devel
878 BuildRequires: zip
879 BuildRequires: java-1.8.0-openjdk-devel
880 # Zero-assembler build requirement.
881 %ifnarch %{jit_arches}
882 BuildRequires: libffi-devel
883 %endif
884 BuildRequires: timezone-java >= 2015d
885 BuildRequires: patch >= 2.7.5
886
887 # cacerts build requirement.
888 BuildRequires: openssl
889 %if %{with_systemtap}
890 BuildRequires: systemtap
891 %endif
892
893 # this is built always, also during debug-only build
894 # when it is built in debug-only, then this package is just placeholder
895 %{java_rpo %{nil}}
896
897 %description
898 The OpenJDK runtime environment.
899
900 %if %{include_debug_build}
901 %package debug
902 Summary: OpenJDK Runtime Environment %{debug_on}
903 Group: Development/Java
904
905 %{java_rpo %{debug_suffix_unquoted}}
906 %description debug
907 The OpenJDK runtime environment.
908 %{debug_warning}
909 %endif
910
911 %if %{include_normal_build}
912 %package headless
913 Summary: OpenJDK Runtime Environment
914 Group: Development/Java
915
916 %{java_headless_rpo %{nil}}
917
918 %description headless
919 The OpenJDK runtime environment without audio and video support.
920 %endif
921
922 %if %{include_debug_build}
923 %package headless-debug
924 Summary: OpenJDK Runtime Environment %{debug_on}
925 Group: Development/Java
926
927 %{java_headless_rpo %{debug_suffix_unquoted}}
928
929 %description headless-debug
930 The OpenJDK runtime environment without audio and video support.
931 %{debug_warning}
932 %endif
933
934 %if %{include_normal_build}
935 %package devel
936 Summary: OpenJDK Development Environment
937 Group: Development/Java
938
939 %{java_devel_rpo %{nil}}
940
941 %description devel
942 The OpenJDK development tools.
943 %endif
944
945 %if %{include_debug_build}
946 %package devel-debug
947 Summary: OpenJDK Development Environment %{debug_on}
948 Group: Development/Tools
949
950 %{java_devel_rpo %{debug_suffix_unquoted}}
951
952 %description devel-debug
953 The OpenJDK development tools.
954 %{debug_warning}
955 %endif
956
957 %if %{include_normal_build}
958 %package demo
959 Summary: OpenJDK Demos
960 Group: Development/Java
961
962 %{java_demo_rpo %{nil}}
963
964 %description demo
965 The OpenJDK demos.
966 %endif
967
968 %if %{include_debug_build}
969 %package demo-debug
970 Summary: OpenJDK Demos %{debug_on}
971 Group: Development/Java
972
973 %{java_demo_rpo %{debug_suffix_unquoted}}
974
975 %description demo-debug
976 The OpenJDK demos.
977 %{debug_warning}
978 %endif
979
980 %if %{include_normal_build}
981 %package src
982 Summary: OpenJDK Source Bundle
983 Group: Development/Java
984
985 %{java_src_rpo %{nil}}
986
987 %description src
988 The OpenJDK source bundle.
989 %endif
990
991 %if %{include_debug_build}
992 %package src-debug
993 Summary: OpenJDK Source Bundle %{for_debug}
994 Group: Development/Java
995
996 %{java_src_rpo %{debug_suffix_unquoted}}
997
998 %description src-debug
999 The OpenJDK source bundle %{for_debug}.
1000 %endif
1001
1002 %if %{include_normal_build}
1003 %package javadoc
1004 Summary: OpenJDK API Documentation
1005 Group: Documentation
1006 Requires: jpackage-utils
1007 BuildArch: noarch
1008
1009 %{java_javadoc_rpo %{nil}}
1010
1011 %description javadoc
1012 The OpenJDK API documentation.
1013 %endif
1014
1015 %if %{include_debug_build}
1016 %package javadoc-debug
1017 Summary: OpenJDK API Documentation %{for_debug}
1018 Group: Documentation
1019 Requires: jpackage-utils
1020 BuildArch: noarch
1021
1022 %{java_javadoc_rpo %{debug_suffix_unquoted}}
1023
1024 %description javadoc-debug
1025 The OpenJDK API documentation %{for_debug}.
1026 %endif
1027
1028 %if %{include_normal_build}
1029 %package accessibility
1030 Summary: OpenJDK accessibility connector
1031
1032 %{java_accessibility_rpo %{nil}}
1033
1034 %description accessibility
1035 Enables accessibility support in OpenJDK by using java-atk-wrapper. This allows
1036 compatible at-spi2 based accessibility programs to work for AWT and Swing-based
1037 programs.
1038
1039 Please note, the java-atk-wrapper is still in beta, and OpenJDK itself is still
1040 being tuned to be working with accessibility features. There are known issues
1041 with accessibility on, so please do not install this package unless you really
1042 need to.
1043 %endif
1044
1045 %if %{include_debug_build}
1046 %package accessibility-debug
1047 Summary: OpenJDK accessibility connector %{for_debug}
1048
1049 %{java_accessibility_rpo %{debug_suffix_unquoted}}
1050
1051 %description accessibility-debug
1052 See normal java-%{version}-openjdk-accessibility description.
1053 %endif
1054
1055 %prep
1056 if [ %{include_normal_build} -eq 0 -o %{include_normal_build} -eq 1 ] ; then
1057 echo "include_normal_build is %{include_normal_build}"
1058 else
1059 echo "include_normal_build is %{include_normal_build}, thats invalid. Use 1 for yes or 0 for no"
1060 exit 11
1061 fi
1062 if [ %{include_debug_build} -eq 0 -o %{include_debug_build} -eq 1 ] ; then
1063 echo "include_debug_build is %{include_debug_build}"
1064 else
1065 echo "include_debug_build is %{include_debug_build}, thats invalid. Use 1 for yes or 0 for no"
1066 exit 12
1067 fi
1068 if [ %{include_debug_build} -eq 0 -a %{include_normal_build} -eq 0 ] ; then
1069 echo "you have disabled both include_debug_build and include_debug_build. no go."
1070 exit 13
1071 fi
1072 %setup -q -c -n %{uniquesuffix ""} -T -a 0
1073 # https://bugzilla.redhat.com/show_bug.cgi?id=1189084
1074 prioritylength=`expr length %{priority}`
1075 if [ $prioritylength -ne 7 ] ; then
1076 echo "priority must be 7 digits in total, violated"
1077 exit 14
1078 fi
1079 # For old patches
1080 ln -s openjdk jdk8
1081
1082 cp %{SOURCE2} .
1083
1084 # replace outdated configure guess script
1085 #
1086 # the configure macro will do this too, but it also passes a few flags not
1087 # supported by openjdk configure script
1088 cp %{SOURCE100} openjdk/common/autoconf/build-aux/
1089 cp %{SOURCE101} openjdk/common/autoconf/build-aux/
1090
1091 # OpenJDK patches
1092
1093 # Remove libraries that are linked
1094 sh %{SOURCE12}
1095
1096 %patch201
1097 %patch202
1098 %patch203
1099
1100 %patch1
1101 %patch3
1102 %patch5
1103 %patch7
1104
1105 # s390 build fixes
1106 %patch100
1107 %patch102
1108 %patch103
1109
1110 # aarch64 build fixes
1111 %patch106
1112
1113 # Zero PPC fixes.
1114 %patch403
1115
1116 %patch603
1117 %patch601
1118 %patch602
1119 %patch605
1120
1121 %patch502
1122 %patch504
1123 %patch505
1124 %patch506
1125 %patch507
1126 %patch508
1127 %patch509
1128 %patch511
1129 %patch512
1130 #patch513
1131 #patch514
1132 #patch515
1133 #patch516
1134
1135 # Extract systemtap tapsets
1136 %if %{with_systemtap}
1137 tar xzf %{SOURCE8}
1138 %patch300
1139 %if %{include_debug_build}
1140 cp -r tapset tapset%{debug_suffix}
1141 %endif
1142
1143
1144 for suffix in %{build_loop} ; do
1145 for file in "tapset"$suffix/*.in; do
1146 OUTPUT_FILE=`echo $file | sed -e s:%{javaver}\.stp\.in$:%{version}-%{release}.%{_arch}.stp:g`
1147 sed -e s:@ABS_SERVER_LIBJVM_SO@:%{_jvmdir}/%{sdkdir $suffix}/jre/lib/%{archinstall}/server/libjvm.so:g $file > $file.1
1148 # TODO find out which architectures other than i686 have a client vm
1149 %ifarch %{ix86}
1150 sed -e s:@ABS_CLIENT_LIBJVM_SO@:%{_jvmdir}/%{sdkdir $suffix}/jre/lib/%{archinstall}/client/libjvm.so:g $file.1 > $OUTPUT_FILE
1151 %else
1152 sed -e '/@ABS_CLIENT_LIBJVM_SO@/d' $file.1 > $OUTPUT_FILE
1153 %endif
1154 sed -i -e s:@ABS_JAVA_HOME_DIR@:%{_jvmdir}/%{sdkdir $suffix}:g $OUTPUT_FILE
1155 sed -i -e s:@INSTALL_ARCH_DIR@:%{archinstall}:g $OUTPUT_FILE
1156 done
1157 done
1158 # systemtap tapsets ends
1159 %endif
1160
1161 # Prepare desktop files
1162 for suffix in %{build_loop} ; do
1163 for file in %{SOURCE9} %{SOURCE10} ; do
1164 FILE=`basename $file | sed -e s:\.in$::g`
1165 EXT="${FILE##*.}"
1166 NAME="${FILE%.*}"
1167 OUTPUT_FILE=$NAME$suffix.$EXT
1168 sed -e s:#JAVA_HOME#:%{sdkbindir $suffix}:g $file > $OUTPUT_FILE
1169 sed -i -e s:#JRE_HOME#:%{jrebindir $suffix}:g $OUTPUT_FILE
1170 sed -i -e s:#ARCH#:%{version}-%{release}.%{_arch}$suffix:g $OUTPUT_FILE
1171 done
1172 done
1173
1174 %build
1175 # How many cpu's do we have?
1176 export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :)
1177 export NUM_PROC=${NUM_PROC:-1}
1178 %if 0%{?_smp_ncpus_max}
1179 # Honor %%_smp_ncpus_max
1180 [ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max}
1181 %endif
1182
1183 # Build IcedTea and OpenJDK.
1184 %ifarch s390x sparc64 alpha %{power64} %{aarch64}
1185 export ARCH_DATA_MODEL=64
1186 %endif
1187 %ifarch alpha
1188 export CFLAGS="$CFLAGS -mieee"
1189 %endif
1190
1191 # We use ourcppflags because the OpenJDK build seems to
1192 # pass these to the HotSpot C++ compiler...
1193 EXTRA_CFLAGS="%ourcppflags"
1194 # Disable various optimizations to fix miscompliation. See:
1195 # - https://bugzilla.redhat.com/show_bug.cgi?id=1120792
1196 EXTRA_CPP_FLAGS="%ourcppflags -fno-tree-vrp"
1197 # PPC/PPC64 needs -fno-tree-vectorize since -O3 would
1198 # otherwise generate wrong code producing segfaults.
1199 %ifarch %{power64} ppc
1200 EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-tree-vectorize"
1201 # fix rpmlint warnings
1202 EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-strict-aliasing"
1203 %endif
1204 export EXTRA_CFLAGS
1205
1206 (cd openjdk/common/autoconf
1207 bash ./autogen.sh
1208 )
1209
1210 for suffix in %{build_loop} ; do
1211 if [ "$suffix" = "%{debug_suffix}" ] ; then
1212 debugbuild=%{debugbuild_parameter}
1213 else
1214 debugbuild=%{normalbuild_parameter}
1215 fi
1216
1217 mkdir -p %{buildoutputdir $suffix}
1218 pushd %{buildoutputdir $suffix}
1219
1220 bash ../../configure \
1221 %ifnarch %{jit_arches}
1222 --with-jvm-variants=zero \
1223 %endif
1224 --disable-zip-debug-info \
1225 --with-milestone="fcs" \
1226 --with-update-version=%{updatever} \
1227 --with-build-number=%{buildver} \
1228 --with-boot-jdk=/usr/lib/jvm/java-openjdk \
1229 --with-debug-level=$debugbuild \
1230 --enable-unlimited-crypto \
1231 --with-zlib=system \
1232 --with-libjpeg=system \
1233 --with-giflib=system \
1234 --with-libpng=system \
1235 --with-lcms=bundled \
1236 --with-stdc++lib=dynamic \
1237 --with-extra-cxxflags="$EXTRA_CPP_FLAGS" \
1238 --with-extra-cflags="$EXTRA_CFLAGS" \
1239 --with-extra-ldflags="%{ourldflags}" \
1240 --with-num-cores="$NUM_PROC"
1241
1242 cat spec.gmk
1243 cat hotspot-spec.gmk
1244
1245 # The combination of FULL_DEBUG_SYMBOLS=0 and ALT_OBJCOPY=/does_not_exist
1246 # disables FDS for all build configs and reverts to pre-FDS make logic.
1247 # STRIP_POLICY=none says don't do any stripping. DEBUG_BINARIES=true says
1248 # ignore all the other logic about which debug options and just do '-g'.
1249
1250 make \
1251 DEBUG_BINARIES=true \
1252 JAVAC_FLAGS=-g \
1253 STRIP_POLICY=no_strip \
1254 POST_STRIP_CMD="" \
1255 LOG=trace \
1256 %{targets}
1257
1258 # the build (erroneously) removes read permissions from some jars
1259 # this is a regression in OpenJDK 7 (our compiler):
1260 # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437
1261 find images/%{j2sdkimage} -iname '*.jar' -exec chmod ugo+r {} \;
1262 chmod ugo+r images/%{j2sdkimage}/lib/ct.sym
1263
1264 # remove redundant *diz and *debuginfo files
1265 find images/%{j2sdkimage} -iname '*.diz' -exec rm {} \;
1266 find images/%{j2sdkimage} -iname '*.debuginfo' -exec rm {} \;
1267
1268 popd >& /dev/null
1269
1270 # Install nss.cfg right away as we will be using the JRE above
1271 export JAVA_HOME=$(pwd)/%{buildoutputdir $suffix}/images/%{j2sdkimage}
1272
1273 # Install nss.cfg right away as we will be using the JRE above
1274 install -m 644 %{SOURCE11} $JAVA_HOME/jre/lib/security/
1275
1276 # Use system-wide tzdata
1277 rm $JAVA_HOME/jre/lib/tzdb.dat
1278 ln -s %{_datadir}/javazi-1.8/tzdb.dat $JAVA_HOME/jre/lib/tzdb.dat
1279
1280 #build cycles
1281 done
1282
1283 %check
1284
1285 # We test debug first as it will give better diagnostics on a crash
1286 for suffix in %{rev_build_loop} ; do
1287
1288 export JAVA_HOME=$(pwd)/%{buildoutputdir $suffix}/images/%{j2sdkimage}
1289
1290 # Check unlimited policy has been used
1291 $JAVA_HOME/bin/javac -d . %{SOURCE13}
1292 $JAVA_HOME/bin/java TestCryptoLevel
1293
1294 # Check debug symbols are present and can identify code
1295 SERVER_JVM="$JAVA_HOME/jre/lib/%{archinstall}/server/libjvm.so"
1296 if [ -f "$SERVER_JVM" ] ; then
1297 nm -aCl "$SERVER_JVM" | grep javaCalls.cpp
1298 fi
1299 CLIENT_JVM="$JAVA_HOME/jre/lib/%{archinstall}/client/libjvm.so"
1300 if [ -f "$CLIENT_JVM" ] ; then
1301 nm -aCl "$CLIENT_JVM" | grep javaCalls.cpp
1302 fi
1303 ZERO_JVM="$JAVA_HOME/jre/lib/%{archinstall}/zero/libjvm.so"
1304 if [ -f "$ZERO_JVM" ] ; then
1305 nm -aCl "$ZERO_JVM" | grep javaCalls.cpp
1306 fi
1307
1308 # Check src.zip has all sources. See RHBZ#1130490
1309 jar -tf $JAVA_HOME/src.zip | grep 'sun.misc.Unsafe'
1310
1311 # Check class files include useful debugging information
1312 $JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from"
1313 $JAVA_HOME/bin/javap -l java.lang.Object | grep LineNumberTable
1314 $JAVA_HOME/bin/javap -l java.lang.Object | grep LocalVariableTable
1315
1316 # Check generated class files include useful debugging information
1317 $JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep "Compiled from"
1318 $JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LineNumberTable
1319 $JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable
1320 done
1321
1322 %install
1323 STRIP_KEEP_SYMTAB=libjvm*
1324
1325 for suffix in %{build_loop} ; do
1326
1327 pushd %{buildoutputdir $suffix}/images/%{j2sdkimage}
1328
1329 #install jsa directories so we can owe them
1330 mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/%{archinstall}/server/
1331 mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/%{archinstall}/client/
1332
1333 # Install main files.
1334 install -d -m 755 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}
1335 cp -a bin include lib src.zip $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}
1336 install -d -m 755 $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}
1337 cp -a jre/bin jre/lib $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}
1338
1339 %if %{with_systemtap}
1340 # Install systemtap support files.
1341 install -dm 755 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/tapset
1342 # note, that uniquesuffix is in BUILD dir in this case
1343 cp -a $RPM_BUILD_DIR/%{uniquesuffix ""}/tapset$suffix/*.stp $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/tapset/
1344 pushd $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/tapset/
1345 tapsetFiles=`ls *.stp`
1346 popd
1347 install -d -m 755 $RPM_BUILD_ROOT%{tapsetdir}
1348 pushd $RPM_BUILD_ROOT%{tapsetdir}
1349 RELATIVE=$(%{abs2rel} %{_jvmdir}/%{sdkdir $suffix}/tapset %{tapsetdir})
1350 for name in $tapsetFiles ; do
1351 targetName=`echo $name | sed "s/.stp/$suffix.stp/"`
1352 ln -sf $RELATIVE/$name $targetName
1353 done
1354 popd
1355 %endif
1356
1357 # Install cacerts symlink.
1358 rm -f $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/security/cacerts
1359 pushd $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/security
1360 RELATIVE=$(%{abs2rel} %{_sysconfdir}/pki/java \
1361 %{_jvmdir}/%{jredir $suffix}/lib/security)
1362 ln -sf $RELATIVE/cacerts .
1363 popd
1364
1365 # Install extension symlinks.
1366 install -d -m 755 $RPM_BUILD_ROOT%{jvmjardir $suffix}
1367 pushd $RPM_BUILD_ROOT%{jvmjardir $suffix}
1368 RELATIVE=$(%{abs2rel} %{_jvmdir}/%{jredir $suffix}/lib %{jvmjardir $suffix})
1369 ln -sf $RELATIVE/jsse.jar jsse-%{version}.jar
1370 ln -sf $RELATIVE/jce.jar jce-%{version}.jar
1371 ln -sf $RELATIVE/rt.jar jndi-%{version}.jar
1372 ln -sf $RELATIVE/rt.jar jndi-ldap-%{version}.jar
1373 ln -sf $RELATIVE/rt.jar jndi-cos-%{version}.jar
1374 ln -sf $RELATIVE/rt.jar jndi-rmi-%{version}.jar
1375 ln -sf $RELATIVE/rt.jar jaas-%{version}.jar
1376 ln -sf $RELATIVE/rt.jar jdbc-stdext-%{version}.jar
1377 ln -sf jdbc-stdext-%{version}.jar jdbc-stdext-3.0.jar
1378 ln -sf $RELATIVE/rt.jar sasl-%{version}.jar
1379 for jar in *-%{version}.jar
1380 do
1381 if [ x%{version} != x%{javaver} ]
1382 then
1383 ln -sf $jar $(echo $jar | sed "s|-%{version}.jar|-%{javaver}.jar|g")
1384 fi
1385 ln -sf $jar $(echo $jar | sed "s|-%{version}.jar|.jar|g")
1386 done
1387 popd
1388
1389 # Install JCE policy symlinks.
1390 install -d -m 755 $RPM_BUILD_ROOT%{_jvmprivdir}/%{uniquesuffix $suffix}/jce/vanilla
1391
1392 # Install versioned symlinks.
1393 pushd $RPM_BUILD_ROOT%{_jvmdir}
1394 ln -sf %{jredir $suffix} %{jrelnk $suffix}
1395 popd
1396
1397 pushd $RPM_BUILD_ROOT%{_jvmjardir}
1398 ln -sf %{sdkdir $suffix} %{jrelnk $suffix}
1399 popd
1400
1401 # Remove javaws man page
1402 rm -f man/man1/javaws*
1403
1404 # Install man pages.
1405 install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1
1406 for manpage in man/man1/*
1407 do
1408 # Convert man pages to UTF8 encoding.
1409 iconv -f ISO_8859-1 -t UTF8 $manpage -o $manpage.tmp
1410 mv -f $manpage.tmp $manpage
1411 install -m 644 -p $manpage $RPM_BUILD_ROOT%{_mandir}/man1/$(basename \
1412 $manpage .1)-%{uniquesuffix $suffix}.1
1413 done
1414
1415 # Install demos and samples.
1416 cp -a demo $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}
1417 mkdir -p sample/rmi
1418 if [ ! -e sample/rmi/java-rmi.cgi ] ; then
1419 # hack to allow --short-circuit on install
1420 mv bin/java-rmi.cgi sample/rmi
1421 fi
1422 cp -a sample $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}
1423
1424 popd
1425
1426
1427 # Install Javadoc documentation.
1428 install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}
1429 cp -a %{buildoutputdir $suffix}/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir $suffix}
1430
1431 # Install icons and menu entries.
1432 for s in 16 24 32 48 ; do
1433 install -D -p -m 644 \
1434 openjdk/jdk/src/solaris/classes/sun/awt/X11/java-icon${s}.png \
1435 $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps/java-%{javaver}.png
1436 done
1437
1438 # Install desktop files.
1439 install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/{applications,pixmaps}
1440 for e in jconsole$suffix policytool$suffix ; do
1441 desktop-file-install --vendor=%{uniquesuffix $suffix} --mode=644 \
1442 --dir=$RPM_BUILD_ROOT%{_datadir}/applications $e.desktop
1443 done
1444
1445 # Install /etc/.java/.systemPrefs/ directory
1446 # See https://bugzilla.redhat.com/show_bug.cgi?id=741821
1447 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/.java/.systemPrefs
1448
1449 # Find JRE directories.
1450 find $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix} -type d \
1451 | grep -v jre/lib/security \
1452 | sed 's|'$RPM_BUILD_ROOT'|%dir |' \
1453 > %{name}.files-headless"$suffix"
1454 # Find JRE files.
1455 find $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix} -type f -o -type l \
1456 | grep -v jre/lib/security \
1457 | sed 's|'$RPM_BUILD_ROOT'||' \
1458 > %{name}.files.all"$suffix"
1459 #split %%{name}.files to %%{name}.files-headless and %%{name}.files
1460 #see https://bugzilla.redhat.com/show_bug.cgi?id=875408
1461 NOT_HEADLESS=\
1462 "%{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libjsoundalsa.so
1463 %{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libpulse-java.so
1464 %{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libsplashscreen.so
1465 %{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libawt_xawt.so
1466 %{_jvmdir}/%{uniquesuffix $suffix}/jre/lib/%{archinstall}/libjawt.so
1467 %{_jvmdir}/%{uniquesuffix $suffix}/jre/bin/policytool"
1468 #filter %%{name}.files from %%{name}.files.all to %%{name}.files-headless
1469 ALL=`cat %{name}.files.all"$suffix"`
1470 for file in $ALL ; do
1471 INLCUDE="NO" ;
1472 for blacklist in $NOT_HEADLESS ; do
1473 #we can not match normally, because rpmbuild will evaluate !0 result as script failure
1474 q=`expr match "$file" "$blacklist"` || :
1475 l=`expr length "$blacklist"` || :
1476 if [ $q -eq $l ]; then
1477 INLCUDE="YES" ;
1478 fi;
1479 done
1480 if [ "x$INLCUDE" = "xNO" ]; then
1481 echo "$file" >> %{name}.files-headless"$suffix"
1482 else
1483 echo "$file" >> %{name}.files"$suffix"
1484 fi
1485 done
1486 # Find demo directories.
1487 find $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/demo \
1488 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/sample -type d \
1489 | sed 's|'$RPM_BUILD_ROOT'|%dir |' \
1490 > %{name}-demo.files"$suffix"
1491
1492 # FIXME: remove SONAME entries from demo DSOs. See
1493 # https://bugzilla.redhat.com/show_bug.cgi?id=436497
1494
1495 # Find non-documentation demo files.
1496 find $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/demo \
1497 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/sample \
1498 -type f -o -type l | sort \
1499 | grep -v README \
1500 | sed 's|'$RPM_BUILD_ROOT'||' \
1501 >> %{name}-demo.files"$suffix"
1502 # Find documentation demo files.
1503 find $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/demo \
1504 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/sample \
1505 -type f -o -type l | sort \
1506 | grep README \
1507 | sed 's|'$RPM_BUILD_ROOT'||' \
1508 | sed 's|^|%doc |' \
1509 >> %{name}-demo.files"$suffix"
1510
1511 # intentionally after the files generation, as it goes to separate package
1512 # Create links which leads to separately installed java-atk-bridge and allow configuration
1513 # links points to java-atk-wrapper - an dependence
1514 pushd $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir $suffix}/lib/%{archinstall}
1515 ln -s %{_libdir}/java-atk-wrapper/libatk-wrapper.so.0 libatk-wrapper.so
1516 popd
1517 pushd $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir $suffix}/lib/ext
1518 ln -s %{_libdir}/java-atk-wrapper/java-atk-wrapper.jar java-atk-wrapper.jar
1519 popd
1520 pushd $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir $suffix}/lib/
1521 echo "#Config file to enable java-atk-wrapper" > accessibility.properties
1522 echo "" >> accessibility.properties
1523 echo "assistive_technologies=org.GNOME.Accessibility.AtkWrapper" >> accessibility.properties
1524 echo "" >> accessibility.properties
1525 popd
1526
1527 bash %{SOURCE20} $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir $suffix} %{javaver}
1528 # https://bugzilla.redhat.com/show_bug.cgi?id=1183793
1529 touch -t 201401010000 $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir $suffix}/lib/security/java.security
1530
1531 # end, dual install
1532 done
1533
1534 %if %{include_normal_build}
1535 # intentioanlly only for non-debug
1536 %pretrans headless -p <lua>
1537 -- see https://bugzilla.redhat.com/show_bug.cgi?id=1038092 for whole issue
1538 -- see https://bugzilla.redhat.com/show_bug.cgi?id=1290388 for pretrans over pre
1539 -- if copy-jdk-configs is in transaction, it installs in pretrans to temp
1540 -- if copy_jdk_configs is in temp, then it means that copy-jdk-configs is in tranasction and so is
1541 -- preferred over one in %%{_libexecdir}. If it is not in transaction, then depends
1542 -- whether copy-jdk-configs is installed or not. If so, then configs are copied
1543 -- (copy_jdk_configs from %%{_libexecdir} used) or not copied at all
1544 local posix = require "posix"
1545 local debug = false
1546
1547 SOURCE1 = "%{rpm_state_dir}/copy_jdk_configs.lua"
1548 SOURCE2 = "%{_libexecdir}/copy_jdk_configs.lua"
1549
1550 local stat1 = posix.stat(SOURCE1, "type");
1551 local stat2 = posix.stat(SOURCE2, "type");
1552
1553 if (stat1 ~= nil) then
1554 if (debug) then
1555 print(SOURCE1 .." exists - copy-jdk-configs in transaction, using this one.")
1556 end;
1557 package.path = package.path .. ";" .. SOURCE1
1558 else
1559 if (stat2 ~= nil) then
1560 if (debug) then
1561 print(SOURCE2 .." exists - copy-jdk-configs alrady installed and NOT in transation. Using.")
1562 end;
1563 package.path = package.path .. ";" .. SOURCE2
1564 else
1565 if (debug) then
1566 print(SOURCE1 .." does NOT exists")
1567 print(SOURCE2 .." does NOT exists")
1568 print("No config files will be copied")
1569 end
1570 return
1571 end
1572 end
1573 -- run contetn of included file with fake args
1574 arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}"}
1575 require "copy_jdk_configs.lua"
1576
1577 %post headless
1578 %{post_headless %{nil}}
1579
1580
1581 %postun headless
1582 %{postun_headless %{nil}}
1583
1584 %post devel
1585 %{post_devel %{nil}}
1586
1587 %postun devel
1588 %{postun_devel %{nil}}
1589
1590 %post javadoc
1591 %{post_javadoc %{nil}}
1592
1593 %postun javadoc
1594 %{postun_javadoc %{nil}}
1595 %endif
1596
1597
1598
1599
1600
1601
1602 %if %{include_normal_build}
1603 %files -f %{name}.files
1604 # main package builds always
1605 %{files_jre %{nil}}
1606 %else
1607 %files
1608 # placeholder
1609 %endif
1610
1611
1612 %if %{include_normal_build}
1613 %files headless -f %{name}.files-headless
1614 # important note, see https://bugzilla.redhat.com/show_bug.cgi?id=1038092 for whole issue
1615 # all config/norepalce files (and more) have to be declared in pretrans. See pretrans
1616 %{files_jre_headless %{nil}}
1617
1618 %files devel
1619 %{files_devel %{nil}}
1620
1621 %files demo -f %{name}-demo.files
1622 %{files_demo %{nil}}
1623
1624 %files src
1625 %{files_src %{nil}}
1626
1627 %files javadoc
1628 %{files_javadoc %{nil}}
1629
1630 %files accessibility
1631 %{files_accessibility %{nil}}
1632 %endif
1633
1634 %if %{include_debug_build}
1635 %files debug -f %{name}.files-debug
1636 %{files_jre %{debug_suffix_unquoted}}
1637
1638 %files headless-debug -f %{name}.files-headless-debug
1639 %{files_jre_headless %{debug_suffix_unquoted}}
1640
1641 %files devel-debug
1642 %{files_devel %{debug_suffix_unquoted}}
1643
1644 %files demo-debug -f %{name}-demo.files-debug
1645 %{files_demo %{debug_suffix_unquoted}}
1646
1647 %files src-debug
1648 %{files_src %{debug_suffix_unquoted}}
1649
1650 %files javadoc-debug
1651 %{files_javadoc %{debug_suffix_unquoted}}
1652
1653 %files accessibility-debug
1654 %{files_accessibility %{debug_suffix_unquoted}}
1655 %endif
1656
1657

  ViewVC Help
Powered by ViewVC 1.1.30