[OS-BUILD PATCHv8 1/7] redhat: Change PACKAGE_NAME to SPECPACKAGE_NAME

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Prarit Bhargava <prarit@xxxxxxxxxx>

redhat: Change PACKAGE_NAME to SPECPACKAGE_NAME

PACKAGE_NAME will be exported to the spec file and according to the naming
rules must be renamed to SPECPACKAGE_NAME.  This change will make future
changes easier and more obvious for review.

Signed-off-by: Prarit Bhargava <prarit@xxxxxxxxxx>

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -56,13 +56,13 @@ ARCHCONFIG := $(shell uname -m | sed -e s/x86_64/X86_64/ \
 				     -e s/s390x/S390/ -e s/ppc.*/PPC/ )
 
 # rpm information
-SPECFILE:=$(PACKAGE_NAME).spec
+SPECFILE:=$(SPECPACKAGE_NAME).spec
 RPM:=$(REDHAT)/rpm
 SRPMS:=$(RPM)/SRPMS
 SOURCES:=$(RPM)/SOURCES
 TESTPATCH:=$(REDHAT)/linux-kernel-test.patch
-SPECCHANGELOG:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(RHEL_MINOR)
-CHANGELOG_PREV:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(shell expr $(RHEL_MINOR) - 1)
+SPECCHANGELOG:=$(SPECPACKAGE_NAME).changelog-$(RHEL_MAJOR).$(RHEL_MINOR)
+CHANGELOG_PREV:=$(SPECPACKAGE_NAME).changelog-$(RHEL_MAJOR).$(shell expr $(RHEL_MINOR) - 1)
 ARCH_LIST=aarch64 ppc64le s390x x86_64
 
 ifndef DISTRO
@@ -202,19 +202,19 @@ endif
 # The NVR looks like, for example, kernel-5.17.0-0.rc8.551acdc3c3d2.124.test.fc35.
 # This string can be deconstructed as
 #
-# $(PACKAGE_NAME)-$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)-$(UPSTREAMBUILD)$(BUILD)$(DISTLOCALVERSION)$(DIST)
+# $(SPECPACKAGE_NAME)-$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)-$(UPSTREAMBUILD)$(BUILD)$(DISTLOCALVERSION)$(DIST)
 #
 # This can be evaluated as
 #
-# $(PACKAGE_NAME)-$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)-$(SPECBUILD)          $(DIST)
-# $(PACKAGE_NAME)-$(SPECVERSION)                                     -$(SPECBUILD)          $(DIST)
-# $(PACKAGE_NAME)-$(BASEVERSION)                                                            $(DIST)
+# $(SPECPACKAGE_NAME)-$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)-$(SPECBUILD)          $(DIST)
+# $(SPECPACKAGE_NAME)-$(SPECVERSION)                                     -$(SPECBUILD)          $(DIST)
+# $(SPECPACKAGE_NAME)-$(BASEVERSION)                                                            $(DIST)
 # $(RELEASETAG)                                                                             $(DIST)
 #
 SPECBUILD:=$(UPSTREAMBUILD)$(BUILD)$(DISTLOCALVERSION)
 SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
 BASEVERSION:=$(SPECVERSION)-$(SPECBUILD)
-RELEASETAG:=$(PACKAGE_NAME)-$(BASEVERSION)
+RELEASETAG:=$(SPECPACKAGE_NAME)-$(BASEVERSION)
 SRPM:=$(SRPMS)/$(RELEASETAG)$(DIST).src.rpm
 
 #
@@ -505,7 +505,7 @@ dist-configs-check: dist-configs-prep
 
 dist-configs-prep: dist-clean-configs
 	+cd $(REDHAT)/configs; ./build_configs.sh "partial" "snip"
