The build rules of rpm-pkg and srcrpm-pkg are almost the same. Remove the code duplication. Change rpm-pkg to build binary packages from the source package generated by srcrpm-pkg. This changes the output directory of the srpm generated by 'make rpm-pkg' because srcrpm-pkg overrides _srcrpmdir.
Unified · Split
| @@ -87,11 +87,9 @@ linux.tar.gz: .tmp_filelist · 86 unmodified lines | ||
| 87 | 87 | # rpm-pkg |
| 88 | 88 | # --------------------------------------------------------------------------- |
| 89 | 89 | PHONY += rpm-pkg |
| 90 | −rpm-pkg: | |
| 91 | − $(MAKE) clean | |
| 92 | − $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec | |
| 93 | − $(call cmd,src_tar,$(KERNELPATH),kernel.spec) | |
| 94 | − +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ta $(KERNELPATH).tar.gz \ | |
| 90 | +rpm-pkg: srpm = $(shell rpmspec --srpm --query --queryformat='%{name}-%{VERSION}-%{RELEASE}.src.rpm' kernel.spec) | |
| 91 | +rpm-pkg: srcrpm-pkg | |
| 92 | + +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -rb $(srpm) \ | |
| 95 | 93 | --define='_smp_mflags %{nil}' |
| 96 | 94 | |
| 97 | 95 | # srcrpm-pkg |