Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8514916rwi; Tue, 25 Oct 2022 07:35:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM69g0nHMeGoF9RScqy/jY3xLGAyEXDhzB67R65ZDUkabpMxZXZN+Yehi4qQ5MMRjk3mdIGc X-Received: by 2002:a63:e74d:0:b0:46e:acf4:7590 with SMTP id j13-20020a63e74d000000b0046eacf47590mr21801042pgk.465.1666708534173; Tue, 25 Oct 2022 07:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666708534; cv=none; d=google.com; s=arc-20160816; b=YHdFJehzqkAvXMAuW3geDqEc8lPo0xYzdrOBQRTSb6zoydbIODwFi4c9BQX8dhA6XQ VzjTBLBCWVpd4QdMEmU3T++iEcKttR6S3Eo/lc4F3r7CTEijzRTbcWfqE1fEQ0KzV33U ckdatm3Lr7HL02UVA/y7Kgx2xMsMFnS6pS6mNWOTdK0KjtikeRmTnEpwvrbbgMDC8Plo ZbB9op40oAi4eoyheDgn9+2rBJeuBwqmBMR8hkIrp9AMbBDxdB0IiYs5ij/JgQ0kj8XV Ply7MREaC0IxGsQo7AlINFtNIGTbRa3uXUNKdXXLFt4xRQYMPsXz37Ti2hyZTr3ttZtB kwjg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p3-20020a62ab03000000b0052c56cea553si2790460pff.352.2022.10.25.07.35.21; Tue, 25 Oct 2022 07:35:34 -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 + 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 ); 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 ; 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 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: 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*//' <