From patchwork Tue Sep 1 13:48:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 7105441 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9F72F9F36E for ; Tue, 1 Sep 2015 13:49:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B2B61205F3 for ; Tue, 1 Sep 2015 13:49:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 07F0E205F2 for ; Tue, 1 Sep 2015 13:49:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752189AbbIANtA (ORCPT ); Tue, 1 Sep 2015 09:49:00 -0400 Received: from mail-la0-f49.google.com ([209.85.215.49]:35009 "EHLO mail-la0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751141AbbIANs7 (ORCPT ); Tue, 1 Sep 2015 09:48:59 -0400 Received: by lanb10 with SMTP id b10so57888573lan.2 for ; Tue, 01 Sep 2015 06:48:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ec3Gzlpgw5uqwo34fu0chgil0Xw2AXbsmnpcUkTGuVo=; b=iZ7OF8XiMFrKz5I17a0nkO0MAiGDpY7VQNa0pSW6ocaNFv42XzOsrNQGjJZeMxqKeP IGObSM/66goEj+2fCmTWDQ+s/SEbHtJpb9VHxiktTnlEKbNtLeOif7UCzEUYh/TEcVU/ 6gi2/P4+so+Y7g8N2lZISdXkZBtXictOBoVx3QPemgETR/Ty2UYDdA5agF3bzZLaqKKK VS3xrZvysYTZ4JLG5s12dxF8dE3aNEF2ofPx0SIDYZdKZT+z84bZaAojs8sBw7o50Qpo cgPfwfm/zZxVCLjl8vjmrgAccXzr/yO5q6qjtS7Sw9IYmeijW9TA7l0bPOhcXqNyfkK3 1y7g== X-Gm-Message-State: ALoCoQmLBIdqv5VUBvKDdmQcOgXTwBwQe4UVqGp0zbgfG/LQH3mmhmTf6sRcjmC3lc94iTDyODFv X-Received: by 10.152.21.196 with SMTP id x4mr12668158lae.117.1441115337162; Tue, 01 Sep 2015 06:48:57 -0700 (PDT) Received: from localhost.localdomain (91-157-196-38.elisa-laajakaista.fi. [91.157.196.38]) by smtp.gmail.com with ESMTPSA id ju7sm4783579lbc.43.2015.09.01.06.48.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Sep 2015 06:48:56 -0700 (PDT) From: riku.voipio@linaro.org To: linux-kbuild@vger.kernel.org, mmarek@suse.cz Cc: Riku Voipio Subject: [PATCH] package/Makefile: move source tar creation to a function Date: Tue, 1 Sep 2015 16:48:54 +0300 Message-Id: <1441115335-25165-1-git-send-email-riku.voipio@linaro.org> X-Mailer: git-send-email 2.4.6 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Riku Voipio Split source tarball creation from rpm-pkg target so it can be used from deb-pkg target as well. Other improvements: - Replace symlink to self with tar --transform - Print the name of tarball created in quiet mode This patch prepares the groundwork for deb-pkg source package adding bit. Signed-off-by: Riku Voipio --- scripts/package/Makefile | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 8b11d5a..65cf12d 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -24,27 +24,29 @@ # Remove hyphens since they have special meaning in RPM filenames KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE)) # Include only those top-level files that are needed by make, plus the GPL copy -TAR_CONTENT := $(KBUILD_ALLDIRS) kernel.spec .config .scmversion Makefile \ +TAR_CONTENT := $(KBUILD_ALLDIRS) .config .scmversion Makefile \ Kbuild Kconfig COPYING $(wildcard localversion*) -TAR_CONTENT := $(addprefix $(KERNELPATH)/,$(TAR_CONTENT)) MKSPEC := $(srctree)/scripts/package/mkspec +quiet_cmd_src_tar = TAR $(2).tar.gz + cmd_src_tar = \ +if test "$(objtree)" != "$(srctree)"; then \ + echo "Building source tarball is not possible outside the"; \ + echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \ + echo "binrpm-pkg or bindeb-pkg target instead."; \ + false; \ +fi ; \ +$(srctree)/scripts/setlocalversion --save-scmversion; \ +tar -cz $(RCS_TAR_IGNORE) --transform 's,^,$(2)/,' \ + -f $(2).tar.gz $(TAR_CONTENT) $(3);\ +rm -f $(objtree)/.scmversion + # rpm-pkg # --------------------------------------------------------------------------- rpm-pkg rpm: FORCE - @if test "$(objtree)" != "$(srctree)"; then \ - echo "Building source + binary RPM is not possible outside the"; \ - echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \ - echo "binrpm-pkg target instead."; \ - false; \ - fi $(MAKE) clean - ln -sf $(srctree) $(KERNELPATH) $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec - $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --save-scmversion - tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(TAR_CONTENT) - rm $(KERNELPATH) - rm -f $(objtree)/.scmversion + $(call cmd,src_tar,$(KERNELPATH),kernel.spec) $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version mv -f $(objtree)/.tmp_version $(objtree)/.version rpmbuild --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz