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

  ViewVC Help
Powered by ViewVC 1.1.30