From: Jan Stancek <jstancek(a)redhat.com>
redhat: introduce Gemini versioning
Gemini kernels won't use uname in RPM version-release, instead
they'll use RHEL_MAJOR and RHEL_REBASE_NUM.
The RPM NVR will be $PACKAGE_NAME-A.B-C.$disttag, with A and B
reflecting two RHEL variables mentioned above, and C being a
monotonic counter.
Signed-off-by: Jan Stancek <jstancek(a)redhat.com>
diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -46,6 +46,14 @@ SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne
'/^VERSION\ =\ /{s/
SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ =\
/{s///;p;q}')
SPECKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\
/{s///;p;q}')
SPECKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^EXTRAVERSION\ =\
/{s///;p;q}')
+
+SPECRVERSION:=$(shell echo $$(( $(RHEL_MAJOR) - 9 )))
+SPECRPATCHLEVEL:=$(RHEL_REBASE_NUM)
+
+ifneq ($(SPECGEMINI),0)
+ SPECKEXTRAVERSION:=
+endif
+
GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
ifndef RHSELFTESTDATA
BUILD:=$(RHEL_RELEASE)
@@ -222,9 +230,16 @@ endif
# $(SPECPACKAGE_NAME)-$(BASEVERSION)
$(DIST)
# $(RELEASETAG)
$(DIST)
#
+# Gemini kernels override RPM NVR to:
+# $(SPECPACKAGE_NAME)-$(SPECRVERSION).$(SPECRPATCHLEVEL)-$(SPECBUILD)
$(DIST)
+#
SPECBUILD:=$(UPSTREAMBUILD)$(BUILD)$(DISTLOCALVERSION)
SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
-SPECRPMVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
+ifeq ($(SPECGEMINI),0)
+ SPECRPMVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
+else
+ SPECRPMVERSION:=$(SPECRVERSION).$(SPECRPATCHLEVEL)
+endif
BASEVERSION:=$(SPECRPMVERSION)-$(SPECBUILD)
RELEASETAG:=$(SPECPACKAGE_NAME)-$(BASEVERSION)
SRPM:=$(SRPMS)/$(RELEASETAG)$(DIST).src.rpm
diff --git a/redhat/Makefile.variables b/redhat/Makefile.variables
index blahblah..blahblah 100644
--- a/redhat/Makefile.variables
+++ b/redhat/Makefile.variables
@@ -149,7 +149,11 @@ UPSTREAM_BRANCH ?= master
# If VERSION_ON_UPSTREAM is set, the versioning of the rpm package is based
# on a branch tracking upstream. This allows for generating rpms
# based on untagged releases.
-VERSION_ON_UPSTREAM:=1
+ifeq ($(SPECGEMINI),0)
+ VERSION_ON_UPSTREAM:=1
+else
+ VERSION_ON_UPSTREAM:=0
+endif
# Builds may include a s390x+zfcpdump arch build, which results in the build
# failing because the UTS_RELEASE field exceeded 64 chars. This variable can
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100644
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -122,6 +122,7 @@ Summary: The Linux kernel
# kernel package name
%global package_name %%SPECPACKAGE_NAME%%
+%global gemini %%SPECGEMINI%%
# Include Fedora files
%global include_fedora %%SPECINCLUDE_FEDORA_FILES%%
# Include RHEL files
diff --git a/redhat/scripts/genspec/genspec.sh b/redhat/scripts/genspec/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/genspec/genspec.sh
+++ b/redhat/scripts/genspec/genspec.sh
@@ -59,6 +59,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECBPFTOOLVERSION%%/$SPECBPFTOOLVERSION/
s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/
s/%%SPECPACKAGE_NAME%%/$SPECPACKAGE_NAME/
+ s/%%SPECGEMINI%%/$SPECGEMINI/
s/%%SPECSELFTESTS_MUST_BUILD%%/$SPECSELFTESTS_MUST_BUILD/"
"$SOURCES/$SPECFILE"
test -n "$RHSELFTESTDATA" && test -f "$SOURCES/$SPECFILE"
&& sed -i -e "
/%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7
b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -82,7 +82,9 @@ SPECKSUBLEVEL=0
SPECKVERSION=5
SPECPACKAGE_NAME=kernel
SPECRELEASED_KERNEL=0
+SPECRPATCHLEVEL=1
SPECRPMVERSION=5.16.0
+SPECRVERSION=0
SPECSELFTESTS_MUST_BUILD=0
SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test.el7
SPECVERSION=5.16.0
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec
@@ -1,4 +1,5 @@
%global package_name kernel
+%global gemini 0
%global include_fedora 1
%global include_rhel 1
%global patchlist_changelog 0
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25
b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -82,7 +82,9 @@ SPECKSUBLEVEL=0
SPECKVERSION=5
SPECPACKAGE_NAME=kernel
SPECRELEASED_KERNEL=0
+SPECRPATCHLEVEL=1
SPECRPMVERSION=5.16.0
+SPECRVERSION=0
SPECSELFTESTS_MUST_BUILD=0
SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test.fc25
SPECVERSION=5.16.0
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec
@@ -1,4 +1,5 @@
%global package_name kernel
+%global gemini 0
%global include_fedora 1
%global include_rhel 1
%global patchlist_changelog 0
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7
b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -82,7 +82,9 @@ SPECKSUBLEVEL=0
SPECKVERSION=5
SPECPACKAGE_NAME=kernel
SPECRELEASED_KERNEL=0
+SPECRPATCHLEVEL=1
SPECRPMVERSION=5.17.0
+SPECRVERSION=0
SPECSELFTESTS_MUST_BUILD=0
SPECTARFILE_RELEASE=5.17.0-0.rc0.78e36f3b0dae.6.test.el7
SPECVERSION=5.17.0
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec
@@ -1,4 +1,5 @@
%global package_name kernel
+%global gemini 0
%global include_fedora 1
%global include_rhel 1
%global patchlist_changelog 0
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25
b/redhat/self-test/data/centos-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25
@@ -82,7 +82,9 @@ SPECKSUBLEVEL=0
SPECKVERSION=5
SPECPACKAGE_NAME=kernel
SPECRELEASED_KERNEL=0
+SPECRPATCHLEVEL=1
SPECRPMVERSION=5.17.0
+SPECRVERSION=0
SPECSELFTESTS_MUST_BUILD=0
SPECTARFILE_RELEASE=5.17.0-0.rc0.78e36f3b0dae.6.test.fc25
SPECVERSION=5.17.0
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
b/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec
@@ -1,4 +1,5 @@
%global package_name kernel
+%global gemini 0
%global include_fedora 1
%global include_rhel 1
%global patchlist_changelog 0
diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7
b/redhat/self-test/data/centos-df0cc57e057f.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-df0cc57e057f.el7
+++ b/redhat/self-test/data/centos-df0cc57e057f.el7
@@ -82,7 +82,9 @@ SPECKSUBLEVEL=0
SPECKVERSION=5
SPECPACKAGE_NAME=kernel
SPECRELEASED_KERNEL=0
+SPECRPATCHLEVEL=1
SPECRPMVERSION=5.16.0
+SPECRVERSION=0
SPECSELFTESTS_MUST_BUILD=0
SPECTARFILE_RELEASE=5.16.0-6.test.el7
SPECVERSION=5.16.0
diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7.spec
b/redhat/self-test/data/centos-df0cc57e057f.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-df0cc57e057f.el7.spec
+++ b/redhat/self-test/data/centos-df0cc57e057f.el7.spec
@@ -1,4 +1,5 @@
%global package_name kernel
+%global gemini 0
%global include_fedora 1
%global include_rhel 1
%global patchlist_changelog 0
diff --git a/redhat/self-test/data/centos-df0cc57e057f.fc25
b/redhat/self-test/data/centos-df0cc57e057f.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-df0cc57e057f.fc25
+++ b/redhat/self-test/data/centos-df0cc57e057f.fc25
@@ -82,7 +82,9 @@ SPECKSUBLEVEL=0
SPECKVERSION=5
SPECPACKAGE_NAME=kernel
SPECRELEASED_KERNEL=0
+SPECRPATCHLEVEL=1
SPECRPMVERSION=5.16.0
+SPECRVERSION=0
SPECSELFTESTS_MUST_BUILD=0
SPECTARFILE_RELEASE=5.16.0-6.test.fc25
SPECVERSION=5.16.0
diff --git a/redhat/self-test/data/centos-df0cc57e057f.fc25.spec
b/redhat/self-test/data/centos-df0cc57e057f.fc25.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-df0cc57e057f.fc25.spec
+++ b/redhat/self-test/data/centos-df0cc57e057f.fc25.spec
@@ -1,4 +1,5 @@
%global package_name kernel
+%global gemini 0
%global include_fedora 1
%global include_rhel 1
%global patchlist_changelog 0
diff --git a/redhat/self-test/data/centos-fce15c45d3fb.el7
b/redhat/self-test/data/centos-fce15c45d3fb.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-fce15c45d3fb.el7
+++ b/redhat/self-test/data/centos-fce15c45d3fb.el7
@@ -82,7 +82,9 @@ SPECKSUBLEVEL=0
SPECKVERSION=5
SPECPACKAGE_NAME=kernel
SPECRELEASED_KERNEL=0
+SPECRPATCHLEVEL=1
SPECRPMVERSION=5.16.0
+SPECRVERSION=0
SPECSELFTESTS_MUST_BUILD=0
SPECTARFILE_RELEASE=5.16.0-0.rc5.fce15c45d3fb.6.test.el7
SPECVERSION=5.16.0
diff --git a/redhat/self-test/data/centos-fce15c45d3fb.el7.spec
b/redhat/self-test/data/centos-fce15c45d3fb.el7.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-fce15c45d3fb.el7.spec
+++ b/redhat/self-test/data/centos-fce15c45d3fb.el7.spec
@@ -1,4 +1,5 @@
%global package_name kernel
+%global gemini 0
%global include_fedora 1
%global include_rhel 1
%global patchlist_changelog 0
diff --git a/redhat/self-test/data/centos-fce15c45d3fb.fc25
b/redhat/self-test/data/centos-fce15c45d3fb.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-fce15c45d3fb.fc25
+++ b/redhat/self-test/data/centos-fce15c45d3fb.fc25
@@ -82,7 +82,9 @@ SPECKSUBLEVEL=0
SPECKVERSION=5
SPECPACKAGE_NAME=kernel
SPECRELEASED_KERNEL=0
+SPECRPATCHLEVEL=1
SPECRPMVERSION=5.16.0
+SPECRVERSION=0
SPECSELFTESTS_MUST_BUILD=0
SPECTARFILE_RELEASE=5.16.0-0.rc5.fce15c45d3fb.6.test.fc25
SPECVERSION=5.16.0
diff --git a/redhat/self-test/data/centos-fce15c45d3fb.fc25.spec
b/redhat/self-test/data/centos-fce15c45d3fb.fc25.spec
index blahblah..blahblah 100755
--- a/redhat/self-test/data/centos-fce15c45d3fb.fc25.spec
+++ b/redhat/self-test/data/centos-fce15c45d3fb.fc25.spec
@@ -1,4 +1,5 @@
%global package_name kernel
+%global gemini 0
%global include_fedora 1
%global include_rhel 1
%global patchlist_changelog 0
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2386