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

Contents of /cauldron/java-1.8.0-openjdk/current/SPECS/java-1.8.0-openjdk.spec

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30