From: Scott Weaver <scwea...@redhat.com>

redhat/Makefile: add dist-git-automotive target

kernel-automotive requires a separate dist-git which requires a specific
make dist-git equivalent. This adds the targets dist-git-automotive and
dist-git-automotive-test targets.

Because kernel-automotive is not a centos stream package, additional
changes were required in order to support the Automotive SIG dist-git.
These changes require supporting centpkg-sig which itself does not by
default support the kernel-automotive dist-git in gitlab.

Signed-off-by: Scott Weaver <scwea...@redhat.com>

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -294,6 +294,8 @@ ifeq ("$(DISTRO)", "fedora")
   RHPKG_BIN:=fedpkg
 else ifeq ("$(DISTRO)", "centos")
   RHDISTGIT_BRANCH=c$(RHEL_MAJOR)s
+  # This is a CentOS SIG dist-git for AutoSD rather than for CentOS Stream.
+  AUTOMOTIVE_DISTGIT_BRANCH=c$(RHEL_MAJOR)s-sig-automotive-main
   ifndef BUILD_PROFILE
     BUILD_PROFILE:= -p stream
   endif
@@ -308,8 +310,12 @@ else ifeq ("$(DISTRO)", "centos")
   DISTBASEVERSION=$(BASEVERSION)$(DIST)
   PATCHLIST_URL:=none
   RHPKG_BIN:=centpkg
+  AUTOMOTIVE_RHPKG_BIN:=centpkg-sig
+  AUTOMOTIVE_DISTGIT_NS:=automotive/rpms/
+  AUTOMOTIVE_RHPKG_OPTS:=--config $(REDHAT)/automotive-centpkg-sig.conf
 else
   RHDISTGIT_BRANCH:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0
+  AUTOMOTIVE_DISTGIT_BRANCH=rhivos-$(AUTOMOTIVE_MAJOR).$(AUTOMOTIVE_MINOR).0
   ifndef BUILD_TARGET
     ifeq ("$(DIST)", ".eln")
       BUILD_TARGET:=eln
@@ -333,6 +339,9 @@ else
   endif
   PATCHLIST_URL:=none
   RHPKG_BIN:=rhpkg
+  AUTOMOTIVE_RHPKG_BIN:=rhpkg
+  AUTOMOTIVE_DISTGIT_NS:=
+  AUTOMOTIVE_RHPKG_OPTS:=
 endif
 
 TARFILE=linux-$(SPECTARFILE_RELEASE).tar.xz
@@ -925,6 +934,9 @@ _dist-brew-automotive: dist-srpm-automotive
 dist-git-test: export RH_DIST_GIT_TEST="1"
 dist-git-test: dist-git
 
+dist-git-automotive-test: export RH_DIST_GIT_TEST="1"
+dist-git-automotive-test: dist-git-automotive
+
 dist-git: dist-srpm $(KABI_TARBALL) $(KABIDW_TARBALL) dist-check-release
        @if [ -z "$(RHDISTGIT_BRANCH)" ]; then \
                echo "RHDISTGIT_BRANCH is unset"; \
@@ -932,6 +944,21 @@ dist-git: dist-srpm $(KABI_TARBALL) $(KABIDW_TARBALL) 
dist-check-release
        fi
        $(REDHAT)/scripts/rh-dist-git.sh
 
+# kernel-automotive uses a separate dist-git
+dist-git-automotive: SPECPACKAGE_NAME := kernel-automotive
+dist-git-automotive: DIST := .el$(RHEL_MAJOR)iv
+dist-git-automotive: RHDISTGIT_BRANCH := $(AUTOMOTIVE_DISTGIT_BRANCH)
+dist-git-automotive: RHPKG_BIN := $(AUTOMOTIVE_RHPKG_BIN)
+dist-git-automotive: RHPKG_OPTS := $(AUTOMOTIVE_RHPKG_OPTS)
+dist-git-automotive: RHPKG_NS := $(AUTOMOTIVE_DISTGIT_NS)
+dist-git-automotive: dist-srpm-automotive dist-check-release
+dist-git-automotive:
+       @if [ -z "$(AUTOMOTIVE_DISTGIT_BRANCH)" ]; then \
+               echo "AUTOMOTIVE_DISTGIT_BRANCH is unset"; \
+               exit 1; \
+       fi
+       $(REDHAT)/scripts/rh-dist-git.sh
+
 dist-headers-srpm:
        @scripts/create_headers_tarball.sh
        @cp $(REDHAT)/kernel-headers.spec.template 
$(SOURCES)/kernel-headers.spec
diff --git a/redhat/automotive-centpkg-sig.conf 
b/redhat/automotive-centpkg-sig.conf
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/automotive-centpkg-sig.conf
@@ -0,0 +1,32 @@
+# kernel-automotive is not a centos stream package. It is part of the
+# Automotive SIG and its dist-git is in the new gitlab centos namespace.
+# This file was originally copied from centpkg-0.9.1-2.el10_1 which is
+# used to override /etc/rpkg/centpkg-sig.conf.
+# Usage: centpkg-sig --config path/to/automotive-centpkg-sig.conf clone 
automotive/rpms/kernel-automotive
+[centpkg-sig]
+lookaside = https://git.centos.org/sources
+lookasidehash = sha512
+lookaside_cgi = https://git.centos.org/sources/upload_sig.cgi
+distgit_namespaced = True
+distgit_namespaces = rpms
+gitbaseurl = ssh://g...@gitlab.com/CentOS/%(repo)s.git
+anongiturl = https://gitlab.com/CentOS/%(repo)s
+branchre = .*
+kojiprofile = cbs
+build_client = cbs
+lookaside_namespaced = True
+git_excludes =
+  i386/
+  i686/
+  x86_64/
+  ppc/
+  ppc64/
+  ia64/
+  mips/
+  arm/
+  noarch/
+  /*.src.rpm
+  /build*.log
+  /.build-*.log
+  results_*/
+  clog
diff --git a/redhat/scripts/rh-dist-git.sh b/redhat/scripts/rh-dist-git.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/rh-dist-git.sh
+++ b/redhat/scripts/rh-dist-git.sh
@@ -29,7 +29,7 @@ cd "$tmpdir" || die "Unable to create temporary directory";
 test -n "$RHDISTGIT_CACHE" && reference="-- --reference $RHDISTGIT_CACHE"
 echo "Cloning using $RHPKG_BIN" >&2;
 # shellcheck disable=SC2086
-eval $RHPKG_BIN clone "$SPECPACKAGE_NAME" "$reference" >/dev/null || die 
"Unable to clone using $RHPKG_BIN";
+eval $RHPKG_BIN $RHPKG_OPTS clone "${RHPKG_NS}${SPECPACKAGE_NAME}" 
"$reference" >/dev/null || die "Unable to clone using $RHPKG_BIN";
  
 echo "Switching the branch"
 # change in the correct branch

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3870

-- 
_______________________________________________
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to