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
|
# Copyright (c) 2000-2008, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
# 3. Neither the name of the JPackage Project nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
%global jspspec 3.1
%global major_version 10
%global minor_version 1
%global micro_version 54
%global packdname apache-tomcat-%{version}-src
%global servletspec 6.0
%global elspec 5.0
%global tcuid 53
# Recommended version is specified in java/org/apache/catalina/core/AprLifecycleListener.java
%global native_version 2.0.14
# The package is imported under the name below (tomcat10.1.54) while the
# auxiliary upstream assets keep their original "tomcat-10.1*" file names.
%global upstream tomcat
# FHS 3.0 compliant tree structure - http://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
%global basedir %{_var}/lib/%{name}
%global appdir %{basedir}/webapps
%global homedir %{_datadir}/%{name}
%global bindir %{homedir}/bin
%global confdir %{_sysconfdir}/%{name}
%global libdir %{_javadir}/%{name}
%global logdir %{_var}/log/%{name}
%global cachedir %{_var}/cache/%{name}
%global tempdir %{cachedir}/temp
%global workdir %{cachedir}/work
Name: tomcat10.1.54
Epoch: 1
Version: %{major_version}.%{minor_version}.%{micro_version}
Release: 1%{?dist}
Summary: Apache Servlet/JSP Engine, RI for Servlet %{servletspec}/JSP %{jspspec} API
# Automatically converted from old format: ASL 2.0 - review is highly recommended.
License: Apache-2.0
URL: http://tomcat.apache.org/
Source0: https://archive.apache.org/dist/tomcat/tomcat-%{major_version}/v%{version}/src/%{packdname}.tar.gz
Source1: %{upstream}-%{major_version}.%{minor_version}.conf
Source2: %{upstream}-%{major_version}.%{minor_version}.sysconfig
Source3: %{upstream}-%{major_version}.%{minor_version}.wrapper
Source4: %{upstream}-%{major_version}.%{minor_version}.logrotate
Source5: %{upstream}-%{major_version}.%{minor_version}-digest.script
Source6: %{upstream}-%{major_version}.%{minor_version}-tool-wrapper.script
Source7: %{upstream}-%{major_version}.%{minor_version}.service
Source8: %{upstream}-functions
Source9: %{upstream}-preamble
Source10: %{upstream}-server
Source11: %{upstream}-named.service
Source12: module-start-up-parameters.conf
Source13: %{upstream}.sysusers.conf
Patch0: %{upstream}-%{major_version}.%{minor_version}-bootstrap-MANIFEST.MF.patch
Patch1: %{upstream}-%{major_version}.%{minor_version}-tomcat-users-webapp.patch
Patch2: %{upstream}-build.patch
Patch3: %{upstream}-%{major_version}.%{minor_version}-catalina-policy.patch
Patch4: %{upstream}-%{major_version}.%{minor_version}-bnd-annotation.patch
Patch5: %{upstream}-%{major_version}.%{minor_version}-JDTCompiler.patch
Patch6: rhbz-1857043.patch
Patch7: %{upstream}-%{major_version}.%{minor_version}-jakartaee-migration.patch
BuildArch: noarch
BuildRequires: ant >= 1.10.2
BuildRequires: ecj
BuildRequires: findutils
BuildRequires: java-17-openjdk-devel
BuildRequires: javapackages-local
BuildRequires: aqute-bnd
BuildRequires: systemd
Requires: (java-17-openjdk-headless or java-17-openjdk)
Requires: javapackages-tools
Requires: %{name}-lib = %{epoch}:%{version}-%{release}
Recommends: libtcnative-1-0
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Obsoletes: tomcat-jsvc < %{epoch}:%{version}-%{release}
# added after log4j sub-package was removed
Provides: %{name}-log4j = %{epoch}:%{version}-%{release}
%description
Tomcat is the servlet container that is used in the official Reference
Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by
Sun under the Java Community Process.
Tomcat is developed in an open and participatory environment and
released under the Apache Software License version 2.0. Tomcat is intended
to be a collaboration of the best-of-breed developers from around the world.
%package admin-webapps
Summary: The host-manager and manager web applications for Apache Tomcat
Requires: %{name} = %{epoch}:%{version}-%{release}
%description admin-webapps
The host-manager and manager web applications for Apache Tomcat.
%package docs-webapp
Summary: The docs web application for Apache Tomcat
Requires: %{name} = %{epoch}:%{version}-%{release}
Obsoletes: tomcat-help < %{epoch}:%{version}-%{release}
%description docs-webapp
The docs web application for Apache Tomcat.
%package jsp-%{jspspec}-api
Summary: Apache Tomcat JavaServer Pages v%{jspspec} API Implementation Classes
Provides: jsp = %{jspspec}
Requires: %{name}-servlet-%{servletspec}-api = %{epoch}:%{version}-%{release}
Requires: %{name}-el-%{elspec}-api = %{epoch}:%{version}-%{release}
Obsoletes: %{name}-jsp-2.3-api < 1:9.1
Provides: %{name}-jsp-2.3-api = %{?epoch:%{epoch}:}%{version}-%{release}
%description jsp-%{jspspec}-api
Apache Tomcat JSP API Implementation Classes.
%package lib
Summary: Libraries needed to run the Tomcat Web container
Requires: %{name}-jsp-%{jspspec}-api = %{epoch}:%{version}-%{release}
Requires: %{name}-servlet-%{servletspec}-api = %{epoch}:%{version}-%{release}
Requires: %{name}-el-%{elspec}-api = %{epoch}:%{version}-%{release}
Requires: ecj
Requires(preun): coreutils
%description lib
Libraries needed to run the Tomcat Web container.
%package servlet-%{servletspec}-api
Summary: Apache Tomcat Java Servlet v%{servletspec} API Implementation Classes
Provides: servlet = %{servletspec}
Obsoletes: %{name}-servlet-4.0-api < 1:9.1
Provides: %{name}-servlet-4.0-api = %{?epoch:%{epoch}:}%{version}-%{release}
%description servlet-%{servletspec}-api
Apache Tomcat Servlet API Implementation Classes.
%package el-%{elspec}-api
Summary: Apache Tomcat Expression Language v%{elspec} API Implementation Classes
Provides: el_api = %{elspec}
Obsoletes: %{name}-el-3.0-api < 1:9.1
Provides: %{name}-el-3.0-api = %{?epoch:%{epoch}:}%{version}-%{release}
%description el-%{elspec}-api
Apache Tomcat EL API Implementation Classes.
%package webapps
Summary: The ROOT web application for Apache Tomcat
Requires: %{name} = %{epoch}:%{version}-%{release}
%description webapps
The ROOT web application for Apache Tomcat.
%prep
%autosetup -p1 -n %{packdname}
# remove pre-built binaries and windows files
find . -type f \( -name "*.bat" -o -name "*.class" -o -name Thumbs.db -o -name "*.gz" -o \
-name "*.jar" -o -name "*.war" -o -name "*.zip" \) -delete
# Remove webservices naming resources as it's generally unused
%{__rm} -rf java/org/apache/naming/factory/webservices
# Configure maven files
%mvn_package ":tomcat-el-api" tomcat-el-api
%mvn_alias "org.apache.tomcat:tomcat-el-api" "jakarta.servlet:jakarta.servlet-api"
%mvn_package ":tomcat-jsp-api" tomcat-jsp-api
%mvn_alias "org.apache.tomcat:tomcat-jsp-api" "jakarta.servlet:jakarta.servlet.jsp"
%mvn_package ":tomcat-servlet-api" tomcat-servlet-api
%build
# we don't care about the tarballs and we're going to replace jars
# so just create a dummy file for later removal
touch HACK
# Build with the Java 17 JDK shipped in this distribution
export JAVA_HOME=%{_jvmdir}/java-17-openjdk
export PATH=$JAVA_HOME/bin:$PATH
# Do not use the javapackages %%ant macro here: it expands to
# "JAVA_HOME=%%{java_home} ant" and %%{java_home} resolves to
# java-1.8.0-openjdk (the java-utils default), which overrides the Java 17
# JAVA_HOME exported above and makes build.xml fail with
# "Java version 17 or newer is required (1.8.0_xxx is installed)".
# Calling /usr/bin/ant directly keeps JAVA_HOME (Java 17) in effect.
# -Dskip.build.java.version=true mirrors the distro packaging and disables
# the bnd based OSGi metadata step, which needs a newer aqute-bnd than the
# distro ships.
# -Dmigration-lib.jar="HACK" is intentional: the Jakarta EE migration tool is
# not packaged for this distribution, the sources that referenced it are
# adjusted by Patch7 (compile time + graceful runtime degradation).
# The distro ecj (4.12 / ECJ 3.18) has no CompilerOptions.VERSION_13..17
# constants, Patch5 switches those lookups to string literals.
# who needs a build.properties file anyway
%{_bindir}/ant -Dbase.path="." \
-Dbuild.compiler="modern" \
-Dskip.build.java.version="true" \
-Dcommons-daemon.jar="HACK" \
-Dcommons-daemon.native.src.tgz="HACK" \
-Djdt.jar="$(build-classpath ecj/ecj)" \
-Dtomcat-native.tar.gz="HACK" \
-Dtomcat-native.home="." \
-Dcommons-daemon.native.win.mgr.exe="HACK" \
-Dnsis.exe="HACK" \
-Djaxrpc-lib.jar="HACK" \
-Dwsdl4j-lib.jar="HACK" \
-Dbnd.jar="$(build-classpath aqute-bnd/biz.aQute.bnd)" \
-Dversion="%{version}" \
-Dversion.build="%{micro_version}" \
-Dmigration-lib.jar="HACK" \
deploy
# remove some jars that we'll replace with symlinks later
%{__rm} output/build/bin/commons-daemon.jar output/build/lib/ecj.jar output/build/lib/HACK
# Remove the example webapps per Apache Tomcat Security Considerations
# see https://tomcat.apache.org/tomcat-10.1-doc/security-howto.html
%{__rm} -rf output/build/webapps/examples
%install
# build initial path structure
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_bindir}
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_sbindir}
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{appdir}
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{bindir}
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{confdir}
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{confdir}/Catalina/localhost
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{confdir}/conf.d
/bin/echo "Place your custom *.conf files here. Shell expansion is supported." > ${RPM_BUILD_ROOT}%{confdir}/conf.d/README
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{libdir}
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{logdir}
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{_localstatedir}/lib/tomcats
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{homedir}
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{tempdir}
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{workdir}
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_unitdir}
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_libexecdir}/%{name}
# move things into place
# First copy supporting libs to tomcat lib
pushd output/build
%{__cp} -a bin/*.{jar,xml} ${RPM_BUILD_ROOT}%{bindir}
%{__cp} -a conf/*.{policy,properties,xml,xsd} ${RPM_BUILD_ROOT}%{confdir}
%{__cp} -a lib/*.jar ${RPM_BUILD_ROOT}%{libdir}
%{__cp} -a webapps/* ${RPM_BUILD_ROOT}%{appdir}
popd
%{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE1} \
> ${RPM_BUILD_ROOT}%{confdir}/%{name}.conf
%{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE2} \
> ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{name}
%{__install} -m 0755 %{SOURCE3} \
${RPM_BUILD_ROOT}%{_sbindir}/%{name}
%{__install} -m 0644 %{SOURCE7} \
${RPM_BUILD_ROOT}%{_unitdir}/%{name}.service
%{__sed} -e "s|\@\@\@TCLOG\@\@\@|%{logdir}|g" %{SOURCE4} \
> ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}.disabled
%{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE5} \
> ${RPM_BUILD_ROOT}%{_bindir}/%{name}-digest
%{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE6} \
> ${RPM_BUILD_ROOT}%{_bindir}/%{name}-tool-wrapper
%{__install} -m 0644 %{SOURCE8} \
${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/functions
%{__install} -m 0755 %{SOURCE9} \
${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/preamble
%{__install} -m 0755 %{SOURCE10} \
${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/server
%{__install} -m 0644 %{SOURCE11} \
${RPM_BUILD_ROOT}%{_unitdir}/%{name}@.service
%{__install} -m 0644 %{SOURCE12} ${RPM_BUILD_ROOT}%{confdir}/conf.d/
# Substitute libnames in catalina-tasks.xml
sed -i \
"s,el-api.jar,%{name}-el-%{elspec}-api.jar,;
s,servlet-api.jar,%{name}-servlet-%{servletspec}-api.jar,;
s,jsp-api.jar,%{name}-jsp-%{jspspec}-api.jar,;" \
${RPM_BUILD_ROOT}%{bindir}/catalina-tasks.xml
# create jsp and servlet API symlinks
pushd ${RPM_BUILD_ROOT}%{_javadir}
%{__mv} %{name}/jsp-api.jar %{name}-jsp-%{jspspec}-api.jar
%{__ln_s} %{name}-jsp-%{jspspec}-api.jar %{name}-jsp-api.jar
%{__mv} %{name}/servlet-api.jar %{name}-servlet-%{servletspec}-api.jar
%{__ln_s} %{name}-servlet-%{servletspec}-api.jar %{name}-servlet-api.jar
%{__mv} %{name}/el-api.jar %{name}-el-%{elspec}-api.jar
%{__ln_s} %{name}-el-%{elspec}-api.jar %{name}-el-api.jar
popd
pushd output/build
%{_bindir}/build-jar-repository lib ecj 2>&1
popd
pushd ${RPM_BUILD_ROOT}%{libdir}
# symlink JSP and servlet API jars
%{__ln_s} ../../java/%{name}-jsp-%{jspspec}-api.jar .
%{__ln_s} ../../java/%{name}-servlet-%{servletspec}-api.jar .
%{__ln_s} ../../java/%{name}-el-%{elspec}-api.jar .
%{__ln_s} $(build-classpath ecj/ecj) jasper-jdt.jar
cp ../../%{name}/bin/tomcat-juli.jar .
popd
# symlink to the FHS locations where we've installed things
pushd ${RPM_BUILD_ROOT}%{homedir}
%{__ln_s} %{appdir} webapps
%{__ln_s} %{confdir} conf
%{__ln_s} %{libdir} lib
%{__ln_s} %{logdir} logs
%{__ln_s} %{tempdir} temp
%{__ln_s} %{workdir} work
popd
# Install the maven metadata for the spec impl artifacts as other projects use them
#%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_mavenpomdir}
pushd res/maven
for pom in *.pom; do
# fix-up version in all pom files
sed -i 's/@MAVEN.DEPLOY.VERSION@/%{version}/g' $pom
done
popd
# Configure and install maven artifacts
%mvn_artifact res/maven/tomcat-el-api.pom output/build/lib/el-api.jar
%mvn_artifact res/maven/tomcat-jsp-api.pom output/build/lib/jsp-api.jar
%mvn_artifact res/maven/tomcat-servlet-api.pom output/build/lib/servlet-api.jar
%mvn_file org.apache.tomcat:tomcat-annotations-api tomcat/annotations-api
%mvn_artifact res/maven/tomcat-annotations-api.pom ${RPM_BUILD_ROOT}%{libdir}/annotations-api.jar
%mvn_artifact res/maven/tomcat-api.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-api.jar
%mvn_file org.apache.tomcat:tomcat-catalina-ant tomcat/catalina-ant
%mvn_artifact res/maven/tomcat-catalina-ant.pom ${RPM_BUILD_ROOT}%{libdir}/catalina-ant.jar
%mvn_file org.apache.tomcat:tomcat-catalina-ha tomcat/catalina-ha
%mvn_artifact res/maven/tomcat-catalina-ha.pom ${RPM_BUILD_ROOT}%{libdir}/catalina-ha.jar
%mvn_file org.apache.tomcat:tomcat-catalina tomcat/catalina
%mvn_artifact res/maven/tomcat-catalina.pom ${RPM_BUILD_ROOT}%{libdir}/catalina.jar
%mvn_artifact res/maven/tomcat-coyote.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-coyote.jar
%mvn_artifact res/maven/tomcat-dbcp.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-dbcp.jar
%mvn_artifact res/maven/tomcat-i18n-cs.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-i18n-cs.jar
%mvn_artifact res/maven/tomcat-i18n-de.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-i18n-de.jar
%mvn_artifact res/maven/tomcat-i18n-es.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-i18n-es.jar
%mvn_artifact res/maven/tomcat-i18n-fr.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-i18n-fr.jar
%mvn_artifact res/maven/tomcat-i18n-ja.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-i18n-ja.jar
%mvn_artifact res/maven/tomcat-i18n-ko.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-i18n-ko.jar
%mvn_artifact res/maven/tomcat-i18n-pt-BR.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-i18n-pt-BR.jar
%mvn_artifact res/maven/tomcat-i18n-ru.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-i18n-ru.jar
%mvn_artifact res/maven/tomcat-i18n-zh-CN.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-i18n-zh-CN.jar
%mvn_file org.apache.tomcat:tomcat-jasper-el tomcat/jasper-el
%mvn_artifact res/maven/tomcat-jasper-el.pom ${RPM_BUILD_ROOT}%{libdir}/jasper-el.jar
%mvn_file org.apache.tomcat:tomcat-jasper tomcat/jasper
%mvn_artifact res/maven/tomcat-jasper.pom ${RPM_BUILD_ROOT}%{libdir}/jasper.jar
%mvn_file org.apache.tomcat:tomcat-jaspic-api tomcat/jaspic-api
%mvn_artifact res/maven/tomcat-jaspic-api.pom ${RPM_BUILD_ROOT}%{libdir}/jaspic-api.jar
%mvn_artifact res/maven/tomcat-jdbc.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-jdbc.jar
%mvn_artifact res/maven/tomcat-jni.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-jni.jar
%mvn_artifact res/maven/tomcat-juli.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-juli.jar
%mvn_file org.apache.tomcat:tomcat-ssi tomcat/catalina-ssi
%mvn_artifact res/maven/tomcat-ssi.pom ${RPM_BUILD_ROOT}%{libdir}/catalina-ssi.jar
%mvn_file org.apache.tomcat:tomcat-storeconfig tomcat/catalina-storeconfig
%mvn_artifact res/maven/tomcat-storeconfig.pom ${RPM_BUILD_ROOT}%{libdir}/catalina-storeconfig.jar
%mvn_file org.apache.tomcat:tomcat-tribes tomcat/catalina-tribes
%mvn_artifact res/maven/tomcat-tribes.pom ${RPM_BUILD_ROOT}%{libdir}/catalina-tribes.jar
%mvn_artifact res/maven/tomcat-util-scan.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-util-scan.jar
%mvn_artifact res/maven/tomcat-util.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-util.jar
%mvn_file org.apache.tomcat:tomcat-websocket-api tomcat/websocket-api
%mvn_artifact res/maven/tomcat-websocket-api.pom ${RPM_BUILD_ROOT}%{libdir}/websocket-api.jar
%mvn_artifact res/maven/tomcat-websocket.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-websocket.jar
%mvn_artifact res/maven/tomcat-websocket-client-api.pom ${RPM_BUILD_ROOT}%{libdir}/websocket-client-api.jar
%mvn_artifact res/maven/tomcat.pom
%mvn_install
install -m0644 -D %{S:13} %{buildroot}%{_sysusersdir}/%{name}.conf
%pre
%sysusers_create_compat %{S:13}
%post
# install but don't activate
%systemd_post %{name}.service
%preun
# clean tempdir and workdir on removal or upgrade
%{__rm} -rf %{workdir}/* %{tempdir}/*
%systemd_preun %{name}.service
%postun
%systemd_postun_with_restart %{name}.service
%files
%defattr(0664,root,tomcat,0755)
%doc {LICENSE,NOTICE,RELEASE*}
%attr(0755,root,root) %{_bindir}/%{name}-digest
%attr(0755,root,root) %{_bindir}/%{name}-tool-wrapper
%attr(0755,root,root) %{_sbindir}/%{name}
%attr(0644,root,root) %{_unitdir}/%{name}.service
%attr(0644,root,root) %{_unitdir}/%{name}@.service
%attr(0755,root,root) %dir %{_libexecdir}/%{name}
%attr(0755,root,root) %dir %{_localstatedir}/lib/tomcats
%attr(0644,root,root) %{_libexecdir}/%{name}/functions
%attr(0755,root,root) %{_libexecdir}/%{name}/preamble
%attr(0755,root,root) %{_libexecdir}/%{name}/server
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}.disabled
%attr(0755,root,tomcat) %dir %{basedir}
%attr(0755,root,tomcat) %dir %{confdir}
%defattr(0664,tomcat,root,0770)
%attr(0770,tomcat,root) %dir %{logdir}
%defattr(0664,root,tomcat,0770)
%attr(0770,root,tomcat) %dir %{cachedir}
%attr(0770,root,tomcat) %dir %{tempdir}
%attr(0770,root,tomcat) %dir %{workdir}
%defattr(0644,root,tomcat,0775)
%attr(0775,root,tomcat) %dir %{appdir}
%attr(0775,root,tomcat) %dir %{confdir}/Catalina
%attr(0775,root,tomcat) %dir %{confdir}/Catalina/localhost
%attr(0755,root,tomcat) %dir %{confdir}/conf.d
%{confdir}/conf.d/README
%{confdir}/conf.d/module-start-up-parameters.conf
%config(noreplace) %{confdir}/%{name}.conf
%config(noreplace) %{confdir}/*.policy
%config(noreplace) %{confdir}/*.properties
%config(noreplace) %{confdir}/context.xml
%config(noreplace) %{confdir}/server.xml
%attr(0640,root,tomcat) %config(noreplace) %{confdir}/tomcat-users.xml
%attr(0664,root,tomcat) %{confdir}/tomcat-users.xsd
%attr(0664,root,tomcat) %config(noreplace) %{confdir}/jaspic-providers.xml
%attr(0664,root,tomcat) %{confdir}/jaspic-providers.xsd
%config(noreplace) %{confdir}/web.xml
%dir %{homedir}
%{bindir}/bootstrap.jar
%{bindir}/catalina-tasks.xml
%{homedir}/lib
%{homedir}/temp
%{homedir}/webapps
%{homedir}/work
%{homedir}/logs
%{homedir}/conf
%{_sysusersdir}/%{name}.conf
%files admin-webapps
%defattr(0664,root,tomcat,0755)
%{appdir}/host-manager
%{appdir}/manager
%files docs-webapp
%{appdir}/docs
%files lib -f .mfiles
%dir %{libdir}
%{libdir}/*.jar
%{_javadir}/*.jar
%{bindir}/tomcat-juli.jar
%exclude %{libdir}/%{name}-el-%{elspec}-api.jar
%exclude %{libdir}/%{name}-servlet-%{servletspec}*.jar
%exclude %{libdir}/%{name}-jsp-%{jspspec}*.jar
%exclude %{_javadir}/%{name}-servlet-%{servletspec}*.jar
%exclude %{_javadir}/%{name}-el-%{elspec}-api.jar
%exclude %{_javadir}/%{name}-jsp-%{jspspec}*.jar
%exclude %{_javadir}/%{name}-servlet-api.jar
%exclude %{_javadir}/%{name}-el-api.jar
%exclude %{_javadir}/%{name}-jsp-api.jar
%exclude %{_jnidir}/*
%files jsp-%{jspspec}-api -f .mfiles-tomcat-jsp-api
%{_javadir}/%{name}-jsp-%{jspspec}*.jar
%{libdir}/%{name}-jsp-%{jspspec}*.jar
%{_javadir}/%{name}-jsp-api.jar
%files servlet-%{servletspec}-api -f .mfiles-tomcat-servlet-api
%doc LICENSE
%{_javadir}/%{name}-servlet-%{servletspec}*.jar
%{libdir}/%{name}-servlet-%{servletspec}*.jar
%{_javadir}/%{name}-servlet-api.jar
%files el-%{elspec}-api -f .mfiles-tomcat-el-api
%doc LICENSE
%{_javadir}/%{name}-el-%{elspec}-api.jar
%{libdir}/%{name}-el-%{elspec}-api.jar
%{_javadir}/%{name}-el-api.jar
%files webapps
%defattr(0644,tomcat,tomcat,0755)
%{appdir}/ROOT
%changelog
* Fri Nov 27 2026 AI Importer <ai-importer@openeuler.org> - 1:10.1.54-1
- update to 10.1.54
* Mon Nov 23 2026 wangkai <13474090681@163.com> - 1:10.1.62-1
- update to 10.1.62
- Backport fix for CVE-2026-133325 (TLS-PSK with TLS 1.3 must reject
peers that authenticate with a certificate instead of the PSK)
* Tue Oct 13 2026 Funda Wang <fundawang@yeah.net> - 1:10.1.61-1
- update to 10.1.61
* Sat Oct 10 2026 xu_ping <707078654@qq.com> - 1:10.1.60-1
- update to 10.1.60
* Sat Aug 22 2026 Funda Wang <fundawang@yeah.net> - 1:10.1.59-1
- update to 10.1.59
* Mon Aug 17 2026 wangkai <13474090681@163.com> - 1:10.1.57-3
- Fix installation warning messages
* Wed Jul 29 2026 yaoxin <1024769339@qq.com> - 1:10.1.57-2
- Fix CVE-2026-66299
* Wed Jul 15 2026 yaoxin <1024769339@qq.com> - 1:10.1.57-1
- Update to 10.1.57 for fix CVE-2026-59083 and CVE-2026-59084
* Tue Jun 30 2026 yaoxin <1024769339@qq.com> - 1:10.1.56-1
- Update to 10.1.56 for fix CVEs: CVE-2026-50229, CVE-2026-53404,
CVE-2026-53434, CVE-2026-55276, CVE-2026-55955, CVE-2026-55956,
CVE-2026-55957
* Wed Jun 17 2026 Ge Wang <wang__ge@126.com> - 1:10.1.55-1
- Update to 10.1.55
* Wed May 13 2026 yaoxin <1024769339@qq.com> - 1:9.0.118-1
- Update to 9.0.118 for fix CVEs: CVE-2026-41284, CVE-2026-41293,
CVE-2026-42498, CVE-2026-43512, CVE-2026-43513, CVE-2026-43514,
CVE-2026-43515
- Fix tomcat-jsvc stop failed
* Fri Apr 10 2026 yaoxin <1024769339@qq.com> - 1:9.0.117-1
- Update to 9.0.117 for fix CVEs: CVE-2026-24880, CVE-2026-25854,
CVE-2026-29129, CVE-2026-29145, CVE-2026-29146, CVE-2026-32990,
CVE-2026-34483, CVE-2026-34486, CVE-2026-34487, CVE-2026-34500
* Wed Mar 11 2026 yaoxin <1024769339@qq.com> - 1:9.0.115-1
- Update to 9.0.115 for fix CVE-2026-24733, CVE-2026-24734 and CVE-2025-66614
* Tue Mar 03 2026 wangkai <13474090681@163.com> - 1:9.0.100-10
- Replace %%add_maven_depmap with %%mvn_artifact
* Tue Oct 28 2025 yaoxin <1024769339@qq.com> - 1:9.0.100-9
- Fix CVE-2025-55752, CVE-2025-55754 and CVE-2025-61795
* Fri Aug 15 2025 Yu Peng <yupeng@kylinos.cn> - 1:9.0.100-8
- Fix CVE-2025-48989
* Thu Aug 14 2025 Yu Peng <yupeng@kylinos.cn> - 1:9.0.100-7
- Fix CVE-2025-55668
* Fri Jul 11 2025 wangkai <13474090681@163.com> - 1:9.0.100-6
- Fix CVE-2025-52434 CVE-2025-53506 CVE-2025-52520
* Mon Jun 30 2025 wangkai <13474090681@163.com> - 1:9.0.100-5
- Fix CVE-2025-48976
* Wed Jun 18 2025 wangkai <13474090681@163.com> - 1:9.0.100-4
- Fix CVE-2025-48988, CVE-2025-49125
* Wed Jun 04 2025 yaoxin <1024769339@qq.com> - 1:9.0.100-3
- Fix CVE-2025-46701
* Tue Apr 29 2025 wangkai <13474090681@163.com> - 1:9.0.100-2
- Fix CVE-2025-31650, CVE-2025-31651
* Fri Feb 21 2025 wangkai <13474090681@163.com> - 1:9.0.100-1
- Update to 9.0.100 for fix CVE-2024-56337
- Add a check to ensure that, if one or more web applications are potentially vulnerable to CVE-2024-56337,
the JVM has been configured to protect against the vulnerability and to configure the JVM correctly if not.
* Wed Dec 18 2024 wangkai <13474090681@163.com> - 1:9.0.96-4
- Fix CVE-2024-50379 CVE-2024-54677
* Tue Nov 26 2024 wangkai <13474090681@163.com> - 1:9.0.96-3
- Add requires ecj for fix server error
* Tue Nov 19 2024 wangkai <13474090681@163.com> - 1:9.0.96-2
- Fix CVE-2024-52318
* Thu Nov 07 2024 chenyaqiang <chengyaqiang@huawei.com> - 1:9.0.96-1
- Update to 9.0.96
- Fix CVE-2021-43980 CVE-2022-25762 CVE-2023-44487 CVE-2023-46589
CVE-2024-23672 CVE-2024-24549 CVE-2024-34750
* Tue Jan 23 2024 wangkai <13474090681@163.com> - 1:9.0.10-33
- Fix CVE-2024-21733,CVE-2023-24998,CVE-2023-28709,CVE-2023-42795
* Fri Oct 20 2023 wangkai <13474090681@163.com> - 1:9.0.10-32
- Fix CVE-2023-45648
* Thu Sep 07 2023 wangkai <13474090681@163.com> - 1:9.0.10-31
- Fix CVE-2023-41080
- Add requires apache-commons-dbcp,pool,collections for fix path error
* Mon Apr 17 2023 wangkai <13474090681@163.com> - 1:9.0.10-30
- Fix CVE-2023-28708
* Wed Dec 21 2022 xulei <xulei@xfusion.com> - 1:9.0.10-29
- Fix CVE-2022-42252
* Fri Aug 12 2022 liyanan <liyanan32@h-partners.com> - 1:9.0.10-28
- Update build-classpath calls to ECJ to specify the JAR we want to use
* Tue May 24 2022 chenchen <chen_aka_jan@163.com> - 1:9.0.10-27
- fix build error
* Mon Apr 25 2022 wangkai <wangkai@h-partners.com - 1:9.0.10-26
- Refix CVE-2021-41079
* Fri Feb 18 2022 wangkai <wangkai385@huawei.com> - 1:9.0.10-25
- Fix CVE-2022-23181
* Wed Nov 10 2021 caodongxia <caodongxia@huawei.com> - 1:9.0.10-24
- Replace recommends libtcnative-1-0 with requires libtcnative-1-0
* Wed Nov 3 2021 caodongxia <caodongxia@huawei.com> - 1:9.0.10-23
- Replace recommends tomcat-native with libtcnative-1-0
* Thu Oct 28 2021 liwu <liwu13@huawei.com> - 1:9.0.10-22
- Fix CVE-2021-42340
* Sat Oct 9 2021 houyingchao <houyingchao@huawei.com> - 1:9.0.10-21
- Fix CVE-2021-41079
* Thu Jul 29 2021 wangyue <wangyue92@huawei.com> - 1:9.0.10-20
- Fix CVE-2021-30640
* Mon Jul 19 2021 wangyue <wangyue92@huawei.com> - 1:9.0.10-19
- Fix CVE-2021-33037
* Fri Mar 12 2021 wangyue <wangyue92@huawei.com> - 1:9.0.10-18
- Type:cve
- ID: CVE-2021-25122 CVE-2021-25329
- SUG:restart
- DESC: fix CVE-2021-25122 CVE-2021-25329
* Thu Feb 18 2021 wangxiao <wangxiao65@huawei.com> - 1:9.0.10-17
- Type:cve
- ID: CVE-2021-24122
- SUG:restart
- DESC: fix CVE-2021-24122
* Sat Dec 12 2020 zhanghua <zhanghua40@huawei.com> - 1:9.0.10-16
- Type:cve
- ID: CVE-2020-17527
- SUG:restart
- DESC: fix CVE-2020-17527
* Wed Dec 2 2020 jialei <jialei17@huawei.com> - 1:9.0.10-15
- Type:cves
- ID: CVE-2020-13943
- SUG:restart
- DESC: fix CVE-2020-13943
* Wed Sep 9 2020 wangxiao <wangxiao65@huawei.com> - 1:9.0.10-14
- Type:cves
- ID: CVE-2020-9484 CVE-2020-11996 CVE-2020-13934 CVE-2020-13935
- SUG:restart
- DESC: fix CVE-2020-9484 CVE-2020-11996 CVE-2020-13934 CVE-2020-13935
* Tue May 19 2020 huanghaitao <huanghaitao8@huawei.com> - 1:9.0.10-13
- Type:cves
- ID: CVE-2019-17563 CVE-2019-12418 CVE-2020-1935 CVE-2020-1938
- SUG:restart
- DESC: fix CVE-2019-17563 CVE-2019-12418CVE-2020-1935 CVE-2020-1938
* Mon May 11 2020 Guoshuai Sun<sunguoshuai@huawei.com> - 1:9.0.10-12
- Add install require ecj package
* Fri Feb 28 2020 Senlin Xia<xiasenlin1@huawei.com> - 1:9.0.10-11
- Package init
|