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: add ability to make source rpm buildable using koji

Changes:
- added new target 'srcrpm-pkg' to generate source rpm
- added required build tools to spec file
- removed locally compiled host tools to force their re-compile

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
Acked-by: Íñigo Huguet <ihuguet@redhat.com>
Tested-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

authored by

Ivan Vecera and committed by
Masahiro Yamada
8818039f 598afa05

+17
+10
scripts/Makefile.package
··· 62 62 +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ta $(KERNELPATH).tar.gz \ 63 63 --define='_smp_mflags %{nil}' 64 64 65 + # srcrpm-pkg 66 + # --------------------------------------------------------------------------- 67 + PHONY += srcrpm-pkg 68 + srcrpm-pkg: 69 + $(MAKE) clean 70 + $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec 71 + $(call cmd,src_tar,$(KERNELPATH),kernel.spec) 72 + +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ts $(KERNELPATH).tar.gz \ 73 + --define='_smp_mflags %{nil}' --define='_srcrpmdir $(srctree)' 74 + 65 75 # binrpm-pkg 66 76 # --------------------------------------------------------------------------- 67 77 PHONY += binrpm-pkg
+7
scripts/package/mkspec
··· 33 33 --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \ 34 34 --exclude=.config.old --exclude=.missing-syscalls.d --exclude=*.s" 35 35 36 + test -n "$LOCALVERSION" && MAKE="$MAKE LOCALVERSION=$LOCALVERSION" 37 + 36 38 # We can label the here-doc lines for conditional output to the spec file 37 39 # 38 40 # Labels: ··· 51 49 URL: https://www.kernel.org 52 50 $S Source: kernel-$__KERNELRELEASE.tar.gz 53 51 Provides: $PROVIDES 52 + $S BuildRequires: bc binutils bison dwarves elfutils-libelf-devel flex 53 + $S BuildRequires: gcc make openssl openssl-devel perl python3 rsync 54 + 54 55 # $UTS_MACHINE as a fallback of _arch in case 55 56 # /usr/lib/rpm/platform/*/macros was not included. 56 57 %define _arch %{?_arch:$UTS_MACHINE} ··· 85 80 $S$M 86 81 $S %prep 87 82 $S %setup -q 83 + $S rm -f scripts/basic/fixdep scripts/kconfig/conf 84 + $S rm -f tools/objtool/{fixdep,objtool} 88 85 $S 89 86 $S %build 90 87 $S $MAKE %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release}