From patchwork Tue Oct 25 13:17:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Toppins X-Patchwork-Id: 13019234 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A69A8FA3740 for ; Tue, 25 Oct 2022 13:17:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232754AbiJYNRv (ORCPT ); Tue, 25 Oct 2022 09:17:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232743AbiJYNRv (ORCPT ); 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 7C68EE3191 for ; 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 To: linux-kbuild@vger.kernel.org Cc: dzickus@redhat.com, kheib@redhat.com, jtornosm@redhat.com, ihuguet@redhat.com, Ivan Vecera , Masahiro Yamada , Michal Marek , Nick Desaulniers , 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 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org From: Ivan Vecera 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 Signed-off-by: Jonathan Toppins Acked-by: Íñigo Huguet Tested-by: Ivan Vecera --- 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*//' <