-	+cd $(REDHAT)/configs; ./build_configs.sh "$(PACKAGE_NAME)" "$(FLAVOR)"
+	+cd $(REDHAT)/configs; ./build_configs.sh "$(SPECPACKAGE_NAME)" "$(FLAVOR)"
 
 dist-configs-arch: ARCH_MACH = $(MACH)
 dist-configs-arch: dist-configs
@@ -618,7 +618,7 @@ sources-rh: $(TARBALL) generate-testpatch-tmp setup-source dist-configs-check
 	@cp scripts/kernel-tools/kvm_stat.logrotate \
 		keys/rhel*.x509 \
 		kabi/check-kabi \
-		configs/$(PACKAGE_NAME)-*.config \
+		configs/$(SPECPACKAGE_NAME)-*.config \
 		configs/partial*.config \
 		scripts/gating/gating.yaml \
 		scripts/update_scripts.sh \
diff --git a/redhat/Makefile.variables b/redhat/Makefile.variables
index blahblah..blahblah 100644
--- a/redhat/Makefile.variables
+++ b/redhat/Makefile.variables
@@ -81,11 +81,6 @@ KABI_SUPPORTED_ARCHS ?=
 # This disables the CONFIG error checking in redhat/configs/process_configs.sh.
 NO_CONFIGCHECKS ?=
 
-# This can be used to change the filename of the specfile.  For example, it can
-# be set to "kernel" for kernel.spec or "kernel-rt" for kernel-rt.spec.  This
-# is useful for other projects with different specfile names.
-PACKAGE_NAME ?= kernel
-
 # In case PATCHLIST_URL is not set to "none", Patchlist.changelog is added to
 # the kernel src.rpm, which will contain shas and commits not upstream. The
 # value of PATCHLIST_URL in this case should point to the git repository where
@@ -134,6 +129,11 @@ RHSELFTESTDATA ?=
 # the selftests fail to build.
 SPECSELFTESTS_MUST_BUILD ?= 0
 
+# This can be used to change the filename of the specfile.  For example, it can
+# be set to "kernel" for kernel.spec or "kernel-rt" for kernel-rt.spec.  This
+# is useful for other projects with different specfile names.
+SPECPACKAGE_NAME ?= kernel
+
 # The branch used as upstream. This is what the upstream tarball is it
 # should be tracked in a local branch. This would be "master" for the
 # Linus master branch or linux-5.x.y for a stable branch. It can also be
diff --git a/redhat/configs/build_configs.sh b/redhat/configs/build_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/build_configs.sh
+++ b/redhat/configs/build_configs.sh
@@ -1,12 +1,12 @@
 #!/bin/bash
 #
 # This script merges together the hierarchy of CONFIG_* files under generic
-# and debug to form the necessary $PACKAGE_NAME<version>-<arch>-<variant>.config
+# and debug to form the necessary $SPECPACKAGE_NAME<version>-<arch>-<variant>.config
 # files for building RHEL kernels, based on the contents of a control file
 
 test -n "$RHTEST" && exit 0
 
-PACKAGE_NAME="${1:-kernel}" # defines the package name used
+SPECPACKAGE_NAME="${1:-kernel}" # defines the package name used
 if [ -z "$2" ]; then
 	cat flavors > .flavors
 else
@@ -71,7 +71,7 @@ function merge_configs()
 	flavor=$4
 	count=$5
 
-	name=$OUTPUT_DIR/$PACKAGE_NAME-$archvar-$flavor.config
+	name=$OUTPUT_DIR/$SPECPACKAGE_NAME-$archvar-$flavor.config
 	echo "Building $name ... "
 	touch config-merging."$count" config-merged."$count"
 
@@ -133,7 +133,7 @@ function build_flavor()
 			empty=$(echo "$line" | cut -f2 -d"=")
 			for a in $empty
 			do
-				echo "# EMPTY" > "$OUTPUT_DIR/$PACKAGE_NAME-$a-$flavor".config
+				echo "# EMPTY" > "$OUTPUT_DIR/$SPECPACKAGE_NAME-$a-$flavor".config
 
 			done
 		elif [ "$(echo "$line" | grep -c "^ORDER")" -ne 0 ]; then
