Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4404706rwb; Mon, 21 Nov 2022 07:15:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf4z6FCYCPDuBc27DrYXiNRL0E0q7ZFMqYc9btBV6q7aSkKR8Z1OsXpZq86zI3u8H0qeh/+T X-Received: by 2002:a17:906:328e:b0:78d:7f22:2c53 with SMTP id 14-20020a170906328e00b0078d7f222c53mr16283892ejw.420.1669043747659; Mon, 21 Nov 2022 07:15:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669043747; cv=none; d=google.com; s=arc-20160816; b=yzITkCPHuM043h2NH3xeRq+z5Uabw7ifaPwOVJ20JJiTJ4+0AklPlulXa3PKVJDIbK XGlOJN9R1twGGj4J39y6BKlmAYelYQLPJKTm7fmR6PpYwX3H+H/pd4JT8hfG7dlPeRqZ 71SloxQNV6KM5z7uTKZImQHvhl7Aen+vRZXN63uLTSTpY5L9AS/X1/91MPh7lxx9xDup MmpuiV/d+cxWsjx33+A+bX7wsJHNicx6VUqYFl8PpYrHhv/eX/lWQWTpiskT03uiVnfE a57KjXPpzOU7kGyjS8PV/p5XqJ5OqG+EX0u78zzgbSmDoMMWjC1DpvM/Bzn9gRN7ZeK2 Pf2g== 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 Return-Path: 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.15.21; Mon, 21 Nov 2022 07:15:47 -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 + 91 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 ); 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 ; 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 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 , Nicolas Schier 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: 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: 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 Acked-by: Íñigo Huguet Tested-by: Ivan Vecera --- 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(+) 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*//' <