From patchwork Thu Feb 2 03:37:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13125247 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 68252C05027 for ; Thu, 2 Feb 2023 03:39:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232053AbjBBDj2 (ORCPT ); Wed, 1 Feb 2023 22:39:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232145AbjBBDi4 (ORCPT ); Wed, 1 Feb 2023 22:38:56 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89CC37CC8E; Wed, 1 Feb 2023 19:38:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 33226B823F3; Thu, 2 Feb 2023 03:38:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DC52C433D2; Thu, 2 Feb 2023 03:38:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675309110; bh=x0KTKr8AWX5SJ12jjijewRor4FwBC86L1vP2JGQb2o0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YoJXVmAeUENsU+fdPArOWx1wGbKJxv8AOK4KsFllmQF6NK4cmlVHyXF4/I/7PCIrb WqolRgbtNIEHgUFEndVLULWcGhKqg0wMwWglvnJu9nirUN7qHXR+cEO9c48Klm0SNb +1w1lPHn6j22lUSowZ6WsFbQOoDCxXQcX5HcaYVLWzT3/aypkgdDah+TdanUiLs6D9 atVdLiY44t7/AEuOItP12lt3QPhekv0Or1INO5q61wYlK/cjHtmBSjXr0fxURkiieF QKz5CFNiMF1IMNN2SeAyXGKdt470nTp2XAgO6ss7FV0yzgaULklCwk8WFq8LRgYsYZ 7oAuDQhL0j7OQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Ben Hutchings , Masahiro Yamada Subject: [PATCH v4 3/6] kbuild: rpm-pkg: build binary packages from source rpm Date: Thu, 2 Feb 2023 12:37:13 +0900 Message-Id: <20230202033716.341858-4-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202033716.341858-1-masahiroy@kernel.org> References: <20230202033716.341858-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The build rules of rpm-pkg and srcrpm-pkg are almost the same. Remove the code duplication. Change rpm-pkg to build binary packages from the source package generated by srcrpm-pkg. This changes the output directory of the srpm generated by 'make rpm-pkg' because srcrpm-pkg overrides _srcrpmdir. Signed-off-by: Masahiro Yamada --- (no changes since v3) Changes in v3: - Explain that the source package location will be changed. scripts/Makefile.package | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/Makefile.package b/scripts/Makefile.package index 14567043a8af..ebf3db81b994 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -79,11 +79,9 @@ quiet_cmd_tar = TAR $@ # rpm-pkg # --------------------------------------------------------------------------- PHONY += rpm-pkg -rpm-pkg: - $(MAKE) clean - $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec - $(call cmd,src_tar,$(KERNELPATH),kernel.spec) - +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ta $(KERNELPATH).tar.gz \ +rpm-pkg: srpm = $(shell rpmspec --srpm --query --queryformat='%{name}-%{VERSION}-%{RELEASE}.src.rpm' kernel.spec) +rpm-pkg: srcrpm-pkg + +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -rb $(srpm) \ --define='_smp_mflags %{nil}' # srcrpm-pkg