diff --git a/redhat/configs/process_configs.sh b/redhat/configs/process_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/process_configs.sh
+++ b/redhat/configs/process_configs.sh
@@ -193,7 +193,7 @@ function commit_new_configs()
 	# assume we are in $source_tree/configs, need to get to top level
 	pushd "$(switch_to_toplevel)" &>/dev/null
 
-	for cfg in "$SCRIPT_DIR/${PACKAGE_NAME}${KVERREL}"*.config
+	for cfg in "$SCRIPT_DIR/${SPECPACKAGE_NAME}${KVERREL}"*.config
 	do
 		arch=$(head -1 "$cfg" | cut -b 3-)
 		cfgtmp="${cfg}.tmp"
@@ -304,7 +304,7 @@ function process_configs()
 	[ -f .mismatches ] && rm -f .mismatches
 
 	count=0
-	for cfg in "$SCRIPT_DIR/${PACKAGE_NAME}${KVERREL}"*.config
+	for cfg in "$SCRIPT_DIR/${SPECPACKAGE_NAME}${KVERREL}"*.config
 	do
 		if [ "$count" -eq 0 ]; then
 			# do the first one by itself so that tools are built
diff --git a/redhat/docs/kernel-naming.rst b/redhat/docs/kernel-naming.rst
index blahblah..blahblah 100644
--- a/redhat/docs/kernel-naming.rst
+++ b/redhat/docs/kernel-naming.rst
@@ -10,7 +10,7 @@ information about the upstream release, a unique build number, and information
 about the distribution the RPM was targeted for.  An explanation of each of the
 fields and how the fields are used in the kernel NVR, is below.
 
-**PACKAGE_NAME**: This is the name of the package.  By default this is
+**SPECPACKAGE_NAME**: This is the name of the package.  By default this is
 'kernel', but a well-known variant is kernel-rt.
 
 **SPECKVERSION**: This is the VERSION variable defined in the top-level linux
@@ -39,6 +39,6 @@ be overriden by defining a string in redhat/localversion.
 
 The kernel name is constructed as
 
-$(PACKAGE_NAME)-$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)-$(UPSTREAMBUILD)$(BUILD)$(DISTLOCALVERSION)$(DIST)
+$(SPECPACKAGE_NAME)-$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)-$(UPSTREAMBUILD)$(BUILD)$(DISTLOCALVERSION)$(DIST)
 
 In general, the kernel follows the Fedora Naming Guidelines, `https://fedoraproject.org/wiki/Packaging:Naming?rd=Packaging:NamingGuidelines <https://fedoraproject.org/wiki/Packaging:Naming?rd=Packaging:NamingGuidelines>`__.
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -1626,7 +1626,7 @@ for opt in %{clang_make_opts}; do
   OPTS="$OPTS -m $opt"
 done
 %endif
-RHJOBS=$RPM_BUILD_NCPUS PACKAGE_NAME=kernel ./process_configs.sh $OPTS ${specversion}
+RHJOBS=$RPM_BUILD_NCPUS SPECPACKAGE_NAME=kernel ./process_configs.sh $OPTS ${specversion}
 
 cp %{SOURCE82} .
 RPM_SOURCE_DIR=$RPM_SOURCE_DIR ./update_scripts.sh %{primary_target}
