[OS-BUILD PATCHv2 1/2] [redhat] Makefile: new dist-buildreq-check target

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

 



From: Ben Crocker <bcrocker@xxxxxxxxxx>

[redhat] Makefile: new dist-buildreq-check target

Add a new dist-buildreq-check target that checks for missing
packages via rpmspec -q --buildrequires, and make dist-configs-prep
dependent on it.

This change is based on suggestions from Josh Poimboeuf, Don Zickus,
and Herton Krzesinski.  Ultimately this is Herton's version, which
generates the list of missing packages from an already-created
kernel.spec file.

Signed-off-by: Ben Crocker <bcrocker@xxxxxxxxxx>

diff a/redhat/Makefile b/redhat/Makefile
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -144,7 +144,7 @@ rh-configs: dist-configs
 dist-configs-check: dist-configs-prep
 	cd $(REDHAT)/configs; ./process_configs.sh $(PROCESS_CONFIGS_CHECK_OPTS) $(PACKAGE_NAME)
 
-dist-configs-prep: dist-clean-configs
+dist-configs-prep: dist-clean-configs dist-buildreq-check
 	cd $(REDHAT)/configs; ./build_configs.sh "$(PACKAGE_NAME)" "$(ARCH_MACH)" "$(FLAVOR)"
 
 dist-configs-arch: ARCH_MACH = $(MACH)
@@ -210,6 +210,17 @@ dist-git-version-check:
 		exit 1; \
 	fi
 
+dist-buildreq-check: setup-source
+	@PKGLIST="rpm-build $(rpmspec -q --buildrequires $(SOURCES)/$(SPECFILE) | cut -d ' ' -f 1)"; \
+	MISSING=""; \
+	for pkg in $$PKGLIST; do \
+		rpm -q --whatprovides $$pkg >/dev/null || MISSING="$$MISSING $$pkg"; \
+	done; \
+	if [ -n "$$MISSING" ]; then \
+		echo "Error: please install $$MISSING"; \
+		exit 1; \
+	fi
+
 setup-source: dist-git-version-check dist-clean-sources
 	@cp $(REDHAT)/$(SPECFILE).template $(SOURCES)/$(SPECFILE)
 	@if [ ! -e  $(REDHAT)/$(CHANGELOG) ]; then \
@@ -265,7 +276,7 @@ sources-rh: $(TARBALL) generate-testpatch-tmp
 	fi
 	@(cd kabi-dwarf && tar cjf $(SOURCES)/$(KABIDW_TARFILE) base run_kabi-dw.sh)
 
-dist-sources: setup-source dist-configs-check dist-kabi dist-kabi-dup sources-rh
+dist-sources: dist-configs-check dist-kabi dist-kabi-dup sources-rh
 
 dist-test-patch: generate-testpatch-tmp
 	@mv $(TESTPATCH).tmp $(TESTPATCH);
@@ -515,6 +526,7 @@ dist-full-help:
 
 	@echo  ''
 	@echo  'Misc targets:'
+	@echo  '  dist-buildreq-check - Checks for presence of packages required for build'
 	@echo  '  dist-get-latest - Returns the latest "known good" kernel from brew. This'
 	@echo  '                    should not be confused with the latest top-of-tree'
 	@echo  '                    development tag.'

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/859
_______________________________________________
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




[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