Repository navigation
Expand file tree
/
Copy pathjava.spec
More file actions
2422 lines (2014 loc) · 91.3 KB
/
Copy pathjava.spec
File metadata and controls
2422 lines (2014 loc) · 91.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#https://git.centos.org/rpms/java-1.7.0-openjdk/raw/bd5290b00c7126d56f818e225c33602e8452f429/f/SPECS/java-1.7.0-openjdk.spec
# If debug is 1, OpenJDK is built with all debug info present.
%global debug 0
# we remove the build id notes explicitly to avoid generating (potentially
# conflicting) files in the -debuginfo package
%undefine _missing_build_ids_terminate_build
%global icedtea_version 2.6.18
%global icedtea_snapshot %{nil}
%global hg_tag icedtea-%{icedtea_version}%{icedtea_snapshot}
%global aarch64 aarch64 arm64 armv8
#sometimes we need to distinguish big and little endian PPC64
%global ppc64le ppc64le
%global ppc64be ppc64 ppc64p7
%global multilib_arches %{power64} sparc64 x86_64
%global jit_arches %{ix86} x86_64 sparcv9 sparc64 %{ppc64be} %{ppc64le} %{aarch64}
# With disabled nss is NSS deactivated, so in NSS_LIBDIR can be wrong path
# the initialisation must be here. LAter the pkg-connfig have bugy behaviour
#looks liekopenjdk RPM specific bug
# Always set this so the nss.cfg file is not broken
%global NSS_LIBDIR %(pkg-config --variable=libdir nss)
%global NSS_LIBS %(pkg-config --libs nss)
%global NSS_CFLAGS %(pkg-config --cflags nss-softokn)
# see https://bugzilla.redhat.com/show_bug.cgi?id=1332456
%global NSSSOFTOKN_BUILDTIME_NUMBER %(pkg-config --modversion nss-softokn || : )
%global NSS_BUILDTIME_NUMBER %(pkg-config --modversion nss || : )
#this is worakround for processing of requires during srpm creation
%global NSSSOFTOKN_BUILDTIME_VERSION %(if [ "x%{NSSSOFTOKN_BUILDTIME_NUMBER}" == "x" ] ; then echo "" ;else echo ">= %{NSSSOFTOKN_BUILDTIME_NUMBER}" ;fi)
%global NSS_BUILDTIME_VERSION %(if [ "x%{NSS_BUILDTIME_NUMBER}" == "x" ] ; then echo "" ;else echo ">= %{NSS_BUILDTIME_NUMBER}" ;fi)
# Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349.
# See also https://bugzilla.redhat.com/show_bug.cgi?id=1590796
# as to why some libraries *cannot* be excluded. In particular,
# these are:
# libjsig.so, libjava.so, libjawt.so, libjvm.so and libverify.so
%global _privatelibs libatk-wrapper[.]so.*|libattach[.]so.*|libawt_headless[.]so.*|libawt[.]so.*|libawt_xawt[.]so.*|libdt_socket[.]so.*|libfontmanager[.]so.*|libhprof[.]so.*|libinstrument[.]so.*|libj2gss[.]so.*|libj2pcsc[.]so.*|libj2pkcs11[.]so.*|libjaas_unix[.]so.*|libjava_crw_demo[.]so.*|libjavajpeg[.]so.*|libjdwp[.]so.*|libjli[.]so.*|libjsdt[.]so.*|libjsoundalsa[.]so.*|libjsound[.]so.*|liblcms[.]so.*|libmanagement[.]so.*|libmlib_image[.]so.*|libnet[.]so.*|libnio[.]so.*|libnpt[.]so.*|libsaproc[.]so.*|libsctp[.]so.*|libsplashscreen[.]so.*|libsunec[.]so.*|libunpack[.]so.*|libzip[.]so.*|lib[.]so\\(SUNWprivate_.*
%global __provides_exclude ^(%{_privatelibs})$
%global __requires_exclude ^(%{_privatelibs})$
# In some cases, the arch used by the JDK does
# not match _arch.
# Also, in some cases, the machine name used by SystemTap
# does not match that given by _build_cpu
%ifarch x86_64
%global archbuild amd64
%global archinstall amd64
%global stapinstall x86_64
%endif
%ifarch ppc
%global archbuild ppc
%global archinstall ppc
%global archdef PPC
%global stapinstall powerpc
%endif
%ifarch %{ppc64be}
%global archbuild ppc64
%global archinstall ppc64
%global archdef PPC
%global stapinstall powerpc
%endif
%ifarch %{ppc64le}
%global archbuild ppc64le
%global archinstall ppc64le
%global archdef PPC64
%global stapinstall powerpc
%endif
%ifarch %{ix86}
%global archbuild i586
%global archinstall i386
%global stapinstall i386
%endif
%ifarch ia64
%global archbuild ia64
%global archinstall ia64
%global stapinstall ia64
%endif
%ifarch s390
%global archbuild s390
%global archinstall s390
%global archdef S390
%global stapinstall s390
%endif
%ifarch s390x
%global archbuild s390x
%global archinstall s390x
%global archdef S390
%global stapinstall s390
%endif
%ifarch %{arm}
%global archbuild arm
%global archinstall arm
%global archdef ARM
%global stapinstall arm
%endif
%ifarch %{aarch64}
%global archbuild aarch64
%global archinstall aarch64
%global archdef AARCH64
%global stapinstall arm64
%endif
# 32 bit sparc, optimized for v9
%ifarch sparcv9
%global archbuild sparc
%global archinstall sparc
%global stapinstall %{_build_cpu}
%endif
# 64 bit sparc
%ifarch sparc64
%global archbuild sparcv9
%global archinstall sparcv9
%global stapinstall %{_build_cpu}
%endif
%ifnarch %{jit_arches}
%global archbuild %{_arch}
%global archinstall %{_arch}
%endif
%if %{debug}
%global debugbuild debug_build
%else
%global debugbuild %{nil}
%endif
# If hsbootstrap is 1, build HotSpot alone first and use that in the bootstrap JDK
# You can turn this on to avoid issues where HotSpot is broken in the bootstrap JDK
%ifarch %{jit_arches}
%global hsbootstrap 1
%else
%global hsbootstrap 0
%endif
%global with_pulseaudio 1
%ifarch %{jit_arches}
%global with_systemtap 1
%else
%global with_systemtap 0
%endif
# Convert an absolute path to a relative path. Each symbolic link is
# specified relative to the directory in which it is installed so that
# it will resolve properly within chrooted installations.
%global script 'use File::Spec; print File::Spec->abs2rel($ARGV[0], $ARGV[1])'
%global abs2rel %{__perl} -e %{script}
# Hard-code libdir on 64-bit architectures to make the 64-bit JDK
# simply be another alternative.
%global LIBDIR %{_libdir}
#backuped original one
%ifarch %{multilib_arches}
%global syslibdir %{_prefix}/lib64
%global _libdir %{_prefix}/lib
%else
%global syslibdir %{_libdir}
%endif
# Standard JPackage naming and versioning defines.
%global origin openjdk
%global top_level_dir_name %{origin}
%global updatever 221
%global buildver 02
# Keep priority on 7digits in case updatever>9
%global priority 1700%{updatever}
%global javaver 1.7.0
%global sdkdir %{uniquesuffix}
%global jrelnk jre-%{javaver}-%{origin}-%{version}-%{release}.%{_arch}
%global jredir %{sdkdir}/jre
%global sdkbindir %{_jvmdir}/%{sdkdir}/bin
%global jrebindir %{_jvmdir}/%{jredir}/bin
%global jvmjardir %{_jvmjardir}/%{uniquesuffix}
%global rpm_state_dir %{_localstatedir}/lib/rpm-state/
%global fullversion %{name}-%{version}-%{release}
%global uniquesuffix %{fullversion}.%{_arch}
#we can copy the javadoc to not arched dir, or made it not noarch
%global uniquejavadocdir %{fullversion}
%ifarch %{jit_arches}
# Where to install systemtap tapset (links)
# We would like these to be in a package specific subdir,
# but currently systemtap doesn't support that, so we have to
# use the root tapset dir for now. To distinquish between 64
# and 32 bit architectures we place the tapsets under the arch
# specific dir (note that systemtap will only pickup the tapset
# for the primary arch for now). Systemtap uses the machine name
# aka build_cpu as architecture specific directory name.
%global tapsetroot /usr/share/systemtap
%global tapsetdir %{tapsetroot}/tapset/%{stapinstall}
%endif
%if %{debug}
%global buildoutputdir %{top_level_dir_name}/build/linux-%{archbuild}-debug
%else
%global buildoutputdir %{top_level_dir_name}/build/linux-%{archbuild}
%endif
# Prevent brp-java-repack-jars from being run.
%global __jar_repack 0
Name: java-%{javaver}-%{origin}
Version: %{javaver}.%{updatever}
Release: %{icedtea_version}%{icedtea_snapshot}.0%{?dist}
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons,
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
# also included the epoch in their virtual provides. This created a
# situation where in-the-wild java-1.5.0-ibm packages provided "java =
# 1:1.5.0". In RPM terms, "1.6.0 < 1:1.5.0" since 1.6.0 is
# interpreted as 0:1.6.0. So the "java >= 1.6.0" requirement would be
# satisfied by the 1:1.5.0 packages. Thus we need to set the epoch in
# JDK package >= 1.6.0 to 1, and packages referring to JDK virtual
# provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0".
Epoch: 1
Summary: OpenJDK Runtime Environment
Group: Development/Languages
# HotSpot code is licensed under GPLv2
# JDK library code is licensed under GPLv2 with the Classpath exception
# The Apache license is used in code taken from Apache projects (primarily JAXP & JAXWS)
# DOM levels 2 & 3 and the XML digital signature schemas are licensed under the W3C Software License
# The JSR166 concurrency code is in the public domain
# The BSD and MIT licenses are used for a number of third-party libraries (see THIRD_PARTY_README)
# The OpenJDK source tree includes the JPEG library (IJG), zlib & libpng (zlib), giflib and LCMS (MIT)
# The test code includes copies of NSS under the Mozilla Public License v2.0
# The PCSClite headers are under a BSD with advertising license
# The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version
# JavaScript support is provided by Rhino, which is licensed under MPLv1.1
License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv1.1 and MPLv2.0 and Public Domain and W3C and zlib
URL: http://openjdk.java.net/
# Source from upstream IcedTea 2.x project. To regenerate, use
# VERSION=icedtea-${icedtea_version} FILE_NAME_ROOT=openjdk-${VERSION}
# REPO_ROOT=<path to checked-out repository> generate_source_tarball.sh
Source0: openjdk-icedtea-%{icedtea_version}%{icedtea_snapshot}.tar.xz
# README file
# This source is under maintainer's/java-team's control
Source2: README.src
# Sources 6-12 are taken from hg clone http://icedtea.classpath.org/hg/icedtea7
# Unless said differently, there is directory with required sources which should be enough to pack/rename
# Class rewrite to rewrite rhino hierarchy
Source5: class-rewriter.tar.gz
# Systemtap tapsets. Zipped up to keep it small.
# last update from IcedTea 2.6.10
Source6: systemtap-tapset-2.6.12.tar.xz
# .desktop files.
Source7: policytool.desktop
Source77: jconsole.desktop
# nss configuration file
Source8: nss.cfg
# FIXME: Taken from IcedTea snapshot 877ad5f00f69, but needs to be moved out
# hg clone -r 877ad5f00f69 http://icedtea.classpath.org/hg/icedtea7
Source9: pulseaudio.tar.gz
# Removed libraries that we link instead
Source10: remove-intree-libraries.sh
#http://icedtea.classpath.org/hg/icedtea7/file/933d082ec889/fsg.sh
# file to clean tarball, should be ketp updated as possible
Source1111: fsg.sh
# Remove build ids from binaries
Source11: remove-buildids.sh
# Ensure we aren't using the limited crypto policy
Source12: TestCryptoLevel.java
Source13: java-abrt-launcher
Source20: repackReproduciblePolycies.sh
# RPM/distribution specific patches
# Allow TCK to pass with access bridge wired in
Patch1: rh1648645-java_access_bridge_loading_java_version_privileged_tck.patch
# Disable access to access-bridge packages by untrusted apps
Patch3: rh1648644-java_access_bridge_privlidged_security.patch
# Ignore AWTError when assistive technologies are loaded
Patch4: rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch
# Build docs even in debug
Patch5: rh1648254-javadoc_generated_during_all_variants_of_buid.patch
# Add debuginfo where missing
Patch6: rh1648259-libsaproc_libjsig_compiled_with_g_to_provide_correct_debuginfo.patch
#
# OpenJDK specific patches
#
# Add rhino support
Patch100: rh1649777-add_rhino_support_jdk7.patch
Patch106: rh1648643-comment_out_freetype_check.patch
# allow to create hs_pid.log in tmp (in 700 permissions) if working directory is unwritable
Patch200: rh1648241-abrt_friendly_hs_log_jdk7.patch
#
# Optional component packages
#
# Make the ALSA based mixer the default when building with the pulseaudio based
# mixer
Patch300: rh1649760-make_alsa_based_mixer_default_when_pulseaudio_build.patch
# Make the curves reported by Java's SSL implementation match those of NSS
Patch400: pr1834-rh1022017-reduce_ellipticcurvesextension_to_provide_only_three_nss_supported_nist_curves_23_24_25.patch
# Temporary patches
# 8076221, PR2809: Backport "8076221: Disable RC4 cipher suites" (will appear in 2.7.0)
Patch500: jdk8076221-pr2809-disable_rc4_cipher_suites.patch
# PR3393, RH1273760: Support using RSAandMGF1 with the SHA hash algorithms in the PKCS11 provider (will appear in 2.7.0)
Patch501: pr3393-rh1273760-support_rsaandmgf1_with_sha_in_pkcs11.patch
# End of tmp patches
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc-c++
BuildRequires: alsa-lib-devel
BuildRequires: cups-devel
BuildRequires: desktop-file-utils
BuildRequires: giflib-devel
# LCMS 2 is disabled until security issues are resolved
#BuildRequires: lcms2-devel >= 2.5
BuildRequires: libX11-devel
BuildRequires: libXi-devel
BuildRequires: libXp-devel
BuildRequires: libXt-devel
BuildRequires: libXtst-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: wget
BuildRequires: xorg-x11-proto-devel
BuildRequires: ant
BuildRequires: libXinerama-devel
# Provides lsb_release for generating distro id in jdk_generic_profile.sh
BuildRequires: redhat-lsb-core
BuildRequires: rhino
BuildRequires: zip
BuildRequires: fontconfig
BuildRequires: xorg-x11-fonts-Type1
BuildRequires: zlib > 1.2.3-6
# Require a build JDK which has a working jar uf (PR1437 / RH1207129)
BuildRequires: java-1.7.0-openjdk-devel >= 1.7.0.111-2.6.7.2
BuildRequires: fontconfig
BuildRequires: at-spi-devel
BuildRequires: gawk
BuildRequires: pkgconfig >= 0.9.0
BuildRequires: xorg-x11-utils
# Requirements for setting up the nss.cfg
BuildRequires: nss-devel
# Required for NIO2
BuildRequires: libattr-devel
# Build requirements for SunEC system NSS support
BuildRequires: nss-softokn-freebl-devel >= 3.16.1
# Required for smartcard support
BuildRequires: pcsc-lite-devel
# Required for SCTP support
BuildRequires: lksctp-tools-devel
# Required for fallback native proxy support
BuildRequires: GConf2-devel
# PulseAudio build requirements.
%if %{with_pulseaudio}
BuildRequires: pulseaudio-libs-devel >= 0.9.11
%endif
# Zero-assembler build requirement.
%ifnarch %{jit_arches}
BuildRequires: libffi-devel >= 3.0.10
%endif
# cacerts build requirement.
BuildRequires: openssl
# execstack build requirement.
# no prelink on ARM yet
%ifnarch %{arm} %{aarch64} %{ppc64le}
BuildRequires: prelink
%endif
%ifarch %{jit_arches}
#systemtap build requirement.
BuildRequires: systemtap-sdt-devel
%endif
Requires: fontconfig
Requires: xorg-x11-fonts-Type1
#requires rest of java
Requires: %{name}-headless = %{epoch}:%{version}-%{release}
OrderWithRequires: %{name}-headless = %{epoch}:%{version}-%{release}
# Standard JPackage base provides.
Provides: jre-%{javaver}-%{origin} = %{epoch}:%{version}-%{release}
Provides: jre-%{origin} = %{epoch}:%{version}-%{release}
Provides: jre-%{javaver} = %{epoch}:%{version}-%{release}
Provides: java-%{javaver} = %{epoch}:%{version}-%{release}
Provides: jre = %{javaver}
Provides: java-%{origin} = %{epoch}:%{version}-%{release}
Provides: java = %{epoch}:%{javaver}
# Standard JPackage extensions provides.
Provides: java-fonts = %{epoch}:%{version}
# Obsolete older 1.6 packages as it cannot use the new bytecode
# Obsoletes: java-1.6.0-openjdk
# Obsoletes: java-1.6.0-openjdk-demo
# Obsoletes: java-1.6.0-openjdk-devel
# Obsoletes: java-1.6.0-openjdk-javadoc
# Obsoletes: java-1.6.0-openjdk-src
%description
The OpenJDK runtime environment.
%package headless
Summary: The OpenJDK runtime environment without audio and video support
Group: Development/Languages
# LCMS 2 is disabled until security issues are resolved
#Requires: lcms2 >= 2.5
Requires: libjpeg = 6b
# Require /etc/pki/java/cacerts.
Requires: ca-certificates
# Require jpackage-utils for ant.
Requires: jpackage-utils >= 1.7.3-1jpp.2
# Require zoneinfo data provided by tzdata-java subpackage.
Requires: tzdata-java
# there is need to depnd on exact version of nss
Requires: nss %{NSS_BUILDTIME_VERSION}
Requires: nss-softokn %{NSSSOFTOKN_BUILDTIME_VERSION}
# 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
Requires: copy-jdk-configs >= 3.3-9
OrderWithRequires: copy-jdk-configs
# Post requires alternatives to install tool alternatives.
Requires(post): %{_sbindir}/alternatives
# in version 1.7 and higher for --family switch
Requires(post): chkconfig >= 1.7
# Postun requires alternatives to uninstall tool alternatives.
Requires(postun): %{_sbindir}/alternatives
# in version 1.7 and higher for --family switch
Requires(postun): chkconfig >= 1.7
Provides: jre-%{javaver}-%{origin}-headless = %{epoch}:%{version}-%{release}
Provides: jre-%{origin}-headless = %{epoch}:%{version}-%{release}
Provides: jre-%{javaver}-headless = %{epoch}:%{version}-%{release}
Provides: java-%{javaver}-headless = %{epoch}:%{version}-%{release}
Provides: jre-headless = %{epoch}:%{javaver}
Provides: java-%{origin}-headless = %{epoch}:%{version}-%{release}
Provides: java-headless = %{epoch}:%{javaver}
# Standard JPackage extensions provides.
Provides: jndi = %{epoch}:%{version}
Provides: jndi-ldap = %{epoch}:%{version}
Provides: jndi-cos = %{epoch}:%{version}
Provides: jndi-rmi = %{epoch}:%{version}
Provides: jndi-dns = %{epoch}:%{version}
Provides: jaas = %{epoch}:%{version}
Provides: jsse = %{epoch}:%{version}
Provides: jce = %{epoch}:%{version}
Provides: jdbc-stdext = 4.1
Provides: java-sasl = %{epoch}:%{version}
%description headless
The OpenJDK runtime environment without audio and video
%package devel
Summary: OpenJDK Development Environment
Group: Development/Tools
# Require base package.
Requires: %{name} = %{epoch}:%{version}-%{release}
OrderWithRequires: %{name}-headless = %{epoch}:%{version}-%{release}
# Post requires alternatives to install tool alternatives.
Requires(post): %{_sbindir}/alternatives
# in version 1.7 and higher for --family switch
Requires(post): chkconfig >= 1.7
# Postun requires alternatives to uninstall tool alternatives.
Requires(postun): %{_sbindir}/alternatives
# in version 1.7 and higher for --family switch
Requires(postun): chkconfig >= 1.7
# Standard JPackage devel provides.
Provides: java-sdk-%{javaver}-%{origin} = %{epoch}:%{version}
Provides: java-sdk-%{javaver} = %{epoch}:%{version}
Provides: java-sdk-%{origin} = %{epoch}:%{version}
Provides: java-sdk = %{epoch}:%{javaver}
Provides: java-%{javaver}-devel = %{epoch}:%{version}
Provides: java-devel-%{origin} = %{epoch}:%{version}
Provides: java-devel = %{epoch}:%{javaver}
%description devel
The OpenJDK development tools.
%package demo
Summary: OpenJDK Demos
Group: Development/Languages
Requires: %{name} = %{epoch}:%{version}-%{release}
OrderWithRequires: %{name}-headless = %{epoch}:%{version}-%{release}
%description demo
The OpenJDK demos.
%package src
Summary: OpenJDK Source Bundle
Group: Development/Languages
Requires: %{name} = %{epoch}:%{version}-%{release}
%description src
The OpenJDK source bundle.
%package javadoc
Summary: OpenJDK API Documentation
Group: Documentation
Requires: jpackage-utils
BuildArch: noarch
OrderWithRequires: %{name}-headless = %{epoch}:%{version}-%{release}
# Post requires alternatives to install javadoc alternative.
Requires(post): %{_sbindir}/alternatives
# in version 1.7 and higher for --family switch
Requires(post): chkconfig >= 1.7
# Postun requires alternatives to uninstall javadoc alternative.
Requires(postun): %{_sbindir}/alternatives
# in version 1.7 and higher for --family switch
Requires(postun): chkconfig >= 1.7
# Standard JPackage javadoc provides.
Provides: java-javadoc = %{epoch}:%{version}-%{release}
Provides: java-%{javaver}-javadoc = %{epoch}:%{version}-%{release}
%description javadoc
The OpenJDK API documentation.
%package accessibility
Summary: OpenJDK accessibility connector
Requires: java-atk-wrapper
Requires: %{name} = %{epoch}:%{version}-%{release}
OrderWithRequires: %{name}-headless = %{epoch}:%{version}-%{release}
%description accessibility
Enables accessibility support in OpenJDK by using java-at-wrapper. This allows compatible at-spi2 based accessibility programs to work for AWT and Swing-based programs.
Please note, the java-atk-wrapper is still in beta, and also OpenJDK itself is still in phase of tuning to be working with accessibility features.
Although working pretty fine, there are known issues with accessibility on, so do not rather install this package unless you really need.
%prep
%setup -q -c -n %{uniquesuffix} -T -a 0
# https://bugzilla.redhat.com/show_bug.cgi?id=1189084
prioritylength=`expr length %{priority}`
if [ $prioritylength -ne 7 ] ; then
echo "priority must be 7 digits in total, violated"
exit 14
fi
cp %{SOURCE2} .
# OpenJDK patches
%patch100
# pulseaudio support
%if %{with_pulseaudio}
%patch300
%endif
# Temporary fixes
%patch500
%patch501
# End of temporary fixes
# ECC fix
%patch400
# Add systemtap patches if enabled
%if %{with_systemtap}
%endif
# Remove libraries that are linked
sh %{SOURCE10}
# Extract the rewriter (to rewrite rhino classes)
tar xzf %{SOURCE5}
# Extract systemtap tapsets
%if %{with_systemtap}
tar xf %{SOURCE6}
for file in tapset/*.in; do
OUTPUT_FILE=`echo $file | sed -e s:%{javaver}\.stp\.in$:%{version}-%{release}.stp:g`
sed -e s:@ABS_SERVER_LIBJVM_SO@:%{_jvmdir}/%{sdkdir}/jre/lib/%{archinstall}/server/libjvm.so:g $file > $file.1
# FIXME this should really be %if %{has_client_jvm}
%ifarch %{ix86}
sed -e s:@ABS_CLIENT_LIBJVM_SO@:%{_jvmdir}/%{sdkdir}/jre/lib/%{archinstall}/client/libjvm.so:g $file.1 > $OUTPUT_FILE
%else
sed -e '/@ABS_CLIENT_LIBJVM_SO@/d' $file.1 > $OUTPUT_FILE
%endif
sed -i -e s:@INSTALL_ARCH_DIR@:%{archinstall}:g $OUTPUT_FILE
sed -i -e s:@prefix@:%{_jvmdir}/%{sdkdir $suffix}/:g $OUTPUT_FILE
done
%endif
# Pulseaudio
%if %{with_pulseaudio}
tar xzf %{SOURCE9}
%endif
%patch3
%patch4
%if %{debug}
%patch5
%patch6
%endif
%patch106
%patch200
%build
# How many cpu's do we have?
export NUM_PROC=`/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :`
export NUM_PROC=${NUM_PROC:-1}
# Build IcedTea and OpenJDK.
%ifarch s390x sparc64 alpha %{power64} %{aarch64}
export ARCH_DATA_MODEL=64
%endif
%ifarch alpha
%global archflags "-mieee"
%endif
# Filter out flags from the optflags macro that cause problems with the OpenJDK build
# We filter out -O flags so that the optimisation of HotSpot is not lowered from O3 to O2
# We filter out -Wall which will otherwise cause HotSpot to produce hundreds of thousands of warnings (100+mb logs)
# We replace it with -Wformat (required by -Werror=format-security) and -Wno-cpp to avoid FORTIFY_SOURCE warnings
# We filter out -fexceptions as the HotSpot build explicitly does -fno-exceptions and it's otherwise the default for C++
%global ourflags %(echo %optflags | sed -e 's|-Wall|-Wformat=2 -Wno-cpp -Wno-error=format-nonliteral|')
# Disable RPM CFLAGS for now as the change appears to cause crashes on x86 RHEL 7.5 multilib
#%global ourcppflags %(echo %ourflags | sed -e 's|-fexceptions||' | sed -r -e 's|-O[0-9]*||')
%global ourcppflags "-fstack-protector-strong"
%global ourldflags %{__global_ldflags}
# Build the re-written rhino jar
mkdir -p rhino/{old,new}
# Compile the rewriter
(cd rewriter
javac com/redhat/rewriter/ClassRewriter.java
)
# Extract rhino.jar contents and rewrite
(cd rhino/old
jar xf /usr/share/java/rhino.jar
)
java -cp rewriter com.redhat.rewriter.ClassRewriter \
$PWD/rhino/old \
$PWD/rhino/new \
org.mozilla \
sun.org.mozilla
(cd rhino/old
for file in `find -type f -not -name '*.class'` ; do
new_file=../new/`echo $file | sed -e 's#org#sun/org#'`
mkdir -pv `dirname $new_file`
cp -v $file $new_file
sed -ie 's#org\.mozilla#sun.org.mozilla#g' $new_file
done
)
(cd rhino/new
jar cfm ../rhino.jar META-INF/MANIFEST.MF sun
)
export SYSTEM_JDK_DIR=/usr/lib/jvm/java-1.7.0-openjdk
# Temporary workaround for ppc64le ; RH1191652
# Need to work around the jre arch directory being
# ppc64 instead of the expected ppc64le
# Taken from IcedTea7 bootstrap-directory-stage1 & PR1765
%ifarch %{ppc64le}
STAGE1_BOOT_RUNTIME=jdk/jre/lib/rt.jar
mkdir -p jdk/bin
ln -sfv ${SYSTEM_JDK_DIR}/bin/java jdk/bin/java
ln -sfv ${SYSTEM_JDK_DIR}/bin/javah jdk/bin/javah
ln -sfv ${SYSTEM_JDK_DIR}/bin/rmic jdk/bin/rmic
ln -sfv ${SYSTEM_JDK_DIR}/bin/jar jdk/bin/jar
ln -sfv ${SYSTEM_JDK_DIR}/bin/native2ascii jdk/bin/native2ascii
ln -sfv ${SYSTEM_JDK_DIR}/bin/javac jdk/bin/javac
ln -sfv ${SYSTEM_JDK_DIR}/bin/javap jdk/bin/javap
ln -sfv ${SYSTEM_JDK_DIR}/bin/idlj jdk/bin/idlj
mkdir -p jdk/lib/modules
mkdir -p jdk/jre/lib && \
cp ${SYSTEM_JDK_DIR}/jre/lib/rt.jar ${STAGE1_BOOT_RUNTIME} && \
chmod u+w ${STAGE1_BOOT_RUNTIME}
mkdir -p jdk/lib && \
ln -sfv ${SYSTEM_JDK_DIR}/lib/tools.jar jdk/lib/tools.jar ; \
# Workaround some older ppc64le builds installing to 'ppc64' rather than 'ppc64le'
if test -d ${SYSTEM_JDK_DIR}/jre/lib/ppc64 ; then \
ln -sfv ${SYSTEM_JDK_DIR}/jre/lib/ppc64 \
jdk/jre/lib/%{archinstall} ; \
else \
ln -sfv ${SYSTEM_JDK_DIR}/jre/lib/%{archinstall} \
jdk/jre/lib/ ; \
fi
if ! test -d jdk/jre/lib/%{archinstall}; \
then \
ln -sfv ./%{archbuild} \
jdk/jre/lib/%{archinstall}; \
fi
mkdir -p jdk/include && \
for i in ${SYSTEM_JDK_DIR}/include/*; do \
test -r ${i} | continue; \
i=`basename ${i}`; \
rm -f jdk/include/${i}; \
ln -sv ${SYSTEM_JDK_DIR}/include/${i} jdk/include/${i}; \
done;
export JDK_TO_BUILD_WITH=${PWD}/jdk
%else
export JDK_TO_BUILD_WITH=${SYSTEM_JDK_DIR}
%endif
pushd openjdk >& /dev/null
export ALT_BOOTDIR="$JDK_TO_BUILD_WITH"
# Save old umask as jdk_generic_profile overwrites it
oldumask=`umask`
# Set generic profile
%ifnarch %{jit_arches}
export ZERO_BUILD=true
%endif
# LCMS 2 is disabled until security issues are resolved
export LCMS_CFLAGS="disabled"
export LCMS_LIBS="disabled"
export PKGVERSION="rhel-%{release}-%{_arch} u%{updatever}-b%{buildver}"
source jdk/make/jdk_generic_profile.sh
# Restore old umask
umask $oldumask
# LCMS 2 is disabled until security issues are resolved
export SYSTEM_LCMS=false
# Variable used in hs_err hook on build failures
top_dir_abs_path=$(pwd)/%{top_level_dir_name}
%if %{hsbootstrap}
mkdir bootstrap
make \
UNLIMITED_CRYPTO=true \
ANT="/usr/bin/ant" \
DISTRO_NAME="Red Hat Enterprise Linux 7" \
DISTRO_PACKAGE_VERSION="${PKGVERSION}" \
JDK_UPDATE_VERSION=`printf "%02d" %{updatever}` \
JDK_BUILD_NUMBER=b`printf "%02d" %{buildver}` \
JRE_RELEASE_VERSION=%{javaver}_`printf "%02d" %{updatever}`-b`printf "%02d" %{buildver}` \
MILESTONE="fcs" \
ALT_PARALLEL_COMPILE_JOBS="$NUM_PROC" \
HOTSPOT_BUILD_JOBS="$NUM_PROC" \
STATIC_CXX="false" \
RHINO_JAR="$PWD/../rhino/rhino.jar" \
GENSRCDIR="$PWD/generated.build" \
FT2_CFLAGS="`pkg-config --cflags freetype2` " \
FT2_LIBS="`pkg-config --libs freetype2` " \
DEBUG_CLASSFILES="true" \
DEBUG_BINARIES="true" \
STRIP_POLICY="no_strip" \
JAVAC_WARNINGS_FATAL="false" \
INSTALL_LOCATION=%{_jvmdir}/%{sdkdir} \
SYSTEM_NSS="true" \
NSS_LIBS="%{NSS_LIBS} -lfreebl" \
NSS_CFLAGS="%{NSS_CFLAGS}" \
ECC_JUST_SUITE_B="true" \
SYSTEM_GSETTINGS="true" \
BUILD_JAXP=false BUILD_JAXWS=false BUILD_LANGTOOLS=false BUILD_JDK=false BUILD_CORBA=false \
ALT_JDK_IMPORT_PATH=${JDK_TO_BUILD_WITH} ALT_OUTPUTDIR=${PWD}/bootstrap \
EXTRA_CFLAGS="%{ourcppflags}" EXTRA_LDFLAGS="%{ourldflags}" \
%{debugbuild} || ( pwd; find $top_dir_abs_path -name "hs_err_pid*.log" | xargs cat && false )
export VM_DIR=bootstrap-vm/jre/lib/%{archinstall}/server
cp -dR $(readlink -e ${SYSTEM_JDK_DIR}) bootstrap-vm
rm -vf ${VM_DIR}/libjvm.so
if [ ! -e ${VM_DIR} ] ; then mkdir -p ${VM_DIR}; fi
cp -av bootstrap/hotspot/import/jre/lib/%{archinstall}/server/libjvm.so ${VM_DIR}
export ALT_BOOTDIR=${PWD}/bootstrap-vm
%endif
# ENABLE_FULL_DEBUG_SYMBOLS=0 is the internal HotSpot option
# to turn off the stripping of debuginfo. FULL_DEBUG_SYMBOLS
# does the same for product builds, but is ignored on non-product builds.
make \
UNLIMITED_CRYPTO=true \
ANT="/usr/bin/ant" \
DISTRO_NAME="Red Hat Enterprise Linux 7" \
DISTRO_PACKAGE_VERSION="${PKGVERSION}" \
JDK_UPDATE_VERSION=`printf "%02d" %{updatever}` \
JDK_BUILD_NUMBER=b`printf "%02d" %{buildver}` \
JRE_RELEASE_VERSION=%{javaver}_`printf "%02d" %{updatever}`-b`printf "%02d" %{buildver}` \
MILESTONE="fcs" \
ALT_PARALLEL_COMPILE_JOBS="$NUM_PROC" \
HOTSPOT_BUILD_JOBS="$NUM_PROC" \
STATIC_CXX="false" \
RHINO_JAR="$PWD/../rhino/rhino.jar" \
GENSRCDIR="$PWD/generated.build" \
FT2_CFLAGS="`pkg-config --cflags freetype2` " \
FT2_LIBS="`pkg-config --libs freetype2` " \
DEBUG_CLASSFILES="true" \
DEBUG_BINARIES="true" \
STRIP_POLICY="no_strip" \
JAVAC_WARNINGS_FATAL="false" \
INSTALL_LOCATION=%{_jvmdir}/%{sdkdir} \
SYSTEM_NSS="true" \
NSS_LIBS="%{NSS_LIBS} -lfreebl" \
NSS_CFLAGS="%{NSS_CFLAGS}" \
ECC_JUST_SUITE_B="true" \
SYSTEM_GSETTINGS="true" \
EXTRA_CFLAGS="%{ourcppflags}" EXTRA_LDFLAGS="%{ourldflags}" \
%{debugbuild} || ( pwd; find $top_dir_abs_path -name "hs_err_pid*.log" | xargs cat && false )
popd >& /dev/null
export JAVA_HOME=$(pwd)/%{buildoutputdir}/j2sdk-image
# Install java-abrt-launcher
mkdir $JAVA_HOME/jre-abrt
mkdir $JAVA_HOME/jre-abrt/bin
mv $JAVA_HOME/jre/bin/java $JAVA_HOME/jre-abrt/bin/java
ln -s %{_jvmdir}/%{sdkdir}/jre/lib $JAVA_HOME/jre-abrt/lib
cat %{SOURCE13} | sed -e s:@JAVA_PATH@:%{_jvmdir}/%{sdkdir}/jre-abrt/bin/java:g -e s:@LIB_DIR@:%{LIBDIR}/libabrt-java-connector.so:g > $JAVA_HOME/jre/bin/java
chmod 755 $JAVA_HOME/jre/bin/java
# Install nss.cfg right away as we will be using the JRE above
cp -a %{SOURCE8} $JAVA_HOME/jre/lib/security/
sed -i -e s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g $JAVA_HOME/jre/lib/security/nss.cfg
# Build pulseaudio and install it to JDK build location
%if %{with_pulseaudio}
pushd pulseaudio
# IT_CFLAGS="-g" is needed so that debug info symbols get produced.
# See RHBZ#1657863.
make JAVA_HOME=$JAVA_HOME -f Makefile.pulseaudio IT_CFLAGS="-g"
cp -pPRf build/native/libpulse-java.so $JAVA_HOME/jre/lib/%{archinstall}/
cp -pPRf build/pulse-java.jar $JAVA_HOME/jre/lib/ext/
popd
%endif
# Copy tz.properties
echo "sun.zoneinfo.dir=/usr/share/javazi" >> $JAVA_HOME/jre/lib/tz.properties
#remove all fontconfig files. This change should be usptreamed soon
rm -f %{buildoutputdir}/j2re-image/lib/fontconfig*.properties.src
rm -f %{buildoutputdir}/j2re-image/lib/fontconfig*.bfc
rm -f %{buildoutputdir}/j2sdk-image/jre/lib/fontconfig*.properties.src
rm -f %{buildoutputdir}/j2sdk-image/jre/lib/fontconfig*.bfc
rm -f %{buildoutputdir}/lib/fontconfig*.properties.src
rm -f %{buildoutputdir}/lib/fontconfig*.bfc
# Check unlimited policy has been used
$JAVA_HOME/bin/javac -d . %{SOURCE12}
$JAVA_HOME/bin/java TestCryptoLevel
sh %{SOURCE11} ${JAVA_HOME}
%check
export JAVA_HOME=$(pwd)/%{buildoutputdir $suffix}/j2sdk-image
%install
rm -rf $RPM_BUILD_ROOT
STRIP_KEEP_SYMTAB=libjvm*
# There used to be a link to the soundfont.
# This is now obsolete following the inclusion of 8140620/PR2710
pushd %{buildoutputdir}/j2sdk-image
#install jsa directories so we can owe them
mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib/%{archinstall}/server/
mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib/%{archinstall}/client/
# Install main files.
install -d -m 755 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}
cp -a jre-abrt bin include lib src.zip $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}
install -d -m 755 $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}
cp -a jre/bin jre/lib $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}
cp -a ASSEMBLY_EXCEPTION LICENSE THIRD_PARTY_README $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}
%ifarch %{jit_arches}
# Install systemtap support files.
install -dm 755 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}/tapset
cp -a $RPM_BUILD_DIR/%{uniquesuffix}/tapset/*.stp $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}/tapset/
install -d -m 755 $RPM_BUILD_ROOT%{tapsetdir}
pushd $RPM_BUILD_ROOT%{tapsetdir}
RELATIVE=$(%{abs2rel} %{_jvmdir}/%{sdkdir}/tapset %{tapsetdir})
ln -sf $RELATIVE/*.stp .
popd
%endif
# Install cacerts symlink.
rm -f $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib/security/cacerts
pushd $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib/security
RELATIVE=$(%{abs2rel} %{_sysconfdir}/pki/java \
%{_jvmdir}/%{jredir}/lib/security)
ln -sf $RELATIVE/cacerts .
popd
# Install extension symlinks.
install -d -m 755 $RPM_BUILD_ROOT%{jvmjardir}
pushd $RPM_BUILD_ROOT%{jvmjardir}
RELATIVE=$(%{abs2rel} %{_jvmdir}/%{jredir}/lib %{jvmjardir})
ln -sf $RELATIVE/jsse.jar jsse-%{version}.jar
ln -sf $RELATIVE/jce.jar jce-%{version}.jar
ln -sf $RELATIVE/rt.jar jndi-%{version}.jar
ln -sf $RELATIVE/rt.jar jndi-ldap-%{version}.jar
ln -sf $RELATIVE/rt.jar jndi-cos-%{version}.jar
ln -sf $RELATIVE/rt.jar jndi-rmi-%{version}.jar
ln -sf $RELATIVE/rt.jar jaas-%{version}.jar
ln -sf $RELATIVE/rt.jar jdbc-stdext-%{version}.jar
ln -sf jdbc-stdext-%{version}.jar jdbc-stdext-3.0.jar
ln -sf $RELATIVE/rt.jar sasl-%{version}.jar
for jar in *-%{version}.jar
do
if [ x%{version} != x%{javaver} ]
then
ln -sf $jar $(echo $jar | sed "s|-%{version}.jar|-%{javaver}.jar|g")
fi
ln -sf $jar $(echo $jar | sed "s|-%{version}.jar|.jar|g")
done
popd
# Install JCE policy symlinks.
install -d -m 755 $RPM_BUILD_ROOT%{_jvmprivdir}/%{uniquesuffix}/jce/vanilla
# Install versioned symlinks.
pushd $RPM_BUILD_ROOT%{_jvmdir}
ln -sf %{jredir} %{jrelnk}
popd
pushd $RPM_BUILD_ROOT%{_jvmjardir}
ln -sf %{sdkdir} %{jrelnk}
popd
# Remove javaws man page
rm -f man/man1/javaws*
# Install man pages.
install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1
for manpage in man/man1/*
do
# Convert man pages to UTF8 encoding.
iconv -f ISO_8859-1 -t UTF8 $manpage -o $manpage.tmp
mv -f $manpage.tmp $manpage
install -m 644 -p $manpage $RPM_BUILD_ROOT%{_mandir}/man1/$(basename \
$manpage .1)-%{uniquesuffix}.1
done
# Install demos and samples.
cp -a demo $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}
mkdir -p sample/rmi
mv bin/java-rmi.cgi sample/rmi
cp -a sample $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}
popd
# Install Javadoc documentation.
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}
cp -a %{buildoutputdir}/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir}
# Install icons and menu entries.
for s in 16 24 32 48 ; do
install -D -p -m 644 \
%{top_level_dir_name}/jdk/src/solaris/classes/sun/awt/X11/java-icon${s}.png \
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps/java-%{javaver}.png
done