diff --git a/redhat/koji/Makefile b/redhat/koji/Makefile
index blahblah..blahblah 100644
--- a/redhat/koji/Makefile
+++ b/redhat/koji/Makefile
@@ -29,8 +29,8 @@ sources: buildid
 	echo $(BUILDID) > ../../localversion
 	$(MAKE) -C ../ dist-sources
 	mv -f ../rpm/SOURCES/* .
-	rm -f ./$(PACKAGE_NAME).spec
-	mv ../rpm/SPECS/$(PACKAGE_NAME).spec .
+	rm -f ./$(SPECPACKAGE_NAME).spec
+	mv ../rpm/SPECS/$(SPECPACKAGE_NAME).spec .
 
 test:	buildid
 	echo $(BUILDID)
diff --git a/redhat/scripts/expand_srpm.sh b/redhat/scripts/expand_srpm.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/expand_srpm.sh
+++ b/redhat/scripts/expand_srpm.sh
@@ -3,7 +3,7 @@
 # $1: cloned tree
 cloned="$1";
 
-cd "$cloned/$PACKAGE_NAME" || die "\"$cloned\" doesn't seem to have a dist-git clone";
+cd "$cloned/$SPECPACKAGE_NAME" || die "\"$cloned\" doesn't seem to have a dist-git clone";
 
 # delete everything in the cloned tree to avoid having stale files
 rm -r -- *
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,11 +29,11 @@ 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 "$PACKAGE_NAME" "$reference" >/dev/null || die "Unable to clone using $RHPKG_BIN";
+eval $RHPKG_BIN clone "$SPECPACKAGE_NAME" "$reference" >/dev/null || die "Unable to clone using $RHPKG_BIN";
  
 echo "Switching the branch"
 # change in the correct branch
-cd "$tmpdir/$PACKAGE_NAME";
+cd "$tmpdir/$SPECPACKAGE_NAME";
 $RHPKG_BIN switch-branch "$RHDISTGIT_BRANCH" || die "switching to branch $RHDISTGIT_BRANCH";
 
 echo "Copying updated files"
@@ -42,9 +42,9 @@ echo "Copying updated files"
 
 echo "Uploading new tarballs"
 # upload tarballs
-sed -i "/linux-.*.tar.xz/d" "$tmpdir/$PACKAGE_NAME"/{sources,.gitignore};
-sed -i "/kernel-abi-stablelists.*.tar.bz2/d" "$tmpdir/$PACKAGE_NAME"/{sources,.gitignore};
-sed -i "/kernel-kabi-dw-.*.tar.bz2/d" "$tmpdir/$PACKAGE_NAME"/{sources,.gitignore};
+sed -i "/linux-.*.tar.xz/d" "$tmpdir/$SPECPACKAGE_NAME"/{sources,.gitignore};
+sed -i "/kernel-abi-stablelists.*.tar.bz2/d" "$tmpdir/$SPECPACKAGE_NAME"/{sources,.gitignore};
+sed -i "/kernel-kabi-dw-.*.tar.bz2/d" "$tmpdir/$SPECPACKAGE_NAME"/{sources,.gitignore};
 upload_list="$TARBALL $KABI_TARBALL $KABIDW_TARBALL"
 
 # We depend on word splitting here:
@@ -54,11 +54,11 @@ upload $upload_list
 echo "Creating diff for review ($tmpdir/diff) and changelog"
 # diff the result (redhat/git/dontdiff). note: diff reuturns 1 if
 # differences were found
-diff -X "$REDHAT"/git/dontdiff -upr "$tmpdir/$PACKAGE_NAME" "$REDHAT"/rpm/SOURCES/ > "$tmpdir"/diff;
+diff -X "$REDHAT"/git/dontdiff -upr "$tmpdir/$SPECPACKAGE_NAME" "$REDHAT"/rpm/SOURCES/ > "$tmpdir"/diff;
 # creating the changelog file
 
 # changelog has been created by genspec.sh, including Resolves line, just copy it here
-echo -e "${PACKAGE_NAME}-${DISTBASEVERSION}\n" > "$tmpdir"/changelog
+echo -e "${SPECPACKAGE_NAME}-${DISTBASEVERSION}\n" > "$tmpdir"/changelog
 awk '1;/^Resolves: /{exit};' "$REDHAT"/"$SPECCHANGELOG" >> "$tmpdir"/changelog
 
 # all done

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2253
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux