diff mbox series

[3/4] kbuild: rpm-pkg: build binary packages from source rpm

Message ID 20230128173843.765212-3-masahiroy@kernel.org (mailing list archive)
State New, archived
Headers show
Series [1/4] kbuild: add a script to generate a list of files ignored by git | expand

Commit Message

Masahiro Yamada Jan. 28, 2023, 5:38 p.m. UTC
The build rules of rpm-pkg and srcrpm-pkg are almost the same.
Remove the code duplication.

Make rpm-pkg build binary packages from the source package built
by srcrpm-pkg.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/Makefile.package | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/scripts/Makefile.package b/scripts/Makefile.package
index cb135c99a273..8fa6f05967aa 100644
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -68,11 +68,9 @@  quiet_cmd_tar = TAR     $@
 # rpm-pkg
 # ---------------------------------------------------------------------------
 PHONY += rpm-pkg
-rpm-pkg:
-	$(MAKE) clean
-	$(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
-	$(call cmd,src_tar,$(KERNELPATH),kernel.spec)
-	+rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ta $(KERNELPATH).tar.gz \
+rpm-pkg: srpm = $(shell rpmspec --srpm --query --queryformat='%{name}-%{VERSION}-%{RELEASE}.src.rpm' kernel.spec)
+rpm-pkg: srcrpm-pkg
+	+rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -rb $(srpm) \
 	--define='_smp_mflags %{nil}'
 
 # srcrpm-pkg