Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kbuild: rpm-pkg: refactor *rpm-pkg targets

Merge the similar build targets.

Also, make the output location consistent.

Previously, source packages were created in the build directory,
while binary packages under ~/rpmbuild/RPMS/.

Now, Kbuild creates the rpmbuild/ directory in the build directory,
and saves all packages under it.

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

+28 -32
+28 -24
scripts/Makefile.package
··· 11 11 samples scripts security sound tools usr virt \ 12 12 .config Makefile \ 13 13 Kbuild Kconfig COPYING $(wildcard localversion*) 14 - MKSPEC := $(srctree)/scripts/package/mkspec 15 14 16 15 quiet_cmd_src_tar = TAR $(2).tar.gz 17 16 cmd_src_tar = \ ··· 65 66 $(linux-tarballs): .tmp_HEAD FORCE 66 67 $(call if_changed,archive) 67 68 68 - # rpm-pkg 69 + # rpm-pkg srcrpm-pkg binrpm-pkg 69 70 # --------------------------------------------------------------------------- 70 - PHONY += rpm-pkg 71 - rpm-pkg: srpm = $(shell rpmspec --srpm --query --queryformat='%{name}-%{VERSION}-%{RELEASE}.src.rpm' kernel.spec) 72 - rpm-pkg: srcrpm-pkg 73 - +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -rb $(srpm) \ 74 - --build-in-place --noprep \ 75 - --define='_smp_mflags %{nil}' --define='make $(MAKE)' 76 71 77 - # srcrpm-pkg 78 - # --------------------------------------------------------------------------- 79 - PHONY += srcrpm-pkg 80 - srcrpm-pkg: linux.tar.gz 81 - $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec 82 - +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -bs kernel.spec \ 83 - --define='_smp_mflags %{nil}' --define='_sourcedir rpmbuild/SOURCES' --define='_srcrpmdir .' 72 + quiet_cmd_mkspec = GEN $@ 73 + cmd_mkspec = $(srctree)/scripts/package/mkspec > $@ 84 74 85 - # binrpm-pkg 86 - # --------------------------------------------------------------------------- 87 - PHONY += binrpm-pkg 88 - binrpm-pkg: 89 - $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/kernel.spec 90 - +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ 91 - $(UTS_MACHINE)-linux -bb $(objtree)/kernel.spec \ 92 - --build-in-place --noprep --define='_smp_mflags %{nil}' --without devel \ 93 - --define='make $(MAKE)' 75 + kernel.spec: FORCE 76 + $(call cmd,mkspec) 77 + 78 + PHONY += rpm-sources 79 + rpm-sources: linux.tar.gz 80 + $(Q)mkdir -p rpmbuild/SOURCES 81 + $(Q)ln -f linux.tar.gz rpmbuild/SOURCES/linux.tar.gz 82 + $(Q)cp $(KCONFIG_CONFIG) rpmbuild/SOURCES/config 83 + $(Q)$(srctree)/scripts/package/gen-diff-patch rpmbuild/SOURCES/diff.patch 84 + 85 + PHONY += rpm-pkg srcrpm-pkg binrpm-pkg 86 + 87 + rpm-pkg: private build-type := a 88 + srcrpm-pkg: private build-type := s 89 + binrpm-pkg: private build-type := b 90 + 91 + rpm-pkg srcrpm-pkg: rpm-sources 92 + rpm-pkg srcrpm-pkg binrpm-pkg: kernel.spec 93 + +$(strip rpmbuild -b$(build-type) kernel.spec \ 94 + --define='_topdir $(abspath rpmbuild)' \ 95 + $(if $(filter a b, $(build-type)), \ 96 + --target $(UTS_MACHINE)-linux --build-in-place --noprep --define='_smp_mflags %{nil}') \ 97 + $(if $(filter b, $(build-type)), \ 98 + --without devel) \ 99 + $(RPMOPTS)) 94 100 95 101 # deb-pkg srcdeb-pkg bindeb-pkg 96 102 # ---------------------------------------------------------------------------
-8
scripts/package/mkspec
··· 9 9 # Patched for non-x86 by Opencon (L) 2002 <opencon@rio.skydome.net> 10 10 # 11 11 12 - # how we were called determines which rpms we build and how we build them 13 - if [ -z "$1" ]; then 14 - mkdir -p rpmbuild/SOURCES 15 - cp linux.tar.gz rpmbuild/SOURCES 16 - cp "${KCONFIG_CONFIG}" rpmbuild/SOURCES/config 17 - "${srctree}/scripts/package/gen-diff-patch" rpmbuild/SOURCES/diff.patch 18 - fi 19 - 20 12 if grep -q CONFIG_MODULES=y include/config/auto.conf; then 21 13 echo '%define with_devel %{?_without_devel: 0} %{?!_without_devel: 1}' 22 14 else