diff --git a/java-21-openjdk.spec b/java-21-openjdk.spec
index fbf8820..f89b6e3 100644
--- a/java-21-openjdk.spec
+++ b/java-21-openjdk.spec
@@ -353,6 +353,13 @@
 # The tag used to create the OpenJDK tarball
 %global vcstag jdk-%{filever}+%{buildver}%{?tagsuffix:-%{tagsuffix}}
 
+# Define the OS the portable JDK is built on
+# This is undefined for CentOS & openjdk-portable-rhel-8 builds and
+# equals 'rhel7' for openjdk-portable-rhel-7 builds
+%if 0%{?centos} == 0
+%global pkgos rhel7
+%endif
+
 # Standard JPackage naming and versioning defines
 %global origin          openjdk
 %global origin_nice     OpenJDK
@@ -1275,13 +1282,6 @@ Provides: java-%{origin}-src%{?1} = %{epoch}:%{version}-%{release}
 # Define the root name of the portable packages
 %global pkgnameroot java-%{featurever}-%{origin}-portable%{?pkgos:-%{pkgos}}
 
-# Define the OS the portable JDK is built on
-# This is undefined for CentOS & openjdk-portable-rhel-8 builds and
-# equals 'rhel7' for openjdk-portable-rhel-7 builds
-%if 0%{?centos} == 0
-%global pkgos rhel7
-%endif
-
 # Define the architectures on which we build
 ExclusiveArch: %{aarch64} %{ppc64le} s390x x86_64
 
@@ -2540,6 +2540,7 @@ cjc.mainProgram(args)
 - Bump libpng version to 1.6.43 following JDK-8329004
 - Sync with RHEL 7 portable build:
   - Use ExclusiveArch over ExcludeArch
+  - pkgos definition needs to be early enough to be used in portablesuffix
 - Make build scripts executable
 - Sync the copy of the portable specfile with the latest update
 - Resolves: RHEL-58797