Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp261047rdb; Sat, 30 Sep 2023 03:39:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwaTrp5ZKAOZ/YRfQwDXlpO75HjOu3CNwWKsJK8Q1RbfImkrxWcH0MijvPdGB6Cc0glWwT X-Received: by 2002:a05:6870:41d5:b0:1dc:7e71:d475 with SMTP id z21-20020a05687041d500b001dc7e71d475mr7362909oac.4.1696070343993; Sat, 30 Sep 2023 03:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696070343; cv=none; d=google.com; s=arc-20160816; b=YdEIrdJ3fNmseZaQGYLcpYacx/pSbnpRx8mErP+fBQ/KpCd4TKQAsLO07536+avVbd MGg5TB7pfFj/AoIapXQ1/c1xYDd+EiT8+0FhBdkc/tDLIhbHuIJ0evqd1Sbx9b4J3mFf YsxYxDnlnbmka8lzMJKCDiINie6WTbMxVDZ2O5t8xMoxP+WLqYy7SVL3HEyqt1YFK6Uf 9hMe3PKz2zaNV1uqUKZp3GlJbl2jqh8f4nsimYJ5TSUh24E13zTfNB0wnNJwMger+obK 1RjCVdLqZGF6a8bsZ3SRX7SQMBIn7e91Qbi387DXPtnpajMSB2myOiFjFzDaritUqMyW ZFXQ== 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=ad0YgqrRNFh/8dUP8RQeY4xIp3qpoeMmM8pZy2m2j4o=; fh=wKrPioF+0wPaktGqmf0aQvlk8PY4Pc32rTAsBSAiP8I=; b=aln2NFt+UNkMhLrvbV8RSfySnqZCJLCJBvclGV+G/5s1lUkXFI6Uq6vWZLB2mtWblN C5TTMa8g5rnYmIxDkToz+H4eOk+39DyUc05/ATzFwRbFjdLCVYCsjpLncrcUqNU3Pf/P rpKvzrqFaYWwwBb5KgwVHRDtrNlD+Fr3BB/R1d74H6OfQR2sa8L9Idavj1gB8HO1/+aj 00WZsS9jB0PwmTkBtLVXfa7e3M03pxeFNu+9w+nRLCo2+TWdcFyoP+1lUHpbjzuAkZaG omcFB95DI/3od/QvtIA/IbyynjfC4H01kIkybH+2FcT1zBbgw+JOnllplSCB9L+se7fA lLjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HAtFK7Ml; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id m71-20020a633f4a000000b00578af609d05si21904047pga.244.2023.09.30.03.39.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 03:39:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HAtFK7Ml; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id CC30C8074527; Sat, 30 Sep 2023 03:39:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234054AbjI3KjA (ORCPT + 99 others); Sat, 30 Sep 2023 06:39:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229778AbjI3Ki7 (ORCPT ); Sat, 30 Sep 2023 06:38:59 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B133A193; Sat, 30 Sep 2023 03:38:56 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04CC2C433C8; Sat, 30 Sep 2023 10:38:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696070336; bh=ObsaoJzZCd6Y+/Hau9L6u5iVOT+vjhyYDzlov334978=; h=From:To:Cc:Subject:Date:From; b=HAtFK7MltYgaaoBG7kbomIGo8aFmFqgdfgTkKhp0j9vqFWoz8iGcJg0Oag7rEOJ0b vrLb3OyGJSJntn4pY6VYNv6OwwDuAhQo6banErA9Pob7EM58+0+qaJXc+G63RuuEbo Jp9leg8GpZWxfAqo8fzm3r88d1eC/8AbvKgWsTWvGHAFXxCO0ag83Ly4BxTJrbOXRB TKfb44Zuqg+n7/nPt5oLWJputpqdq99R9wUvHDQcg7njJFb6X31y6jN5lnj9JG5Dw0 9Tr5W/WiNrrihNNFPdDbWoVTntDYCOO0dykJJ/E/pSeKFuA33YEDYl4S8vngfpQEQP JBIGpZvLK2S1Q== 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] kbuild: rpm-build: generate kernel.spec in rpmbuild/SPECS/ Date: Sat, 30 Sep 2023 19:38:47 +0900 Message-Id: <20230930103847.1272324-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 30 Sep 2023 03:39:03 -0700 (PDT) kernel.spec is the last piece that resides outside the rpmbuild/ directory. Move all RPM-related files to rpmbuild/ consistently. Signed-off-by: Masahiro Yamada --- .gitignore | 1 - Makefile | 2 +- scripts/Makefile.package | 8 ++++---- scripts/package/mkspec | 6 ++++++ scripts/remove-stale-files | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 0bbae167bf93..98274e1160d7 100644 --- a/.gitignore +++ b/.gitignore @@ -74,7 +74,6 @@ modules.order # # RPM spec file (make rpm-pkg) # -/kernel.spec /rpmbuild/ # diff --git a/Makefile b/Makefile index 3de08c780c74..9e77a58207a8 100644 --- a/Makefile +++ b/Makefile @@ -1486,7 +1486,7 @@ MRPROPER_FILES += include/config include/generated \ certs/signing_key.pem \ certs/x509.genkey \ vmlinux-gdb.py \ - kernel.spec rpmbuild \ + rpmbuild \ rust/libmacros.so # clean - Delete most, but leave enough to build external modules diff --git a/scripts/Makefile.package b/scripts/Makefile.package index 2bcab02da965..05b8c3e29aac 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -69,9 +69,9 @@ $(linux-tarballs): .tmp_HEAD FORCE # --------------------------------------------------------------------------- quiet_cmd_mkspec = GEN $@ - cmd_mkspec = $(srctree)/scripts/package/mkspec > $@ + cmd_mkspec = $(srctree)/scripts/package/mkspec $@ -kernel.spec: FORCE +rpmbuild/SPECS/kernel.spec: FORCE $(call cmd,mkspec) PHONY += rpm-sources @@ -88,8 +88,8 @@ srcrpm-pkg: private build-type := s binrpm-pkg: private build-type := b rpm-pkg srcrpm-pkg: rpm-sources -rpm-pkg srcrpm-pkg binrpm-pkg: kernel.spec - +$(strip rpmbuild -b$(build-type) kernel.spec \ +rpm-pkg srcrpm-pkg binrpm-pkg: rpmbuild/SPECS/kernel.spec + +$(strip rpmbuild -b$(build-type) rpmbuild/SPECS/kernel.spec \ --define='_topdir $(abspath rpmbuild)' \ $(if $(filter a b, $(build-type)), \ --target $(UTS_MACHINE)-linux --build-in-place --noprep --define='_smp_mflags %{nil}' \ diff --git a/scripts/package/mkspec b/scripts/package/mkspec index d41608efb747..ce201bfa8377 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -9,6 +9,12 @@ # Patched for non-x86 by Opencon (L) 2002 # +output=$1 + +mkdir -p "$(dirname "${output}")" + +exec >"${output}" + if grep -q CONFIG_MODULES=y include/config/auto.conf; then echo '%define with_devel %{?_without_devel: 0} %{?!_without_devel: 1}' else diff --git a/scripts/remove-stale-files b/scripts/remove-stale-files index 8b1a636f8543..385610fe3936 100755 --- a/scripts/remove-stale-files +++ b/scripts/remove-stale-files @@ -38,4 +38,4 @@ rm -rf include/ksym find . -name '*.usyms' | xargs rm -f -rm -f binkernel.spec +rm -f *.spec -- 2.39.2