Fix build.sh to recognize AlmaLinux as RHEL-compatible

This commit is contained in:
Eduard Abdullin 2026-04-20 13:49:06 +00:00 committed by root
commit 78cbdc1e7f

View File

@ -14,7 +14,7 @@ Name: dogtag-pki
# Downstream release number:
# - development/stabilization (unsupported): 0.<n> where n >= 1
# - GA/update (supported): <n> where n >= 1
%global release_number 2
%global release_number 3
# Development phase:
# - development (unsupported): alpha<n> where n >= 1
@ -218,11 +218,11 @@ BuildRequires: javapackages-tools
%if %{without runtime_deps}
BuildRequires: xmlstarlet
%endif
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 10
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 11
BuildRequires: tomcat-lib >= 1:10.1.36
BuildRequires: tomcat-jakartaee-migration
%else
BuildRequires: tomcat-lib >= 9.0
BuildRequires: tomcat9-lib >= 9.0.62
%endif
BuildRequires: mvn(commons-cli:commons-cli)
@ -259,7 +259,7 @@ BuildRequires: mvn(org.jboss.resteasy:resteasy-jackson2-provider)
BuildRequires: mvn(org.jboss.resteasy:resteasy-servlet-initializer)
%endif
%if 0%{?fedora} && 0%{?fedora} >= 44 || 0%{?rhel} && 0%{?rhel} >= 10
%if 0%{?fedora} && 0%{?fedora} >= 44 || 0%{?rhel} && 0%{?rhel} >= 11
BuildRequires: mvn(org.apache.tomcat:tomcat-catalina) >= 10.1.36
BuildRequires: mvn(org.apache.tomcat:tomcat-servlet-api) >= 10.1.36
@ -269,9 +269,13 @@ BuildRequires: mvn(org.apache.tomcat:tomcat-util-scan) >= 10.0.36
%else
BuildRequires: mvn(org.apache.tomcat:tomcat-catalina) >= 9.0.62
BuildRequires: mvn(org.apache.tomcat:tomcat-catalina) < 10
BuildRequires: mvn(org.apache.tomcat:tomcat-servlet-api) >= 9.0.62
BuildRequires: mvn(org.apache.tomcat:tomcat-servlet-api) < 10
BuildRequires: mvn(org.apache.tomcat:tomcat-jaspic-api) >= 9.0.62
BuildRequires: mvn(org.apache.tomcat:tomcat-jaspic-api) < 10
BuildRequires: mvn(org.apache.tomcat:tomcat-util-scan) >= 9.0.62
BuildRequires: mvn(org.apache.tomcat:tomcat-util-scan) < 10
%endif
@ -495,13 +499,13 @@ to manage enterprise Public Key Infrastructure deployments.
%{product_name} consists of the following components:
* Certificate Authority (CA)
* Key Recovery Authority (KRA)
* Online Certificate Status Protocol (OCSP) Manager
* Token Key Service (TKS)
* Token Processing Service (TPS)
* Automatic Certificate Management Environment (ACME) Responder
* Enrollment over Secure Transport (EST) Responder
* Certificate Authority (CA)
* Key Recovery Authority (KRA)
* Online Certificate Status Protocol (OCSP) Manager
* Token Key Service (TKS)
* Token Processing Service (TPS)
* Automatic Certificate Management Environment (ACME) Responder
* Enrollment over Secure Transport (EST) Responder
# with meta
%endif
@ -691,10 +695,10 @@ Requires: mvn(org.jboss.resteasy:resteasy-servlet-initializer)
Provides: bundled(resteasy-servlet-initializer) = 3.0.26
%endif
%if 0%{?rhel} && 0%{?rhel} >= 10
%if 0%{?rhel} && 0%{?rhel} >= 11
Requires: tomcat >= 1:10.1.36
%else
Requires: tomcat >= 1:9.0.62
Requires: tomcat9 >= 1:9.0.62
%endif
Requires: mvn(org.dogtagpki.jss:jss-tomcat) >= 5.9.0
@ -1108,7 +1112,7 @@ popd
%endif
%if 0%{?fedora} && 0%{?fedora} >= 44 || 0%{?rhel} && 0%{?rhel} >= 10
%if 0%{?fedora} && 0%{?fedora} >= 44 || 0%{?rhel} && 0%{?rhel} >= 11
#migrate the source first because we are starting with tomcat 9 code, so we can build against either tomcat 9 or 10.1, based on the build platform
/usr/bin/javax2jakarta -profile=EE -exclude=./base/tomcat-9.0 ./base ./base
%endif
@ -1189,7 +1193,7 @@ then
#migrate necessary files being copied around to jakarta 9.0 ee, for >= f43 and rhel10
%if 0%{?fedora} && 0%{?fedora} >= 44 || 0%{?rhel} && 0%{?rhel} >= 10
%if 0%{?fedora} && 0%{?fedora} >= 44 || 0%{?rhel} && 0%{?rhel} >= 11
echo "Doing the tomcat 10 version..."
/usr/bin/javax2jakarta -profile=EE jboss-jaxrs-api_2.0_spec-$JAXRS_VERSION.jar jboss-jaxrs-api_2.0_spec-$JAXRS_VERSION.jar
@ -1238,8 +1242,7 @@ then
cp /usr/share/java/resteasy/resteasy-servlet-initializer.jar \
resteasy-servlet-initializer-$RESTEASY_VERSION.jar
yy %if 0%{?fedora} && 0%{?fedora} >= 44 || 0%{?rhel} && 0%{?rhel} >= 10
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 10
%if 0%{?fedora} && 0%{?fedora} >= 44 || 0%{?rhel} && 0%{?rhel} >= 11
/usr/bin/javax2jakarta -profile=EE resteasy-servlet-initializer-$RESTEASY_VERSION.jar resteasy-servlet-initializer-$RESTEASY_VERSION.jar
%endif
@ -1256,7 +1259,7 @@ fi
%if ! %{with server}
%pom_disable_module tomcat base
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 10
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 11
%pom_disable_module tomcat-10.1 base
%else
%pom_disable_module tomcat-9.0 base
@ -1309,7 +1312,7 @@ fi
%mvn_file org.dogtagpki.pki:pki-server pki/pki-server
%mvn_file org.dogtagpki.pki:pki-server-webapp pki/pki-server-webapp
%mvn_file org.dogtagpki.pki:pki-tomcat pki/pki-tomcat
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 10
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 11
%mvn_file org.dogtagpki.pki:pki-tomcat-10.1 pki/pki-tomcat-10.1
%else
%mvn_file org.dogtagpki.pki:pki-tomcat-9.0 pki/pki-tomcat-9.0
@ -1334,7 +1337,7 @@ fi
%mvn_package org.dogtagpki.pki:pki-server-webapp pki-server
%mvn_package org.dogtagpki.pki:pki-tomcat pki-server
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 10
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 11
%mvn_package org.dogtagpki.pki:pki-tomcat-10.1 pki-server
%else
%mvn_package org.dogtagpki.pki:pki-tomcat-9.0 pki-server
@ -1365,7 +1368,7 @@ export JAVA_HOME=%{java_home}
%if %{with maven}
# build Java binaries and run unit tests with Maven
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 10
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 11
%pom_disable_module tomcat-9.0 base
%pom_remove_dep :pki-tomcat-9.0 base/server
%else
@ -1387,7 +1390,7 @@ ln -sf ../../base/tools/target/pki-tools.jar
%if %{with server}
ln -sf ../../base/tomcat/target/pki-tomcat.jar
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 10
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 11
ln -sf ../../base/tomcat-10.1/target/pki-tomcat-10.1.jar
%else
ln -sf ../../base/tomcat-9.0/target/pki-tomcat-9.0.jar
@ -1453,6 +1456,13 @@ pkgs=base\
%{?with_tests:,tests}\
%{?with_debug:,debug}
## Force use of tomcat 9.
sed -i 's/^APP_SERVER=.*/APP_SERVER=tomcat-9.0/g' build.sh
# build PKI console, Javadoc, and native binaries with CMake
./build.sh \
%{?_verbose:-v} \
@ -1973,7 +1983,7 @@ fi
%{_datadir}/java/pki/pki-server.jar
%{_datadir}/java/pki/pki-server-webapp.jar
%{_datadir}/java/pki/pki-tomcat.jar
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 10
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 11
%{_datadir}/java/pki/pki-tomcat-10.1.jar
%else
%{_datadir}/java/pki/pki-tomcat-9.0.jar
@ -2165,9 +2175,13 @@ fi
################################################################################
%changelog
* Wed Apr 08 2026 Eduard Abdullin <eabdullin@almalinux.org> - 11.9.0-2.alma.1
* Mon Apr 20 2026 Eduard Abdullin <eabdullin@almalinux.org> - 11.9.0-3.alma.1
- Fix build.sh to recognize AlmaLinux as RHEL-compatible
* Fri Mar 13 2026 Red Hat PKI Team <rhcs-maint@redhat.com> - 11.9.0-3
- Revert to tomcat 9
- Resolves: RHEL-155406
* Tue Mar 10 2026 Red Hat PKI Team <rhcs-maint@redhat.com> - 11.9.0-2
- Rebuilt for exception target