From patchwork Wed Sep 2 09:57:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 7110271 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 48B269F1CD for ; Wed, 2 Sep 2015 09:57:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 65F28205EF for ; Wed, 2 Sep 2015 09:57:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 715972028D for ; Wed, 2 Sep 2015 09:57:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751578AbbIBJ5N (ORCPT ); Wed, 2 Sep 2015 05:57:13 -0400 Received: from mail-lb0-f181.google.com ([209.85.217.181]:34512 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751451AbbIBJ5M (ORCPT ); Wed, 2 Sep 2015 05:57:12 -0400 Received: by lbbmp1 with SMTP id mp1so2905050lbb.1 for ; Wed, 02 Sep 2015 02:57:10 -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=AWUCFRdkhRrMfl4DXrx5TmKLVR6cLXMSLk6y0Avy6NU=; b=G7uzkyCvJkRVXIaEJKRSNeGjlBkbtKA7X8MtrQYrmKzFbtHj3SuJDavoPq9NJaiMIc MNFaem/HNJMuNcoDaGbmD8L1iw3aFQCg67ylfDPLx8Ej00rTSZAQtsc2EudFKdsK8/pe JcDke7SFv78m9pQzVdhusQZK/rgxxXfiT79SW11ee2CC4hh4c/Gk6bk2yXm3Hyk2OCOe v3jVwqsbDSAl9C262vT62Avu9svGG5jtZYw7XvO3u9+ZjRcx1Ti2sqTmTSf7DjaGycHU cbGIYswnzpgom69UgtEDviw+G7/SY9OJY20Z5vCb3j0SedjdtAr+3n5UU6/xGBYZft6S 4m3A== X-Gm-Message-State: ALoCoQmv61VfYebTYoQ06bkUuGTnQ9cHNyHP0P1mQomLC9lNREqfuUnBFrKfE6U35ICiSd8gbNGG X-Received: by 10.112.25.69 with SMTP id a5mr15696859lbg.16.1441187830643; Wed, 02 Sep 2015 02:57:10 -0700 (PDT) Received: from localhost.localdomain (91-157-196-38.elisa-laajakaista.fi. [91.157.196.38]) by smtp.gmail.com with ESMTPSA id nz4sm5409307lbb.38.2015.09.02.02.57.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Sep 2015 02:57:09 -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: Wed, 2 Sep 2015 12:57:08 +0300 Message-Id: <1441187828-10599-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. As added bonus, we can now pretty print TAR 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 --- v2: don't use tar --transform anymore scripts/package/Makefile | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 8b11d5a..297e756 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -24,27 +24,30 @@ # 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; \ +ln -sf $(srctree) $(2); \ +tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \ + $(addprefix $(2)/,$(TAR_CONTENT) $(3)); \ +rm -f $(2) $(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