Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1402893rwi; Wed, 19 Oct 2022 10:08:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4OAVfLmWAMoU0oiaUAelylGxKDGASlo7P0Tgc5mzGYAUkGHcap/gG2zHfJoQaW535j1aqI X-Received: by 2002:a17:903:1209:b0:179:d027:66e6 with SMTP id l9-20020a170903120900b00179d02766e6mr9606240plh.67.1666199282144; Wed, 19 Oct 2022 10:08:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666199282; cv=none; d=google.com; s=arc-20160816; b=oxrb0mDoIfWSgIPOzsMZz/6xJYxF7AZHk2xAu0UV0ots8wRbcCfIgbbFCDK+fXHp5Q VZcbRvQGLot6PFxqXbFQabQVHpVxAdsIGn7hS7TtzPsPZO74KQHbWZ/0SeVKHgX9OK5k pJSFztyAYSaJ+dhttd1iuoVwalv1sIrAD3gJxH7JJSeWYT8LC0ZR3YRlF8EkOC8ObSQi hC7GF18T50xr9U1uPmuV6yQ3jgpTpGehkGAVT5bcJleh8qooelfnA6u9EqkO0gSMTWvR warzeRKCZzM/iATnca+6gVbQSA4G3nO5OnouhUdOemnlnAR8NXAj5g1ZCXd+gXXkrUHz awvw== 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=UA1MSHh06dRvOZjXkSfnfOXGfZTas1Qse0r1hBrTVCL6vWMIPUJIREOLahpjKrAJ0b DoQ+e78WTMQmFD+nu6CMmXEoVpugznRy3Mzucdo/met9OB9KDhZKqVpD3X5JH+gejxSE XhTN8z8vB2dF+kuZUBX3n0CQIgIEPPK7+hLbTDnN5GRUxJRdf46HyeL0Y2h7FOc8glWs ab7IsXR+wCWLRlgdK3xn6dgN6WdgIqhaLNlAGJIh85DafOEgbVHXI6nSFkMCWwS3h+G+ 6kSFHNUQDkioa1/J3sjn+qolNcDmhrfRvdmsfVVAuXtWRYkdR2auaEEXYakFmQzi8uhN gCXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=e9zhi2NC; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 12-20020a170902c20c00b0017f5b7b0655si16597277pll.305.2022.10.19.10.07.48; Wed, 19 Oct 2022 10:08:02 -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=e9zhi2NC; 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 S231402AbiJSPzM (ORCPT + 99 others); Wed, 19 Oct 2022 11:55:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbiJSPyX (ORCPT ); Wed, 19 Oct 2022 11:54:23 -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 99E20188A9C for ; Wed, 19 Oct 2022 08:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666194687; 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=e9zhi2NCRsULAP/DzXjfaTOwHzXcGNg+JomyMtYVFOIhWJnyWT2XopbVEDSfINND3oLsZg ayXKL9A8C4mPTHYYpI+KNFKvtujpENCVirLd/fPKkA/bhpox2p34wenSq/mB1CnimDuffT 5qRIMwzZXYk1QDL1fJlY8vx94+GOsGI= 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-21-iFkQkA9NOhC-My5HscVccQ-1; Wed, 19 Oct 2022 11:41:09 -0400 X-MC-Unique: iFkQkA9NOhC-My5HscVccQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B272A2932493; Wed, 19 Oct 2022 15:41:08 +0000 (UTC) Received: from jtoppins.rdu.csb (unknown [10.22.34.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CF1686D78; Wed, 19 Oct 2022 15:41:08 +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: [RFC PATCH] kbuild: add ability to make source rpm buildable using koji Date: Wed, 19 Oct 2022 11:40:12 -0400 Message-Id: <5b59fdb7db34f5292b1d138939c6b70b2b2039dd.1666194012.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.5 X-Spam-Status: No, score=-2.4 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: X-Mailing-List: linux-kernel@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 --- 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*//' <