From patchwork Sat Jul 22 04:48:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 124206 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp623906vqg; Fri, 21 Jul 2023 22:03:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlFyXTjNfJCSp7P9X63hl4qn7LaU8XgynUAQBqj6DoLR0jugouliszV+KCuLdkavR+VgGIcn X-Received: by 2002:a05:6a00:3982:b0:678:ee57:7b29 with SMTP id fi2-20020a056a00398200b00678ee577b29mr1526204pfb.30.1690002188960; Fri, 21 Jul 2023 22:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690002188; cv=none; d=google.com; s=arc-20160816; b=gg0AAdkv+bjl3XXVP9r39+4BazFvNnSoq5nmMe6wllMvYpEiQZrcWWI2frswwAP7jv dKsySriolUwQeeCA8NLDRbcLeZkMxqQhtxRv3VwFYQVzb6FBF2joR9uXjT+hhrJtlQct 9JlbxUEA244HKeZfFyXbQicDpDJ5khk42XDyoFyb7E4iVkUYXzpd9ZyCbYPr7oFN9oS6 3+zGrewr0rb8k0zOGt/TZATAC+4hEE2+AfIr0aEkSCx4e0/t+9Fr2C3CfNhkqqQNazMF I4Imr/2b3DFPwK+2IDt7h5zQdgaxwGXqK0+jgF3uzURMXJXW0YV+ZDdndjVvPapR8FgN Njeg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Dy/Zrw4OL1oTY2CEgYQMJam1fWMQXGY1x/YEFyBVUls=; fh=rliOZr6Fz5JmnSfKOt6v3ZHxXv/lQ1TnqU77+ZCO3og=; b=VokIVbp18zMeNu8BkQhfVpqXzXlkthzzIiS3mqdiKM+O86TnbyBzNOfQaXrqpz1cLW ld0gSWqQrvSulDwyCDakuBGTFS9OUlwvBHdKg7v/6M3ZTxMqVBlusPxw60GcqhMSl9Qp nzprVFYxqnLwKzabFvn0R4KGG5Gc9t4NlQXggXzJV2s4dZNGoiUFP+dDt0biyZHrtTOL akcFE1rZumXRn5254fqbOxazpqFu+E6nCyMRpRsOX21TUUWesxIaAPTqGqeIwdvrtI95 wdmA8px9trGnohsWCNeSgiWt4WOJxXr+/CPeQxwrZIjvSLx/zp+Z4zjXStz8g308x1uo fqnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PSnQAo56; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h16-20020a056a00231000b00675e1bc6133si4807935pfh.47.2023.07.21.22.02.56; Fri, 21 Jul 2023 22:03:08 -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=@kernel.org header.s=k20201202 header.b=PSnQAo56; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231345AbjGVEt4 (ORCPT + 99 others); Sat, 22 Jul 2023 00:49:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231234AbjGVEtU (ORCPT ); Sat, 22 Jul 2023 00:49:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2ECE4481; Fri, 21 Jul 2023 21:48:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F1C1A60A38; Sat, 22 Jul 2023 04:48:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55880C433C9; Sat, 22 Jul 2023 04:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690001315; bh=K5EMB4EDqAGzw3tXLfrUnbHaTr83QeJOoKsDtkrvNl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PSnQAo56iRUsS9UpvQS8Tv/WMntDW2EL0COYoZ9ju4fYGHiojyYq66XRWIAlZws9z wR5/Q0BorMYEOn70a1bOY1kVIPfkSMX6rnS4zCrDtN+WtGVm6vsLO4+ODowQEdi9XY 1JhZr/B21BHoUhsD/I1vJW5WZCEx/23SVJLxgrH4pKc0K1Mix5sonG3xeubBQYkpER tibuS9Xr9h+i0x6SFPCx30El76Y4/fkMp86sOgw29Jn5H9eEe9V5tOj4mRbllye+LO bH3NlSKlcLzW88LW0FQt5iMN7EzKXWGF6D7ge/AmReM6ejGIyNqN7QJl5h3V7szdlG IBYiBp7SEuagg== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH 14/19] kbuild: rpm-pkg: introduce %{with_devel} switch to select devel package Date: Sat, 22 Jul 2023 13:48:01 +0900 Message-Id: <20230722044806.3867434-14-masahiroy@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230722044806.3867434-1-masahiroy@kernel.org> References: <20230722044806.3867434-1-masahiroy@kernel.org> MIME-Version: 1.0 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_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772095735658516479 X-GMAIL-MSGID: 1772095735658516479 scripts/package/mkspec preprocesses the spec file by sed, but it is unreadable. This commit removes the last portion of the sed scripting. Remove the $S$M prefixes from the conditionally generated lines. Instead, surround the code with %if %{with_devel} ... %endif. Signed-off-by: Masahiro Yamada --- scripts/Makefile.package | 2 +- scripts/package/mkspec | 53 +++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/scripts/Makefile.package b/scripts/Makefile.package index 8373644a0473..c36ae03d6002 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -89,7 +89,7 @@ binrpm-pkg: $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ $(UTS_MACHINE)-linux -bb $(objtree)/binkernel.spec \ - --build-in-place --noprep --define='_smp_mflags %{nil}' \ + --build-in-place --noprep --define='_smp_mflags %{nil}' --without devel \ --define='make $(MAKE)' # deb-pkg srcdeb-pkg bindeb-pkg diff --git a/scripts/package/mkspec b/scripts/package/mkspec index 2613e85cd844..511cae46a90d 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -10,11 +10,7 @@ # # how we were called determines which rpms we build and how we build them -if [ "$1" = prebuilt ]; then - S=DEL -else - S= - +if [ -z "$1" ]; then mkdir -p rpmbuild/SOURCES cp linux.tar.gz rpmbuild/SOURCES cp "${KCONFIG_CONFIG}" rpmbuild/SOURCES/config @@ -22,17 +18,12 @@ else fi if grep -q CONFIG_MODULES=y include/config/auto.conf; then - M= +echo '%define with_devel %{?_without_devel: 0} %{?!_without_devel: 1}' else - M=DEL +echo '%define with_devel 0' fi -# We can label the here-doc lines for conditional output to the spec file -# -# Labels: -# $S: this line is enabled only when building source package -# $M: this line is enabled only when CONFIG_MODULES is enabled -sed -e '/^DEL/d' -e 's/^\t*//' <