Commit 8818039f authored by Ivan Vecera's avatar Ivan Vecera Committed by Masahiro Yamada

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: default avatarIvan Vecera <ivecera@redhat.com>
Signed-off-by: default avatarJonathan Toppins <jtoppins@redhat.com>
Acked-by: default avatarÍñigo Huguet <ihuguet@redhat.com>
Tested-by: default avatarIvan Vecera <ivecera@redhat.com>
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 598afa05
...@@ -62,6 +62,16 @@ rpm-pkg: ...@@ -62,6 +62,16 @@ rpm-pkg:
+rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ta $(KERNELPATH).tar.gz \ +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ta $(KERNELPATH).tar.gz \
--define='_smp_mflags %{nil}' --define='_smp_mflags %{nil}'
# srcrpm-pkg
# ---------------------------------------------------------------------------
PHONY += srcrpm-pkg
srcrpm-pkg:
$(MAKE) clean
$(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
$(call cmd,src_tar,$(KERNELPATH),kernel.spec)
+rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ts $(KERNELPATH).tar.gz \
--define='_smp_mflags %{nil}' --define='_srcrpmdir $(srctree)'
# binrpm-pkg # binrpm-pkg
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
PHONY += binrpm-pkg PHONY += binrpm-pkg
......
...@@ -33,6 +33,8 @@ EXCLUDES="$RCS_TAR_IGNORE --exclude=*vmlinux* --exclude=*.mod \ ...@@ -33,6 +33,8 @@ EXCLUDES="$RCS_TAR_IGNORE --exclude=*vmlinux* --exclude=*.mod \
--exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \ --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \
--exclude=.config.old --exclude=.missing-syscalls.d --exclude=*.s" --exclude=.config.old --exclude=.missing-syscalls.d --exclude=*.s"
test -n "$LOCALVERSION" && MAKE="$MAKE LOCALVERSION=$LOCALVERSION"
# We can label the here-doc lines for conditional output to the spec file # We can label the here-doc lines for conditional output to the spec file
# #
# Labels: # Labels:
...@@ -49,6 +51,9 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF ...@@ -49,6 +51,9 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
URL: https://www.kernel.org URL: https://www.kernel.org
$S Source: kernel-$__KERNELRELEASE.tar.gz $S Source: kernel-$__KERNELRELEASE.tar.gz
Provides: $PROVIDES Provides: $PROVIDES
$S BuildRequires: bc binutils bison dwarves elfutils-libelf-devel flex
$S BuildRequires: gcc make openssl openssl-devel perl python3 rsync
# $UTS_MACHINE as a fallback of _arch in case # $UTS_MACHINE as a fallback of _arch in case
# /usr/lib/rpm/platform/*/macros was not included. # /usr/lib/rpm/platform/*/macros was not included.
%define _arch %{?_arch:$UTS_MACHINE} %define _arch %{?_arch:$UTS_MACHINE}
...@@ -80,6 +85,8 @@ $S$M against the $__KERNELRELEASE kernel package. ...@@ -80,6 +85,8 @@ $S$M against the $__KERNELRELEASE kernel package.
$S$M $S$M
$S %prep $S %prep
$S %setup -q $S %setup -q
$S rm -f scripts/basic/fixdep scripts/kconfig/conf
$S rm -f tools/objtool/{fixdep,objtool}
$S $S
$S %build $S %build
$S $MAKE %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release} $S $MAKE %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment