Message ID | 5b59fdb7db34f5292b1d138939c6b70b2b2039dd.1666703850.git.jtoppins@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1004800wru; Tue, 25 Oct 2022 06:26:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4gTx6DGuT905DEtFHK1ZHFtUppeYAEDj8SyjDBy0p237i0m4a67Y5igupfEc2ZjTnofdiY X-Received: by 2002:a63:2b10:0:b0:451:5df1:4b17 with SMTP id r16-20020a632b10000000b004515df14b17mr32272716pgr.61.1666704364448; Tue, 25 Oct 2022 06:26:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666704364; cv=none; d=google.com; s=arc-20160816; b=QycLUCg6hwS2xejy9pJ7fWw+v8za+EiSDYvH7T6MaWXuecikR/swnBS2fRWR7Y9wyt 1gNTN4UBmj5B+kr32NMcbxwkjQaXiS6usv0E4eGrc5V2QkNVZjPffPhrhYWC4Tov2EvW 8a6I7Bavba2nu5anDfTVfKltaj3SiMXTpCmKy8kn9I5EBu27iUPzvfT+gy52GmY4s6lg WqmdIZGr1mQ2j81CypvEMJUHPK3NBKeD+eaOUTDEcQcETSq8glDubN2mgvjH/sti+R60 wL9TB+DHba74+SnKdwXpQx4sjxUtdYHH9elcfDb01qLsvEZUPCVWblH5BfghcnOySxpf /Rog== 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=MAsS6j5/KUgYwehdScWVOm+WWLh2WflTE+nFerqwEQQ=; b=a5lCUxUXKNEi3rWIBlrZC5yjG2jCRBMhY2gMiaUYbAiLujuwQQiP69pnivFOHnWsei k2vFtLOMaUJ+8WqIZm+WsHk2JpkWxXmr6h1+g6RQigJSLIy5+wBkQPvVTEbtoH+CBWRs 6Gl++LyLN35ts9p54D0wYjDhCPRtx29rsFMGY3cCgjZ6FDF0bkkpOQEk/kqmcoR+M2TR IxVBNarNiwWG9WFm4AxxqfknGQeKFCcin/O1kAtwYJo4gVccnvqhQ3bctVg475/1r0JX 3tWiZDS9FUzWOeYtdDNDXZir9rRXlmCkF6wlat/00Snst83vqtHkxNzgfaoiiXC+dBWR YSuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iRyHF6+3; 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 v6-20020a1709029a0600b001822121c45fsi2806242plp.338.2022.10.25.06.25.49; Tue, 25 Oct 2022 06:26:04 -0700 (PDT) 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=iRyHF6+3; 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 S232743AbiJYNRw (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Tue, 25 Oct 2022 09:17:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232749AbiJYNRv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 25 Oct 2022 09:17:51 -0400 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 87211E4E63 for <linux-kernel@vger.kernel.org>; Tue, 25 Oct 2022 06:17:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666703869; 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=MAsS6j5/KUgYwehdScWVOm+WWLh2WflTE+nFerqwEQQ=; b=iRyHF6+3Wo5qhZvrZrOFIIJvWvxzDHHFUnIz9duFD5JxHgQVhcj5j8IrhP6kFAl9BPQ4xr CodUYcMURRqLLTshL3p/0RVXsVLPAUFJAsrSfju0jJx/4dm0lWUcaTRTMHK4EDuv87UksT hcmg+Kz0OCajr+MjXbHuMUTWtK+WanU= 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-594-3i9hSQetNHyKsM1G9Lodnw-1; Tue, 25 Oct 2022 09:17:47 -0400 X-MC-Unique: 3i9hSQetNHyKsM1G9Lodnw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 270621C0878D; Tue, 25 Oct 2022 13:17:47 +0000 (UTC) Received: from jtoppins.rdu.csb (unknown [10.22.17.122]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65B19C15BAB; Tue, 25 Oct 2022 13:17:46 +0000 (UTC) From: Jonathan Toppins <jtoppins@redhat.com> To: linux-kbuild@vger.kernel.org Cc: dzickus@redhat.com, kheib@redhat.com, jtornosm@redhat.com, ihuguet@redhat.com, Ivan Vecera <ivecera@redhat.com>, Masahiro Yamada <masahiroy@kernel.org>, Michal Marek <michal.lkml@markovi.net>, Nick Desaulniers <ndesaulniers@google.com>, linux-kernel@vger.kernel.org Subject: [PATCH next] kbuild: add ability to make source rpm buildable using koji Date: Tue, 25 Oct 2022 09:17:30 -0400 Message-Id: <5b59fdb7db34f5292b1d138939c6b70b2b2039dd.1666703850.git.jtoppins@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Spam-Status: No, score=-2.6 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?1747666195270643830?= |
Series |
[next] kbuild: add ability to make source rpm buildable using koji
|
|
Commit Message
Jonathan Toppins
Oct. 25, 2022, 1:17 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> --- scripts/Makefile.package | 10 ++++++++++ scripts/package/mkspec | 7 +++++++ 2 files changed, 17 insertions(+)
Comments
On Tue, Oct 25, 2022 at 3:17 PM Jonathan Toppins <jtoppins@redhat.com> 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> > --- > 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..e0830a870394 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) -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} > -- > 2.31.1 >
On Tue, 25 Oct 2022 09:17:30 -0400 Jonathan Toppins <jtoppins@redhat.com> 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> > --- > 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..e0830a870394 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) -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} Tested-by: Ivan Vecera <ivecera@redhat.com>
On Tue, Oct 25, 2022 at 10:17 PM Jonathan Toppins <jtoppins@redhat.com> 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> I am fine with this patch. Just minor comments. I noticed an inconsistency between "--target $(UTS_MACHINE)-linux" in the rpm-pkg target and "--target $(UTS_MACHINE)" in the srcrpm-pkg target. I applied 6105e4f6511d6b383738be89efb99c607e158a29 just a few months ago. Is it better to make it consistent here? Actually, I do not know koji, also not sure if it is important to mention it in the commit subject. I just tested this patch by using 'rpmbuild' command 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..e0830a870394 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) -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} > -- > 2.31.1 > -- Best Regards Masahiro Yamada
On 11/13/22 08:33, Masahiro Yamada wrote: > On Tue, Oct 25, 2022 at 10:17 PM Jonathan Toppins <jtoppins@redhat.com> 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> > > > > I am fine with this patch. > > Just minor comments. > > > I noticed an inconsistency between > "--target $(UTS_MACHINE)-linux" in the rpm-pkg target and > "--target $(UTS_MACHINE)" in the srcrpm-pkg target. > > > I applied 6105e4f6511d6b383738be89efb99c607e158a29 > just a few months ago. > Is it better to make it consistent here? Yes I can post a v2 that includes this change. > > Actually, I do not know koji, also not sure if it is > important to mention it in the commit subject. > I just tested this patch by using 'rpmbuild' command > on my local machine. koji (https://koji.fedoraproject.org/koji/) is the automated builder available to Fedora developers. With this patch a developer can produce an upstream kernel rpm rather easily. > > [...] > > > -- > Best Regards > Masahiro Yamada >
On Tue, Oct 25, 2022 at 10:17 PM Jonathan Toppins <jtoppins@redhat.com> 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> Applied to linux-kbuild. 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..e0830a870394 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) -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} > -- > 2.31.1 >
diff --git a/scripts/Makefile.package b/scripts/Makefile.package index 8bbcced67c22..e0830a870394 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) -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}