Message ID | d6d5ce3169da8559cd20d20889849546cc69be50.1669042125.git.jtoppins@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1647789wrr; Mon, 21 Nov 2022 07:14:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf4DEvrNFYD3ZKjAT2d+6gJruERckYnSok8NhyZhXsqFDMfgaqYoN9f4nkBB60qcRPmXwTO0 X-Received: by 2002:a05:6402:5412:b0:460:e19c:15a3 with SMTP id ev18-20020a056402541200b00460e19c15a3mr17509944edb.252.1669043650649; Mon, 21 Nov 2022 07:14:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669043650; cv=none; d=google.com; s=arc-20160816; b=zcZiGW0hbofl8lpjp1gxUHC68yUyJoBStMFL5ck/AAdveqLpDIHAeyLxERGbj14slV u+sQebwk/04dgkKwhqPrH0siN/8pBiF7hJoamRFcgRm5poesofK71QCNN1bVNBvYE81h YXMxs846Km3wgNyKteNltEp8+bymlwYcISaflRC/jLC23CVwaLxFEF2AhWTrWiDMLvG0 oWwpXuEHp8irdqv53NI5mdA2BCSh3aegR+4r4m8EzTpl6q4DIFCmvfW1yx0B3Y3ditp5 TW6TNVQ7qc0eSCe6en41OYSoq5APr9xsuvAamMHyKY/+IoMDL1t6wUkDvRNAr2Bindr2 H89w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=8s15f6YbiNJZ1KFlIgHMjRgcF6TQvT9XGT2eZS0P2qA=; b=ddkTclXgr5LgLiCuUH9KbkUvV5Is0f/7/U8lIa/vG3JSdB2O5pCLfpy3wzlznofII0 eWbuHWJe4H23PBsSiewQimgO7XPFhhYXDgOBcLlPU4XqKQoXW+2eSOcZXtnBO81KnVSi t0/5Ijf0361Bv1t5VGFUozCtaH149H66fzHu0K5rBaGZ2XzHM82yEzpyK5xBVwVcx2I1 jCKnRJOamlnXfXHQ4MHeDpBIeWKCdxkruB8b+LjSf/2tvQrYOs1aVGILMz4BfkECtwBI HREl/ewOl0zYqyf1wrZMT+OrXunpvjcRPLt8s5uT9wxcErqQyfgVU1O2SFqe057Ef7rI gv4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HvxRcP4l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g10-20020a170906538a00b00782539a0286si7915198ejo.142.2022.11.21.07.13.40; Mon, 21 Nov 2022 07:14:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HvxRcP4l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231977AbiKUPAi (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Mon, 21 Nov 2022 10:00:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231418AbiKUPAU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 21 Nov 2022 10:00:20 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6589D2DCD for <linux-kernel@vger.kernel.org>; Mon, 21 Nov 2022 06:49:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669042142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8s15f6YbiNJZ1KFlIgHMjRgcF6TQvT9XGT2eZS0P2qA=; b=HvxRcP4l4ekoEITPWCGaehxXFdBHWUkpkV864404ZbiczR9IyZe8QpQ3UHJI3Jz/n4nIaj dzrjdaMW2KvipDnFL39ubcP3qx2MNu8facY3KTFjYt3/x3/IPHoRlrXBib+bJkSTIwK067 GLO1BFrnvhoVcRG2ZjkqwjPNdWOihlQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-70-IAA0qnkINS2XAe7m2x-rvg-1; Mon, 21 Nov 2022 09:48:59 -0500 X-MC-Unique: IAA0qnkINS2XAe7m2x-rvg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A01F51C008A5; Mon, 21 Nov 2022 14:48:58 +0000 (UTC) Received: from jtoppins.rdu.csb (unknown [10.22.10.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84BFE2027062; Mon, 21 Nov 2022 14:48:57 +0000 (UTC) From: Jonathan Toppins <jtoppins@redhat.com> To: linux-kbuild@vger.kernel.org Cc: masahiroy@kernel.org, dzickus@redhat.com, ihuguet@redhat.com, ivecera@redhat.com, jtoppins@redhat.com, jtornosm@redhat.com, kheib@redhat.com, linux-kernel@vger.kernel.org, michal.lkml@markovi.net, ndesaulniers@google.com, Nathan Chancellor <nathan@kernel.org>, Nicolas Schier <nicolas@fjasle.eu> Subject: [PATCH next v2] kbuild: add ability to make source rpm buildable using koji Date: Mon, 21 Nov 2022 09:48:45 -0500 Message-Id: <d6d5ce3169da8559cd20d20889849546cc69be50.1669042125.git.jtoppins@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747666195270643830?= X-GMAIL-MSGID: =?utf-8?q?1750119115429938552?= |
Series |
[next,v2] kbuild: add ability to make source rpm buildable using koji
|
|
Commit Message
Jonathan Toppins
Nov. 21, 2022, 2:48 p.m. UTC
From: Ivan Vecera <ivecera@redhat.com> 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> --- Notes: v2: * updated UTS_MACHINE to be $(UTS_MACHINE)-linux suggested by Masahiro Yamada scripts/Makefile.package | 10 ++++++++++ scripts/package/mkspec | 7 +++++++ 2 files changed, 17 insertions(+)
Comments
On 11/21/22 09:48, Jonathan Toppins wrote: > From: Ivan Vecera <ivecera@redhat.com> > > 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> > --- > > Notes: > v2: > * updated UTS_MACHINE to be $(UTS_MACHINE)-linux > suggested by Masahiro Yamada Quick ping, wanted to make sure I didn't miss any requests. Looking at patchwork there appear to be no replies to this version. Would it be reasonable to assume this version will be accepted and make it into the next kernel? > > scripts/Makefile.package | 10 ++++++++++ > scripts/package/mkspec | 7 +++++++ > 2 files changed, 17 insertions(+) > > diff --git a/scripts/Makefile.package b/scripts/Makefile.package > index 8bbcced67c22..1290f1c631fb 100644 > --- a/scripts/Makefile.package > +++ b/scripts/Makefile.package > @@ -62,6 +62,16 @@ rpm-pkg: > +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ta $(KERNELPATH).tar.gz \ > --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 > # --------------------------------------------------------------------------- > PHONY += binrpm-pkg > diff --git a/scripts/package/mkspec b/scripts/package/mkspec > index 70392fd2fd29..dda00a948a01 100755 > --- a/scripts/package/mkspec > +++ b/scripts/package/mkspec > @@ -33,6 +33,8 @@ EXCLUDES="$RCS_TAR_IGNORE --exclude=*vmlinux* --exclude=*.mod \ > --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \ > --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 > # > # Labels: > @@ -49,6 +51,9 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF > URL: https://www.kernel.org > $S Source: kernel-$__KERNELRELEASE.tar.gz > 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 > # /usr/lib/rpm/platform/*/macros was not included. > %define _arch %{?_arch:$UTS_MACHINE} > @@ -80,6 +85,8 @@ $S$M against the $__KERNELRELEASE kernel package. > $S$M > $S %prep > $S %setup -q > +$S rm -f scripts/basic/fixdep scripts/kconfig/conf > +$S rm -f tools/objtool/{fixdep,objtool} > $S > $S %build > $S $MAKE %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release}
Hi, On 12/5/22 21:37, Jonathan Toppins wrote: > On 11/21/22 09:48, Jonathan Toppins wrote: >> From: Ivan Vecera <ivecera@redhat.com> >> >> 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> >> --- >> >> Notes: >> v2: >> * updated UTS_MACHINE to be $(UTS_MACHINE)-linux >> suggested by Masahiro Yamada > > Quick ping, wanted to make sure I didn't miss any requests. Looking at patchwork there appear to be no replies to this version. Would it be reasonable to assume this version will be accepted and make it into the next kernel? I have a request: Tell us what "koji" is. I'm surprised that that word is not in the patch description at all. Thanks. >> >> scripts/Makefile.package | 10 ++++++++++ >> scripts/package/mkspec | 7 +++++++ >> 2 files changed, 17 insertions(+) >> >> diff --git a/scripts/Makefile.package b/scripts/Makefile.package >> index 8bbcced67c22..1290f1c631fb 100644 >> --- a/scripts/Makefile.package >> +++ b/scripts/Makefile.package >> @@ -62,6 +62,16 @@ rpm-pkg: >> +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ta $(KERNELPATH).tar.gz \ >> --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 >> # --------------------------------------------------------------------------- >> PHONY += binrpm-pkg >> diff --git a/scripts/package/mkspec b/scripts/package/mkspec >> index 70392fd2fd29..dda00a948a01 100755 >> --- a/scripts/package/mkspec >> +++ b/scripts/package/mkspec >> @@ -33,6 +33,8 @@ EXCLUDES="$RCS_TAR_IGNORE --exclude=*vmlinux* --exclude=*.mod \ >> --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \ >> --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 >> # >> # Labels: >> @@ -49,6 +51,9 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF >> URL: https://www.kernel.org >> $S Source: kernel-$__KERNELRELEASE.tar.gz >> 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 >> # /usr/lib/rpm/platform/*/macros was not included. >> %define _arch %{?_arch:$UTS_MACHINE} >> @@ -80,6 +85,8 @@ $S$M against the $__KERNELRELEASE kernel package. >> $S$M >> $S %prep >> $S %setup -q >> +$S rm -f scripts/basic/fixdep scripts/kconfig/conf >> +$S rm -f tools/objtool/{fixdep,objtool} >> $S >> $S %build >> $S $MAKE %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release} >
On Tue, Dec 6, 2022 at 2:44 PM Randy Dunlap <rdunlap@infradead.org> wrote: > > Hi, > > On 12/5/22 21:37, Jonathan Toppins wrote: > > On 11/21/22 09:48, Jonathan Toppins wrote: > >> From: Ivan Vecera <ivecera@redhat.com> > >> > >> 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> > >> --- > >> > >> Notes: > >> v2: > >> * updated UTS_MACHINE to be $(UTS_MACHINE)-linux > >> suggested by Masahiro Yamada > > > > Quick ping, wanted to make sure I didn't miss any requests. Looking at patchwork there appear to be no replies to this version. Would it be reasonable to assume this version will be accepted and make it into the next kernel? > > I have a request: > Tell us what "koji" is. I'm surprised that that word is not in the > patch description at all. > > Thanks. I applied this patch, but somehow I replied to v1 https://lore.kernel.org/linux-kbuild/CAK7LNATPZkMCabD5aGNamp-gH3aZvFPr2_Yq=N=rM_ht2i3p6g@mail.gmail.com/ I have never used it, but I guess koji is a build engine that generates binary packages from a source package. That's why they want to create only a source package. This patch is not related to koji (and I suggested them to drop it from the subject) I just tested it by using 'rpmbuild' on my local machine. > >> > >> scripts/Makefile.package | 10 ++++++++++ > >> scripts/package/mkspec | 7 +++++++ > >> 2 files changed, 17 insertions(+) > >> > >> diff --git a/scripts/Makefile.package b/scripts/Makefile.package > >> index 8bbcced67c22..1290f1c631fb 100644 > >> --- a/scripts/Makefile.package > >> +++ b/scripts/Makefile.package > >> @@ -62,6 +62,16 @@ rpm-pkg: > >> +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ta $(KERNELPATH).tar.gz \ > >> --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 > >> # --------------------------------------------------------------------------- > >> PHONY += binrpm-pkg > >> diff --git a/scripts/package/mkspec b/scripts/package/mkspec > >> index 70392fd2fd29..dda00a948a01 100755 > >> --- a/scripts/package/mkspec > >> +++ b/scripts/package/mkspec > >> @@ -33,6 +33,8 @@ EXCLUDES="$RCS_TAR_IGNORE --exclude=*vmlinux* --exclude=*.mod \ > >> --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \ > >> --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 > >> # > >> # Labels: > >> @@ -49,6 +51,9 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF > >> URL: https://www.kernel.org > >> $S Source: kernel-$__KERNELRELEASE.tar.gz > >> 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 > >> # /usr/lib/rpm/platform/*/macros was not included. > >> %define _arch %{?_arch:$UTS_MACHINE} > >> @@ -80,6 +85,8 @@ $S$M against the $__KERNELRELEASE kernel package. > >> $S$M > >> $S %prep > >> $S %setup -q > >> +$S rm -f scripts/basic/fixdep scripts/kconfig/conf > >> +$S rm -f tools/objtool/{fixdep,objtool} > >> $S > >> $S %build > >> $S $MAKE %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release} > > > > -- > ~Randy
On Mon, Nov 21, 2022 at 09:48:45AM -0500, Jonathan Toppins wrote: Hi Jonathan, Ivan et al, This patch causes a regression on 6.2-rc1 when rpm-pkg target is specified on non-rpm system (i.e s390 running Ubuntu). The offending chunk is: > @@ -49,6 +51,9 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF > URL: https://www.kernel.org > $S Source: kernel-$__KERNELRELEASE.tar.gz > 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 > # /usr/lib/rpm/platform/*/macros was not included. > %define _arch %{?_arch:$UTS_MACHINE}
On Mon, Dec 26, 2022 at 10:41 PM Alexander Gordeev <agordeev@linux.ibm.com> wrote: > > On Mon, Nov 21, 2022 at 09:48:45AM -0500, Jonathan Toppins wrote: > > Hi Jonathan, Ivan et al, > > This patch causes a regression on 6.2-rc1 when rpm-pkg target > is specified on non-rpm system (i.e s390 running Ubuntu). The > offending chunk is: > > > @@ -49,6 +51,9 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF > > URL: https://www.kernel.org > > $S Source: kernel-$__KERNELRELEASE.tar.gz > > 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 > > # /usr/lib/rpm/platform/*/macros was not included. > > %define _arch %{?_arch:$UTS_MACHINE} $ make RPMOPTS=--nodeps rpm-pkg works for me. FWIW: https://lore.kernel.org/lkml/20221228191014.659746-1-masahiroy@kernel.org/
diff --git a/scripts/Makefile.package b/scripts/Makefile.package index 8bbcced67c22..1290f1c631fb 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -62,6 +62,16 @@ rpm-pkg: +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ta $(KERNELPATH).tar.gz \ --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 # --------------------------------------------------------------------------- PHONY += binrpm-pkg diff --git a/scripts/package/mkspec b/scripts/package/mkspec index 70392fd2fd29..dda00a948a01 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -33,6 +33,8 @@ EXCLUDES="$RCS_TAR_IGNORE --exclude=*vmlinux* --exclude=*.mod \ --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \ --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 # # Labels: @@ -49,6 +51,9 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF URL: https://www.kernel.org $S Source: kernel-$__KERNELRELEASE.tar.gz 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 # /usr/lib/rpm/platform/*/macros was not included. %define _arch %{?_arch:$UTS_MACHINE} @@ -80,6 +85,8 @@ $S$M against the $__KERNELRELEASE kernel package. $S$M $S %prep $S %setup -q +$S rm -f scripts/basic/fixdep scripts/kconfig/conf +$S rm -f tools/objtool/{fixdep,objtool} $S $S %build $S $MAKE %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release}