-
-
Notifications
You must be signed in to change notification settings - Fork 77
/
temurin-17-jdk.spec
269 lines (243 loc) · 11.8 KB
/
temurin-17-jdk.spec
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
%global upstream_version 17.0.1+12
# Only [A-Za-z0-9.] allowed in version:
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_upstream_uses_invalid_characters_in_the_version
# also not very intuitive:
# $ rpmdev-vercmp 17.0.1.0.1___17.0.1.0+12
# 17.0.1.0.0___12 == 17.0.1.0.0+12
%global spec_version 17.0.1.0.0.12
%global spec_release 1
%global priority 1161
%global source_url_base https://github.com/adoptium/temurin17-binaries/releases/download
%global upstream_version_url %(echo %{upstream_version} | sed 's/\+/%%2B/g')
%global upstream_version_no_plus %(echo %{upstream_version} | sed 's/\+/_/g')
%global java_provides openjdk
# Map architecture to the expected value in the download URL; Allow for a
# pre-defined value of vers_arch and use that if it's defined
%ifarch x86_64
%global vers_arch x64
%global vers_arch2 ppc64le
%global vers_arch3 s390x
%global vers_arch4 aarch64
%global vers_arch5 arm
%global src_num 0
%global sha_src_num 1
%endif
%ifarch ppc64le
%global vers_arch x64
%global vers_arch2 ppc64le
%global vers_arch3 s390x
%global vers_arch4 aarch64
%global vers_arch5 arm
%global src_num 2
%global sha_src_num 3
%endif
%ifarch s390x
%global vers_arch x64
%global vers_arch2 ppc64le
%global vers_arch3 s390x
%global vers_arch4 aarch64
%global vers_arch5 arm
%global src_num 4
%global sha_src_num 5
%endif
%ifarch aarch64
%global vers_arch x64
%global vers_arch2 ppc64le
%global vers_arch3 s390x
%global vers_arch4 aarch64
%global vers_arch5 arm
%global src_num 6
%global sha_src_num 7
%endif
%ifarch %{arm}
%global vers_arch x64
%global vers_arch2 ppc64le
%global vers_arch3 s390x
%global vers_arch4 aarch64
%global vers_arch5 arm
%global src_num 8
%global sha_src_num 9
%endif
# Allow for noarch SRPM build
%ifarch noarch
%global src_num 0
%global sha_src_num 1
%endif
Name: temurin-17-jdk
Version: %{spec_version}
Release: %{spec_release}
Summary: Eclipse Temurin 17 JDK
Group: java
License: GPLv2 with exceptions
Vendor: Eclipse Adoptium
URL: https://projects.eclipse.org/projects/adoptium
Packager: Eclipse Adoptium Package Maintainers <[email protected]>
AutoReqProv: no
Prefix: /usr/lib/jvm/%{name}
BuildRequires: tar
BuildRequires: wget
Requires: /bin/sh
Requires: /usr/sbin/alternatives
Requires: ca-certificates
Requires: dejavu-sans-fonts
Requires: libX11%{?_isa}
Requires: libXext%{?_isa}
Requires: libXi%{?_isa}
Requires: libXrender%{?_isa}
Requires: libXtst%{?_isa}
Requires: alsa-lib%{?_isa}
Requires: glibc%{?_isa}
Requires: zlib%{?_isa}
Requires: fontconfig%{?_isa}
Requires: freetype%{?_isa}
Provides: java
Provides: java-17
Provides: java-17-devel
Provides: java-17-headless
Provides: java-17-%{java_provides}
Provides: java-17-%{java_provides}-devel
Provides: java-17-%{java_provides}-headless
Provides: java-devel
Provides: java-devel-%{java_provides}
Provides: java-headless
Provides: java-%{java_provides}
Provides: java-%{java_provides}-devel
Provides: java-%{java_provides}-headless
Provides: java-sdk
Provides: java-sdk-17
Provides: java-sdk-17-%{java_provides}
Provides: java-sdk-%{java_provides}
Provides: jre
Provides: jre-17
Provides: jre-17-headless
Provides: jre-17-%{java_provides}
Provides: jre-17-%{java_provides}-headless
Provides: jre-headless
Provides: jre-%{java_provides}
Provides: jre-%{java_provides}-headless
# First architecture (x86_64)
Source0: %{source_url_base}/jdk-%{upstream_version_url}/OpenJDK17U-jdk_%{vers_arch}_linux_hotspot_%{upstream_version_no_plus}.tar.gz
Source1: %{source_url_base}/jdk-%{upstream_version_url}/OpenJDK17U-jdk_%{vers_arch}_linux_hotspot_%{upstream_version_no_plus}.tar.gz.sha256.txt
# Second architecture (ppc64le)
Source2: %{source_url_base}/jdk-%{upstream_version_url}/OpenJDK17U-jdk_%{vers_arch2}_linux_hotspot_%{upstream_version_no_plus}.tar.gz
Source3: %{source_url_base}/jdk-%{upstream_version_url}/OpenJDK17U-jdk_%{vers_arch2}_linux_hotspot_%{upstream_version_no_plus}.tar.gz.sha256.txt
# Third architecture (s390x)
Source4: %{source_url_base}/jdk-%{upstream_version_url}/OpenJDK17U-jdk_%{vers_arch3}_linux_hotspot_%{upstream_version_no_plus}.tar.gz
Source5: %{source_url_base}/jdk-%{upstream_version_url}/OpenJDK17U-jdk_%{vers_arch3}_linux_hotspot_%{upstream_version_no_plus}.tar.gz.sha256.txt
# Fourth architecture (aarch64)
Source6: %{source_url_base}/jdk-%{upstream_version_url}/OpenJDK17U-jdk_%{vers_arch4}_linux_hotspot_%{upstream_version_no_plus}.tar.gz
Source7: %{source_url_base}/jdk-%{upstream_version_url}/OpenJDK17U-jdk_%{vers_arch4}_linux_hotspot_%{upstream_version_no_plus}.tar.gz.sha256.txt
# Fifth architecture (arm32)
Source8: %{source_url_base}/jdk-%{upstream_version_url}/OpenJDK17U-jdk_%{vers_arch5}_linux_hotspot_%{upstream_version_no_plus}.tar.gz
Source9: %{source_url_base}/jdk-%{upstream_version_url}/OpenJDK17U-jdk_%{vers_arch5}_linux_hotspot_%{upstream_version_no_plus}.tar.gz.sha256.txt
# Set the compression format to xz to be compatible with more Red Hat flavours. Newer versions of Fedora use zstd which
# is not available on CentOS 7, for example. https://github.com/rpm-software-management/rpm/blob/master/macros.in#L353
# lists the available options.
%define _source_payload w7.xzdio
%define _binary_payload w7.xzdio
# Avoid build failures on some distros due to missing build-id in binaries.
%global debug_package %{nil}
%global __brp_strip %{nil}
%description
Eclipse Temurin JDK is an OpenJDK-based development environment to create
applications and components using the programming language Java.
%prep
pushd "%{_sourcedir}"
sha256sum -c "%{expand:%{SOURCE%{sha_src_num}}}"
popd
%setup -n jdk-%{upstream_version} -T -b %{src_num}
%build
# noop
%install
mkdir -p %{buildroot}%{prefix}
cd %{buildroot}%{prefix}
tar --strip-components=1 -C "%{buildroot}%{prefix}" -xf %{expand:%{SOURCE%{src_num}}}
# Strip bundled Freetype and use OS package instead.
rm -f "%{buildroot}%{prefix}/lib/libfreetype.so"
# Use cacerts included in OS
rm -f "%{buildroot}%{prefix}/lib/security/cacerts"
pushd "%{buildroot}%{prefix}/lib/security"
ln -s /etc/pki/java/cacerts "%{buildroot}%{prefix}/lib/security/cacerts"
popd
# Ensure systemd-tmpfiles-clean does not remove pid files
# https://bugzilla.redhat.com/show_bug.cgi?id=1704608
%{__mkdir} -p %{buildroot}/usr/lib/tmpfiles.d
echo 'x /tmp/hsperfdata_*' > "%{buildroot}/usr/lib/tmpfiles.d/%{name}.conf"
echo 'x /tmp/.java_pid*' >> "%{buildroot}/usr/lib/tmpfiles.d/%{name}.conf"
%pretrans
# noop
%post
if [ $1 -ge 1 ] ; then
update-alternatives --install %{_bindir}/java java %{prefix}/bin/java %{priority} \
--slave %{_bindir}/jfr jfr %{prefix}/bin/jfr \
--slave %{_bindir}/jjs jjs %{prefix}/bin/jjs \
--slave %{_bindir}/jrunscript jrunscript %{prefix}/bin/jrunscript \
--slave %{_bindir}/keytool keytool %{prefix}/bin/keytool \
--slave %{_bindir}/pack200 pack200 %{prefix}/bin/pack200 \
--slave %{_bindir}/rmid rmid %{prefix}/bin/rmid \
--slave %{_bindir}/rmiregistry rmiregistry %{prefix}/bin/rmiregistry \
--slave %{_bindir}/unpack200 unpack200 %{prefix}/bin/unpack200 \
--slave %{_bindir}/jexec jexec %{prefix}/lib/jexec \
--slave %{_bindir}/jspawnhelper jspawnhelper %{prefix}/lib/jspawnhelper \
--slave %{_mandir}/man1/java.1 java.1 %{prefix}/man/man1/java.1 \
--slave %{_mandir}/man1/jjs.1 jjs.1 %{prefix}/man/man1/jjs.1 \
--slave %{_mandir}/man1/jrunscript.1 jrunscript.1 %{prefix}/man/man1/jrunscript.1 \
--slave %{_mandir}/man1/keytool.1 keytool.1 %{prefix}/man/man1/keytool.1 \
--slave %{_mandir}/man1/pack200.1 pack200.1 %{prefix}/man/man1/pack200.1 \
--slave %{_mandir}/man1/rmid.1 rmid.1 %{prefix}/man/man1/rmid.1 \
--slave %{_mandir}/man1/rmiregistry.1 rmiregistry.1 %{prefix}/man/man1/rmiregistry.1 \
--slave %{_mandir}/man1/unpack200.1 unpack200.1 %{prefix}/man/man1/unpack200.1
update-alternatives --install %{_bindir}/javac javac %{prefix}/bin/javac %{priority} \
--slave %{_bindir}/jaotc jaotc %{prefix}/bin/jaotc \
--slave %{_bindir}/jar jar %{prefix}/bin/jar \
--slave %{_bindir}/jarsigner jarsigner %{prefix}/bin/jarsigner \
--slave %{_bindir}/javadoc javadoc %{prefix}/bin/javadoc \
--slave %{_bindir}/javap javap %{prefix}/bin/javap \
--slave %{_bindir}/jcmd jcmd %{prefix}/bin/jcmd \
--slave %{_bindir}/jconsole jconsole %{prefix}/bin/jconsole \
--slave %{_bindir}/jdb jdb %{prefix}/bin/jdb \
--slave %{_bindir}/jdeprscan jdeprscan %{prefix}/bin/jdeprscan \
--slave %{_bindir}/jdeps jdeps %{prefix}/bin/jdeps \
--slave %{_bindir}/jhsdb jhsdb %{prefix}/bin/jhsdb \
--slave %{_bindir}/jimage jimage %{prefix}/bin/jimage \
--slave %{_bindir}/jinfo jinfo %{prefix}/bin/jinfo \
--slave %{_bindir}/jlink jlink %{prefix}/bin/jlink \
--slave %{_bindir}/jmap jmap %{prefix}/bin/jmap \
--slave %{_bindir}/jmod jmod %{prefix}/bin/jmod \
--slave %{_bindir}/jps jps %{prefix}/bin/jps \
--slave %{_bindir}/jshell jshell %{prefix}/bin/jshell \
--slave %{_bindir}/jstack jstack %{prefix}/bin/jstack \
--slave %{_bindir}/jstat jstat %{prefix}/bin/jstat \
--slave %{_bindir}/jstatd jstatd %{prefix}/bin/jstatd \
--slave %{_bindir}/rmic rmic %{prefix}/bin/rmic \
--slave %{_bindir}/serialver serialver %{prefix}/bin/serialver \
--slave %{_mandir}/man1/jar.1 jar.1 %{prefix}/man/man1/jar.1 \
--slave %{_mandir}/man1/jarsigner.1 jarsigner.1 %{prefix}/man/man1/jarsigner.1 \
--slave %{_mandir}/man1/javac.1 javac.1 %{prefix}/man/man1/javac.1 \
--slave %{_mandir}/man1/javadoc.1 javadoc.1 %{prefix}/man/man1/javadoc.1 \
--slave %{_mandir}/man1/javap.1 javap.1 %{prefix}/man/man1/javap.1 \
--slave %{_mandir}/man1/jcmd.1 jcmd.1 %{prefix}/man/man1/jcmd.1 \
--slave %{_mandir}/man1/jconsole.1 jconsole.1 %{prefix}/man/man1/jconsole.1 \
--slave %{_mandir}/man1/jdb.1 jdb.1 %{prefix}/man/man1/jdb.1 \
--slave %{_mandir}/man1/jdeps.1 jdeps.1 %{prefix}/man/man1/jdeps.1 \
--slave %{_mandir}/man1/jinfo.1 jinfo.1 %{prefix}/man/man1/jinfo.1 \
--slave %{_mandir}/man1/jmap.1 jmap.1 %{prefix}/man/man1/jmap.1 \
--slave %{_mandir}/man1/jps.1 jps.1 %{prefix}/man/man1/jps.1 \
--slave %{_mandir}/man1/jstack.1 jstack.1 %{prefix}/man/man1/jstack.1 \
--slave %{_mandir}/man1/jstat.1 jstat.1 %{prefix}/man/man1/jstat.1 \
--slave %{_mandir}/man1/jstatd.1 jstatd.1 %{prefix}/man/man1/jstatd.1 \
--slave %{_mandir}/man1/rmic.1 rmic.1 %{prefix}/man/man1/rmic.1 \
--slave %{_mandir}/man1/serialver.1 serialver.1 %{prefix}/man/man1/serialver.1
fi
%preun
if [ $1 -eq 0 ]; then
update-alternatives --remove java %{prefix}/bin/java
update-alternatives --remove javac %{prefix}/bin/javac
fi
%files
%defattr(-,root,root)
%{prefix}
/usr/lib/tmpfiles.d/%{name}.conf
%changelog
* Fri Aug 13 2021 Eclipse Adoptium Package Maintainers <[email protected]> 17.0.0.0.0.35-1.adopt0
- Eclipse Temurin 17.0.0+35 release.