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: 13322781 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 7B951C001DC for ; Sat, 22 Jul 2023 04:49:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231231AbjGVEty (ORCPT ); Sat, 22 Jul 2023 00:49:54 -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 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org 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*//' <