From patchwork Fri Apr 10 13:15:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 6195571 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 4D28E9F2E9 for ; Fri, 10 Apr 2015 13:15:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6467E20220 for ; Fri, 10 Apr 2015 13:15:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 749DA203C0 for ; Fri, 10 Apr 2015 13:15:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932545AbbDJNPd (ORCPT ); Fri, 10 Apr 2015 09:15:33 -0400 Received: from mail-la0-f47.google.com ([209.85.215.47]:34718 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932434AbbDJNPc (ORCPT ); Fri, 10 Apr 2015 09:15:32 -0400 Received: by laat2 with SMTP id t2so12989506laa.1 for ; Fri, 10 Apr 2015 06:15:30 -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:in-reply-to :references; bh=XgjRiULhi6Hj57CANVuvD/v5d7F/WJ5aoVAbYpw0AeE=; b=AJf0tDJN8bkvHSlo5djISetKXvCpT5r0bKLJX+FgxCP+NvRCQ3XBeIMY8jX4+FEOij ktm03FuGhaXZs3arxRvKLODXwnU6W4Hu5v8gmHeQAb8OMWvMK+kgItB0B0tG+FQzxQf4 wA+LTINHYC8GwyHlDb6KQyoQJjjHXl40wiJhB+np1j54O/ZIdSvwikpWOT1GVX1YcuXx v9uzu3LMszYYwA5jMe3pJIPV295IDl8+jAJYUVKWAYr82E0GV8g0ItUcAbXyiVSdDj/G IR/y7IDw9beB9y9gQoBHh8w01n0UuVOzhpPZZn7q/WR4GJMm+vl2kSAWGSogSrcnF69l GWDw== X-Gm-Message-State: ALoCoQkxcDZ2PwXIhDL64D0nqLIzk2JM+moy1YKLTxYSmELBgdk4EkkBP2AZOFcuQEZ4UX41Yar2 X-Received: by 10.112.211.134 with SMTP id nc6mr1419675lbc.52.1428671730857; Fri, 10 Apr 2015 06:15:30 -0700 (PDT) Received: from localhost.localdomain (91-157-196-38.elisa-laajakaista.fi. [91.157.196.38]) by mx.google.com with ESMTPSA id jp18sm453817lab.34.2015.04.10.06.15.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Apr 2015 06:15:29 -0700 (PDT) From: riku.voipio@linaro.org To: linux-kbuild@vger.kernel.org, mmarek@suse.cz, debian-kernel@lists.debian.org Cc: Riku Voipio Subject: [PATCH 2/2] deb-pkg: add source package Date: Fri, 10 Apr 2015 16:15:14 +0300 Message-Id: <34017611f8a0056a09d2c38412efd7828efe00fe.1428671643.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: 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 By passing BUILD_SOURCE=y variable, make deb-pkg builds a debian source package. It will generate a minimal debian/rules file that calls back to make deb-pkg. Generated source package will build the same kernel .config than what was available for make deb-pkg. The source package is useful for gpl compliance, or for feeding to a automated debian package builder. Patch depends on the "deb-pkg: move setting debarch for a separate function" for correct changelog filenames. Signed-off-by: Riku Voipio --- scripts/package/builddeb | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/scripts/package/builddeb b/scripts/package/builddeb index e397815..3d77fd3 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -272,12 +272,23 @@ On Debian GNU/Linux systems, the complete text of the GNU General Public License version 2 can be found in \`/usr/share/common-licenses/GPL-2'. EOF + +build_depends="bc, " +if [ -n "$BUILD_TOOLS" ] +then + build_depends="$build_depends python-dev, libperl-dev, bison, flex, \ +libaudit-dev, libdw-dev, libelf-dev, libiberty-dev, libnewt-dev, autoconf, \ +automake, libtool, libglib2.0-dev, libudev-dev, libwrap0-dev, libiberty-dev, \ +libunwind8-dev [amd64 arm64 i386], libnuma-dev [amd64 arm64 i386 powerpc ppc64 ppc64el] " +fi + # Generate a control file cat < debian/control Source: linux-upstream Section: kernel Priority: optional Maintainer: $maintainer +Build-Depends: $build_depends Standards-Version: 3.8.4 Homepage: http://www.kernel.org/ EOF @@ -425,4 +436,35 @@ EOF create_package "$tools_packagename" "$tools_dir" fi +if [ -n "$BUILD_SOURCE" ] +then + cat < debian/rules +#!/usr/bin/make -f + +build: + cp debian/config .config + \$(MAKE) oldconfig + +binary-arch: + \$(MAKE) KDEB_PKGVERSION=${packageversion} BUILD_TOOLS=$BUILD_TOOLS deb-pkg + +clean: + \$(MAKE) clean + +binary: binary-arch +EOF + + (cd $KBUILD_SRC; git archive --prefix=linux-upstream-${version}/ HEAD)|gzip -9 > ../linux-upstream_${version}.orig.tar.gz + cp $KCONFIG_CONFIG debian/config + tar caf ../linux-upstream_${packageversion}.debian.tar.gz debian/{config,copyright,rules,changelog,control} + dpkg-source -cdebian/control -ldebian/changelog --format="3.0 (custom)" --target-format="3.0 (quilt)" \ + -b / ../linux-upstream_${version}.orig.tar.gz ../linux-upstream_${packageversion}.debian.tar.gz + mv linux-upstream_${packageversion}*dsc .. + dpkg-genchanges > ../linux-upstream_${packageversion}_${debarch}.changes +else + dpkg-genchanges -b > ../linux-upstream_${packageversion}_${debarch}.changes +fi + + + exit 0